conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Remove reference to dplyr rdname\n\nbecause it does not work\n"
},
{
"from": "human",
"value": "#' @rdname dplyr::tbl_sql\n#' @export\ntbl_sql <- function(subclass, src, from, ..., vars = NULL) {\n assert_that(is.character(from), length(from) == 1)\n\n from <- db_... | r | chosen |
[
{
"from": "system",
"value": "Make plot somewhat less ugly.\n"
},
{
"from": "human",
"value": "library(\"ggplot2\")\nlibrary(\"reshape2\")\nsetwd(\"~/dev/BitFunnel/src/Scripts\")\n\n# png(filename=\"wat.png\",width=800,height=600)\npng(filename=\"talk.png\",width=1600,height=1200)\n# df <- read.... | r | chosen |
[
{
"from": "system",
"value": "Make dir of container full path\n"
},
{
"from": "human",
"value": "#' SlurmContainer R6 object.\n#'\n#' A slurm container is simply a directory with a specific\n#' structure, particulary it has a submit.slurm script at the\n#' top level.\nSlurmContainer <- R6::R6Cla... | r | chosen |
[
{
"from": "system",
"value": "Add CHECK-SET routine per suggestion from @earl\n\nThe problem which allowing `x: ()` to not be an error was designed to\naddress can be handled in a less system-breaking way with a primitive\nsuggested by @earl, which is CHECK-SET...an arity-2 function that\nsoft-quotes its fi... | r | chosen |
[
{
"from": "system",
"value": "Fix tabs/spaces in example file\n"
},
{
"from": "human",
"value": "library(mongoplyr)\n\nconn <- mongo(db = \"mongoplyr_tests\", collection = \"restaurants\")\n\nMongoPipeline() %>%\n match(.borough == \"Manhattan\" & .cuisine == \"Pizza\") %>%\n execute(conn) -> ... | r | chosen |
[
{
"from": "system",
"value": "Change git repository list's URL\n\nhttps -> http\n"
},
{
"from": "human",
"value": "####### generate .sh script for \"git clone\"\n##### Set git directory structure file path\ngitweb<-\"https://git.chromium.org/gitweb/?a=project_index\"\n#####\nshell.df<-read.csv(g... | r | chosen |
[
{
"from": "system",
"value": "Fix test that unloads the knitr package\n"
},
{
"from": "human",
"value": "context('Test that modules works with knitr')\n\ncheck_knitr = function () skip_if_not_installed('knitr')\n\ntest_that('modules are found when knitr is not loaded', {\n check_knitr()\n ... | r | chosen |
[
{
"from": "system",
"value": "Change the way JSON is served back to writing a file to the disk.\n"
},
{
"from": "human",
"value": "library(jsonlite)\nlibrary(reshape2)\n\nmain <- function(){\n df <- loaded_variables[[1]] # SmartR does not support multiple HDD nodes yet\n fields <- buildField... | r | chosen |
[
{
"from": "system",
"value": "Add example with convexity issue.\n"
},
{
"from": "human",
"value": "source(\"improb-redux.r\")\npmfs = c(\n 0.5, 0.5,\n 0.8, 0.2)\ngetexpectations = getexpectationsfunc(2, pmfs) # 2 = size of possibility space\ngetlowerprevisions = getlowerprevisionsfunc(getexpec... | r | chosen |
[
{
"from": "system",
"value": "Refactor heatmap making and modularize processing the dataframe.\n"
},
{
"from": "human",
"value": "library(gplots)\n\n\nmain <- function(){\n dataset <- loaded_variables[[1]] #dataframe with columns: Row.Label, Bio.marker, ASSAY_0001 ASSAY_0002 ...\n\n measur... | r | chosen |
[
{
"from": "system",
"value": "Simplify the database name for inclusion in report\n\nThe database should focus on having the intent of the runs (e.g.\npre/post season) and NOT have year specific databases\n"
},
{
"from": "human",
"value": "\nrun.year <- 2015\n\npost.season.fram.db <- \"./fram db/... | r | chosen |
[
{
"from": "system",
"value": "Add SlurmContainer add_source & add_input methods\n"
},
{
"from": "human",
"value": "#' SlurmContainer R6 object.\n#'\n#' A slurm container is simply a directory with a specific\n#' structure, particulary it has a submit.slurm script at the\n#' top level.\nSlurmCont... | r | chosen |
[
{
"from": "system",
"value": "Select industrial ralways and import places shapefile\n"
},
{
"from": "human",
"value": "# Team Rython, Dainius Masiliunas and Tim Weerman\n# Date: 11 January, 2016\n# Apache License 2.0\n\n# Needed packages\nlibrary(rgdal)\n\n# Download the data\ndownload.file(\"ht... | r | chosen |
[
{
"from": "system",
"value": "Add documentation to module \"sys\"\n"
},
{
"from": "human",
"value": "# Command line tools don’t want to clutter their output with unnecessary noise.\nlibrary = function (...)\n suppressMessages(base::library(...))\n\n#' The command line arguments\nargs = comman... | r | chosen |
[
{
"from": "system",
"value": "Use older version of kableExtra\n\n*So* I think what's happening is that rocker pins to a\nparticular CRAN snapshot, and kableExtra's 1.3 is too new to\nbe on that snapshot. 1.1.0 is, and so works!\n"
},
{
"from": "human",
"value": "#!/usr/bin/env Rscript\n# For htt... | r | chosen |
[
{
"from": "system",
"value": "Add doc comments to test module for debugging\n"
},
{
"from": "human",
"value": "double = function (x) x * 2\n\n.modname = module_name()\n\ncounter = 1\n\nget_modname = function () .modname\n\nget_modname2 = function () module_name()\n\nget_counter = function () cou... | r | chosen |
[
{
"from": "system",
"value": "Fix all bugs to make running\n"
},
{
"from": "human",
"value": "create_model <- function( dtm, k ) {\n\n library(stm)\n\n out <- readCorpus( dtm, type = \"dtm\" )\n\n documents <- out$documents\n vocab <- out$vocab\n\n topic <- stm(documents, vocab, init.type =... | r | chosen |
[
{
"from": "system",
"value": "Fix typo in test case\n"
},
{
"from": "human",
"value": "context('Operator export test')\n\ntest_that('operators are attached by default', {\n expect_false(exists('%or%'))\n a = import(a)\n on.exit(unload(a))\n\n expect_true(exists('%or%'))\n expect_t... | r | chosen |
[
{
"from": "system",
"value": "Remove unnecessary setup in unit tests\n"
},
{
"from": "human",
"value": "context('Relative imports test')\n\nsetup = function () {\n thispath = file.path(getwd(), 'modules/nested')\n prev = getOption('import.path')\n if (! identical(prev, thispath))\n ... | r | chosen |
[
{
"from": "system",
"value": "Update R3-GUI download URL used in LOAD-GUI\n\ngit-svn-id: df58bffb5a937f084eff32b23172f75a46061293@4557 0b15d6fc-ce89-4483-8625-0b0fabc32e25\n"
},
{
"from": "human",
"value": "REBOL [\r\n\tTitle: \"REBOL Graphics - load-gui patch\"\r\n]\r\n\r\nload-gui: func [\r\n ... | r | chosen |
[
{
"from": "system",
"value": "Correct LAUNCH for unset refinement args\n\nThe LAUNCH command is miserly with its arguments and uses a FUNC and\nnot a FUNCTION, so it reuses the refinement ARGS assuming it can just\ntest ARG. It can do that, but now it has to test for unset.\n"
},
{
"from": "human",... | r | chosen |
[
{
"from": "system",
"value": "Fix documentation of import.attach option\n"
},
{
"from": "human",
"value": "#' An alternative module system for R\n#'\n#' Use \\code{module = import('module')} to import a module for usage.\n#' Fully qualified names are supported for nested modules, reminiscent of\... | r | chosen |
[
{
"from": "system",
"value": "Test that `module_name` keeps working globally\n"
},
{
"from": "human",
"value": "context('Module names')\n\ntest_that('the global namespace has no module name', {\n expect_null(module_name())\n})\n\ntest_that('modules have a name', {\n a = import('a')\n ex... | r | chosen |
[
{
"from": "system",
"value": "Add support for email settings\n"
},
{
"from": "human",
"value": "#' SlurmSettings R6 object.\n#'\n#' An interface to SBATCH settings.\n#'\n#' @export\nSlurmSettings <- R6::R6Class(\"SlurmSettings\",\n public = list(\n nodes = NA,\n cpus_per_task = ... | r | chosen |
[
{
"from": "system",
"value": "Change input to folder where dtm is\n"
},
{
"from": "human",
"value": "source('topics.r')\n\nargs <- commandArgs(trailingOnly = TRUE)\n\nload( args[1] )\nk <- as.integer( args[2] )\n\nmodel <- create_model( dtm , k )\n\npath <- paste( args[1] , '-', args[2], '.rdata... | r | chosen |
[
{
"from": "system",
"value": "Update R3-GUI download URL used in LOAD-GUI\n\ngit-svn-id: df58bffb5a937f084eff32b23172f75a46061293@4557 0b15d6fc-ce89-4483-8625-0b0fabc32e25\n"
},
{
"from": "human",
"value": "REBOL [\n\tTitle: \"REBOL Graphics - load-gui patch\"\n]\n\nload-gui: func [\n \"Downl... | r | chosen |
[
{
"from": "system",
"value": "Add common slurm setting parameters\n"
},
{
"from": "human",
"value": "#' SlurmSettings R6 object.\n#'\n#' An interface to SBATCH settings.\n#'\n#' @export\nSlurmSettings <- R6::R6Class(\"SlurmSettings\")\n"
},
{
"from": "gpt",
"value": "#' SlurmSettings... | r | chosen |
[
{
"from": "system",
"value": "Move heatmap code inside a main function.\n"
},
{
"from": "human",
"value": "library(gplots)\n\ndataset <- loaded_variables[[1]] #dataframe with columns: Row.Label, Bio.marker, ASSAY_0001 ASSAY_0002 ...\n\nmeasurements <- subset(dataset,select=-c(Row.Label,Bio.mark... | r | chosen |
[
{
"from": "system",
"value": "Configure 2015 post season report\n"
},
{
"from": "human",
"value": "\nrun.year <- 2015\n\npost.season.fram.db <- \"./fram db/CohoFRAMVB2015Pre&PostNew.mdb\"\npost.season.run.name <- \"bkCoho2015Post\"\npost.season.tamm <- \"./fram db/Coho1523FinalwAttachCrevised an... | r | chosen |
[
{
"from": "system",
"value": "Support for Plotting WLP added.\n"
},
{
"from": "human",
"value": "setClass(\n\tClass = \"HNUGeoSituation\",\n representation=representation(\n id = \"character\",\n label = \"character\",\n nodes = \"list\",\... | r | chosen |
[
{
"from": "system",
"value": "Fix mistakes with renaming dtm in load()-function\n"
},
{
"from": "human",
"value": "source('topics.r')\n##source('stm.r')\n\nargs <- commandArgs(trailingOnly = TRUE)\n\ndtm <- args[1]\n\nif( ! grepl( '.rdata', dtm ) ) {\n dtm <- paste( dtm, 'dtm.rdata', sep='' )\... | r | chosen |
[
{
"from": "system",
"value": "Convert date times to POSIXct\n\nDo this because this type is easier to work with than POSIXlt\n"
},
{
"from": "human",
"value": "#' ## Code Owners: Kyle Baird, Shea Parkes\n#'\n#' ### Objective:\n#' * Load the data for analytics into native R data structures so i... | r | chosen |
[
{
"from": "system",
"value": "Add further path testing helper\n"
},
{
"from": "human",
"value": "#' Compute normalized logical paths\n#'\n#' \\code{realpath(path)} will return the normalized logical path for\n#' \\code{path}, similar to \\code{normalizePath} but working correctly for\n#' nonexis... | r | chosen |
[
{
"from": "system",
"value": "Use standard format for function names\n"
},
{
"from": "human",
"value": "# Function to get the year from our data, using lubridate\n\n# Lincoln A. Mullen | lincoln@lincolnmullen.com | http://lincolnmullen.com\n# MIT License <http://lmullen.mit-license.org/>\n\nget.... | r | chosen |
[
{
"from": "system",
"value": "Refactor plotting code to a function\n"
},
{
"from": "human",
"value": "library(ggplot2)\nlibrary(reshape2)\n\nfilenames <- c(\"140123_202748_inclinations.txt\",\n \"140201_185848_inclinations.txt\",\n \"140226_163837_inclinations.txt\")\... | r | chosen |
[
{
"from": "system",
"value": "Make sure the output is a vector before injecting into raster format.\n"
},
{
"from": "human",
"value": "#' (re)shape model output based upon the class of the input data\n#' and valid model estimates. Mainly, reshapes data to a spatial\n#' raster format when requir... | r | chosen |
[
{
"from": "system",
"value": "Make script work with several folders\n"
},
{
"from": "human",
"value": "source('topics.r')\n\ndf = data.frame( k = integer(), ll =integer() )\n\npath <- commandArgs(trailingOnly=TRUE)[0]\n\nfor( f in list.files(path) ){\n\tload(f)\n\tk <- model@k\n\tll <- check_fit... | r | chosen |
[
{
"from": "system",
"value": "Make thread graph shorter for paper submission.\n"
},
{
"from": "human",
"value": "library(\"ggplot2\")\nsetwd(\"~/dev/BitFunnel/src/Scripts\")\n\nargs = commandArgs(trailingOnly=TRUE)\nif (length(args) != 2) {\n stop(\"Required args: inputFilename, outputFilename... | r | chosen |
[
{
"from": "system",
"value": "Fix xrange to work in data.frame\n"
},
{
"from": "human",
"value": "`:` = function (a, b) {\n if (inherits(a, 'xrange'))\n do.call(seq, as.list(c(range(a), by = b)))\n else if (inherits(a, 'factor'))\n interaction(a, b, sep = ':')\n else\n ... | r | chosen |
[
{
"from": "system",
"value": "Add a legend to plot"
},
{
"from": "human",
"value": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.... | r | chosen |
[
{
"from": "system",
"value": "Use arghs to make it more clean\n"
},
{
"from": "human",
"value": "source('topics.r')\n\nprint( commandArgs(trailingOnly=TRUE) )\n\nfor( path in commandArgs(trailingOnly=TRUE) ) {\n\n df = data.frame( k = integer(), ll =integer() )\n\n for( f in list.files(path , ... | r | chosen |
[
{
"from": "system",
"value": "Move to rini for auth details.\n"
},
{
"from": "human",
"value": "# Generic query wrapper to keep the MySQL nastiness out of the code.\ndbquery <- function(db, query, mysqlhost=\"mysql.external.legion.ucl.ac.uk\", mysqlport = 3306) {\n\n# Pull in the RMySQL library ... | r | chosen |
[
{
"from": "system",
"value": "Disable lots of console spam\n\n1) Disabled messages from loading RMySQL.\n\n2) Disabled type warnings from RMySQL.\n"
},
{
"from": "human",
"value": "# Generic query wrapper to keep the MySQL nastiness out of the code.\ndbquery <- function(db, query, mysqlhost=\"my... | r | chosen |
[
{
"from": "system",
"value": "Test updated: Objects within testthat are invisible.\n"
},
{
"from": "human",
"value": "context(\"Testing HNU Links\") \n\n#create 4 Nodes\n\n# HNU Link\n\nn1<- HNUNode.create(x=10, y=20)\nn2<- HNUNode.create(x=13, y=24)\nn3<- new(\"HNUNode\", x=7, y=16)\nn4<- new(... | r | chosen |
[
{
"from": "system",
"value": "Add extensive tests for `is_S3_user_generic`\n"
},
{
"from": "human",
"value": "context('S3 dispatch test')\n\ntest_that('S3 methods are found', {\n s3 = import('s3')\n test = local(getS3method('test', 'character', s3))\n expect_that(test, equals(s3$test.ch... | r | chosen |
[
{
"from": "system",
"value": "Remove equilibriation graphs to speed up report generation\n"
},
{
"from": "human",
"value": "pdf(\"reports/{run}.pdf\")\r\n\r\ndata <- read.csv(\"data/{run}/results.csv\", header=T)\r\n\r\npar(mfrow=c(2,2))\r\nplot(data$T, data$M, xlab=\"Temperature\", ylab=\"Magne... | r | chosen |
[
{
"from": "system",
"value": "Add missing function reference to doc index\n"
},
{
"from": "human",
"value": "#' An alternative module system for R\n#'\n#' Use \\code{module = import('module')} to import a module for usage.\n#' Fully qualified names are supported for nested modules, reminiscent o... | r | chosen |
[
{
"from": "system",
"value": "Change git ripository list's URL\n\nhttps -> http"
},
{
"from": "human",
"value": "####### generate .sh script for \"git clone\"\n##### Set git directory structure file path\ngitweb<-\"https://git.chromium.org/gitweb/?a=project_index\"\n#####\nshell.df<-read.csv(git... | r | chosen |
[
{
"from": "system",
"value": "Fix LAUNCH to properly work with argv-based CALL\n\nThe more comprehensive implementation of CALL switched to a block-based\ninterface for passing multiple arguments. This broke LAUNCH, as LAUNCH\nwould simple concatenate interpreter and script into a single string and\npass th... | r | chosen |
[
{
"from": "system",
"value": "Modify Multiple linear regression R file\n"
},
{
"from": "human",
"value": "# Multiple linear regression for machine learning.\n# \n# A linear regression model that contains more than one predictor variable is\n# called a multiple linear regression model. It is basi... | r | chosen |
[
{
"from": "system",
"value": "Arrange pft data by patient, date, and test type.\n"
},
{
"from": "human",
"value": "options(stringsAsFactors = FALSE)\nlibrary(plyr)\nlibrary(reshape2)\n\nsource(\"inst/R/sclerodata-path.r\")\npft.csv <- file.path(sclerodata.path, \"tPFT.csv\")\npft.rdata <- file.p... | r | chosen |
[
{
"from": "system",
"value": "Add anticodon table from dos Reis\n"
},
{
"from": "human",
"value": "# Based on the paper by Dos Reis & al., 2004\nws = function () {\n}\n\ntai = function () {\n}\n"
},
{
"from": "gpt",
"value": "# Based on the paper by Dos Reis & al, 2004\n\ns = list(na... | r | chosen |
[
{
"from": "system",
"value": "Add link to all functions\n"
},
{
"from": "human",
"value": "#' An alternative module system for R\n#'\n#' Use \\code{module = import('module')} to import a module for usage.\n#' Fully qualified names are supported for nested modules, reminiscent of\n#' Python’s mod... | r | chosen |
[
{
"from": "system",
"value": "Add some explanation in comments to the script.\n"
},
{
"from": "human",
"value": "library(jsonlite)\nlibrary(reshape2)\n\nmain <- function(){\n df <- loaded_variables[[1]]\n fields <- buildFields(df)\n geneSymbols <- unique(fields[\"GENESYMBOL\"])[,1]\n pat... | r | chosen |
[
{
"from": "system",
"value": "Fix dataframe retrieval from loaded_variables\n"
},
{
"from": "human",
"value": "#global_register <-list(rowNames = c(\"a\",\"b\"),\n# columnNames = c(\"1\",\"2\"),\n# origin = c(1,2),\n# data = matri... | r | chosen |
[
{
"from": "system",
"value": "Clean up sample patient code, add severity line.\n"
},
{
"from": "human",
"value": "require(sclero)\nrequire(ggplot2)\nrequire(plyr)\n\ndata(pft)\ndata(patient)\n\nset.seed(2)\n\nn.visits <- ddply(pft, ~ patient.id + test.type, summarize, visits = length(na.omit(tes... | r | chosen |
[
{
"from": "system",
"value": "Fix redundant unload in old test\n"
},
{
"from": "human",
"value": "context('Operator export test')\n\ntest_that('operators are attached by default', {\n expect_false(exists('%or%'))\n a = import('a')\n on.exit(unload(a))\n\n expect_true(exists('%or%'))\... | r | chosen |
[
{
"from": "system",
"value": "Normalize angles from start angle\n"
},
{
"from": "human",
"value": "library(ggplot2)\nlibrary(reshape2)\n\nfilenames <- c(\"Zuma/140123_202748_inclinations.txt\",\n \"Zuma/140201_185848_inclinations.txt\",\n \"Zuma/140226_163837_inclinat... | r | chosen |
[
{
"from": "system",
"value": "Add informative error when matrix size is diff\n\nWhen the number of species in the Host or Parasite phylogeny is\ndifferent to the number of species on the interaction matrix it used to\nspit the “subscript out of bounds” error. Now it tells the actual\nproblem\n"
},
{
... | r | chosen |
[
{
"from": "system",
"value": "Fix bug produced by renaming of slurm script\n"
},
{
"from": "human",
"value": "#' Submit one or more slurm jobs.\n#'\n#' This function will submit your slurm job given the path\n#' to a slurm container.\n#'\n#' @param jobs The \\code{job_<alphanumeric>/} directorie... | r | chosen |
[
{
"from": "system",
"value": "Add scripts for Google Analytics.\n\n\ngit-svn-id: 12ae5aeef08fd453d75833463da4cc20df82a94e@4010 8af8166b-12a6-a448-a533-9086ace3f9f6\n"
},
{
"from": "human",
"value": "=begin html\r\n\r\n=end\r\n"
},
{
"from": "gpt",
"value": "=begin html\r\n<script src... | r | chosen |
[
{
"from": "system",
"value": "Fix typo with id var\n"
},
{
"from": "human",
"value": "#' Comparing \"back checks\" in R (a clone of Stata's bcstats)\n#' \n#' @param surveydata The survey data\n#' @param bcdata The back check data\n#' @param id the unique ID\n#' @param t1vars The list of \"type 1... | r | chosen |
[
{
"from": "system",
"value": "Make the default sbatch options more reasonable\n"
},
{
"from": "human",
"value": "#' SlurmSettings R6 object.\n#'\n#' An interface to SBATCH settings.\nSlurmSettings <- R6::R6Class(\"SlurmSettings\",\n public = list(\n options = c(sbatch_opts$nodes(1),\n ... | r | chosen |
[
{
"from": "system",
"value": "Store also metadatas & make dates date objects\n"
},
{
"from": "human",
"value": "library(stm)\n\nmd <- data.frame( timestamp = timestamps )\n\nprocessed <- textProcessor( documents, metadata = md, stem = FALSE, striphtml = TRUE, language = NA, customstopwords = sto... | r | chosen |
[
{
"from": "system",
"value": "Fix issue with installation of package rhdf5\n"
},
{
"from": "human",
"value": "# install dependancies\n\nif(!require(rhdf5)){install.packages('rhdf5',repos='http://cran.skazkaforyou.com/')}\nif(!require(rgdal)){install.packages('rgdal',repos='http://cran.skazkafory... | r | chosen |
[
{
"from": "system",
"value": "Fix UI to match server.\n\nDo this because OldFaith is gone.\n"
},
{
"from": "human",
"value": "#' ### CODE OWNERS: Shea Parkes, Kyle Baird\n#' \n#' ### OBJECTIVE:\n#' * UI side of Epic FHIR Shiny App.\n#' \n#' ### DEVELOPER NOTES:\n#' * None\n\nrequire(shiny)\n... | r | chosen |
[
{
"from": "system",
"value": "Install bettertrace on startup if not present.\n"
},
{
"from": "human",
"value": ".onAttach <- function(...) {\n if (!isTRUE(getOption(\"syberia.silent\"))) {\n packageStartupMessage(paste0(\"Loading \", crayon::red(\"Syberia\"), \"...\\n\"))\n }\n \n # We wa... | r | chosen |
[
{
"from": "system",
"value": "Save the data to a CSV\n"
},
{
"from": "human",
"value": "#Load Packages\n\nlibrary(XML)\nlibrary(tidyr)\nlibrary(stringr)\nlibrary(magrittr)\nlibrary(dplyr)\nlibrary(RWeka)\n\n#load OCR'd ICC Deceisions data into R\nicc_dir <- \"text\"\nfiles <- dir(icc_dir, \"*.tx... | r | chosen |
[
{
"from": "system",
"value": "Adjust R importing to be relative.\n\nDo this so it will work better up on a server...\n"
},
{
"from": "human",
"value": "#' ## Code Owners: Kyle Baird\n#' ### OWNERS ATTEST TO THE FOLLOWING:\n#' * The `master` branch will meet Milliman QRM standards at all times.... | r | chosen |
[
{
"from": "system",
"value": "Use hashing for more efficient lookup\n"
},
{
"from": "human",
"value": "decorate = modules::import('decorate', attach = TRUE)\nmodules::import('ebits/base', attach = c('closure', 'match_call_defaults'))\n\n# FIXME: Doesn’t work with recursive functions\n# Reproduce... | r | chosen |
[
{
"from": "system",
"value": "Add sample configs to export past FRAM years\n"
},
{
"from": "human",
"value": "\n\nfram.db.name <- \"./fram db/Final pre and post databases/FramVS2-PSC-Coho-PostSeason.mdb\"\nfram.run.name <- \"bc-bkCoho2015 Final\"\n\nrun.year <- 2015"
},
{
"from": "gpt",
... | r | chosen |
[
{
"from": "system",
"value": "Fix path handling when not appending dtm...\n"
},
{
"from": "human",
"value": "source('topics.r')\n##source('stm.r')\n\nargs <- commandArgs(trailingOnly = TRUE)\n\ndtm_path <- args[1]\n\nif( ! grepl( '.rdata', dtm_path ) ) {\n dtm_path <- paste( dtm, 'dtm.rdata', ... | r | chosen |
[
{
"from": "human",
"value": "Add script for plotting number of quadwords.\n"
},
{
"from": "gpt",
"value": "library(\"ggplot2\")\nsetwd(\"~/dev/BitFunnel/src/Scripts\")\n\npng(filename=\"qwords.png\",width=1600,height=1200)\nqueries <- read.csv(header=TRUE, file=\"/tmp/QueryPipelineStatistics.csv... | r | chosen |
[
{
"from": "human",
"value": "Add R script to plot RMSE. (Not yet working).\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\nargs <- commandArgs(trailingOnly = TRUE)\nfile = args[1]\n\nx <- read.csv(file, header=T)\n\nlibrary(ggplot2)\nlibrary(methods)\n\nggplot(x, aes(x = filename, fill ... | r | chosen |
[
{
"from": "human",
"value": "Add demo for predicting worst FVC.\n"
},
{
"from": "gpt",
"value": "# Predict the worst FVC measurements that a person will have base on\n# demographic data.\n\nlibrary(sclero)\nlibrary(ggplot2)\nlibrary(reshape2)\nlibrary(plyr)\n\ndata(patient)\ndata(pft)\n\npatient... | r | chosen |
[
{
"from": "human",
"value": "Add copy&paste convience functions to R\n"
},
{
"from": "gpt",
"value": "pbcopy = function (object, transform = NULL) {\n if (! is.null(transform))\n object = capture.output(transform(object))\n on.exit(close(f))\n f = pipe('pbcopy', 'w')\n writeLi... | r | chosen |
[
{
"from": "human",
"value": "Add script to fit UNREST model\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/Rscript\n\nlibrary(rphast)\n\ntree <- read.tree('mcc.nh')\nload('regDNA.RData')\n\nlocMsa <- msa(regDNA, names(regDNA), alphabet='ACTGN')\ntreeChar <- write.tree(tree)\n\nmod <- phyloFit(locMs... | r | chosen |
[
{
"from": "human",
"value": "Add script that summarizes experimental record\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n\nqueryCol = \"query\"\ntimeoutCol = \"didTimeOut\"\n\nargs <- commandArgs(TRUE)\nrequiredArgCount = 1\nif(length(args) < requiredArgCount) {\n\tcat(sprintf(\"Expe... | r | chosen |
[
{
"from": "human",
"value": "Add script for prepping clinical data.\n"
},
{
"from": "gpt",
"value": "options(stringsAsFactors = FALSE)\nlibrary(plyr)\nlibrary(reshape2)\n\nsource(\"inst/R/sclerodata-path.r\")\nclinic.csv <- file.path(sclerodata.path, \"tVisit.csv\")\nclinic.rdata <- file.path(\"... | r | chosen |
[
{
"from": "human",
"value": "Add path helper functions for testing\n"
},
{
"from": "gpt",
"value": "realpath = function (path) {\n if (.Platform$OS.type == 'unix')\n system(paste('realpath -m -s', shQuote(path.expand(path))), intern = TRUE)\n else\n normalizePath(path, mustWo... | r | chosen |
[
{
"from": "human",
"value": "Add some R codes for ex.1.9.6.\n"
},
{
"from": "gpt",
"value": "x <- 1\ny <- 1\n\ntheta <- 2/5\nn <- 100\nplot(c(-2,2),c(-2,2),type=\"n\")\nabline(v=0)\nabline(h=0)\n\nfor(i in 0:n) {\n angle <- complex(real = cos(2*pi*theta*i), imaginary = sin(2*pi*theta*i))\n poi... | r | chosen |
[
{
"from": "human",
"value": "Add libraries for Stat 131a.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n\nsource(\"/tmp/class-libs.R\")\n\nclass_name = \"Stat 131a\"\nclass_libs = c(\n \"learnr\", \"0.9.2\"\n)\n\nclass_libs_install_version(class_name, class_libs)\n\ndevtools::insta... | r | chosen |
[
{
"from": "human",
"value": "Add script to tidy heatmap.r nested structure into dfs by station\n"
},
{
"from": "gpt",
"value": "# heatmap-tidy.r: take the nested list structure of station_set\n# (from heatmap.r) and convert it to a tidy dataframe of all obs and\n# all stations. then chop it up b... | r | chosen |
[
{
"from": "human",
"value": "Add script for plotting history.\n"
},
{
"from": "gpt",
"value": "library(\"ggplot2\")\nsetwd(\"~/dev/BitFunnel/src/Scripts\")\ndf <- read.csv(header=TRUE, file=\"history.csv\")\n\npng(filename=\"bitfunnel-progress.png\",width=1600,height=1200)\ndf$date <- as.Date(df... | r | chosen |
[
{
"from": "human",
"value": "Add function to parse csv file better\n\nSigned-off-by: Cody W. Eilar <c951a9dfd6009d72a7222f9697e33f76af2d5e79@Gmail.com>\n"
},
{
"from": "gpt",
"value": "LoadVideoFeatures <- function(csv_file){\n options( stringsAsFactors=F )\n df = read.csv(csv_file)\n data_to... | r | chosen |
[
{
"from": "human",
"value": "Add R script for plotting smoothed Precision/Recall curves.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n\nlibrary(data.table)\nlibrary(ggplot2)\n\n\nirPlot <- function(df, type=\"Precision\", n=10, selection=\"\") {\n\n # filter out NaN\n df <- df[... | r | chosen |
[
{
"from": "human",
"value": "Add R script for Polynomial regression\n"
},
{
"from": "gpt",
"value": "# Polynomial regression for machine learning.\n# \n# polynomial regression is a form of regression analysis in which the\n# relationship between the independent variable x and the dependent varia... | r | chosen |
[
{
"from": "human",
"value": "Add a testing file for wrapping variadic functions\n"
},
{
"from": "gpt",
"value": "REBOL []\n\nrecycle/torture\n\nlibc: switch fourth system/version [\n\t3 [\n\t\tmake library! %msvcrt.dll\n\t]\n\t4 [\n\t\tmake library! %libc.so.6\n\t]\n]\n\nprintf: make routine! [\... | r | chosen |
[
{
"from": "human",
"value": "Solve Simple Product in r\n"
},
{
"from": "gpt",
"value": "input <- file('stdin', 'r')\n\na <- as.integer(readLines(input, n=1))\nb <- as.integer(readLines(input, n=1))\n\nwrite(paste(\"PROD =\", a * b), '')\n"
}
] | r | chosen |
[
{
"from": "human",
"value": "Add Decision Tree Regression in R\n"
},
{
"from": "gpt",
"value": "# Decision Tree regression for machine learning.\n# \n# Decision tree builds regression or classification models in the form of a tree\n# structure. It brakes down a dataset into smaller and smaller s... | r | chosen |
[
{
"from": "human",
"value": "Fix interactive legacy data.frame output in R\n"
},
{
"from": "gpt",
"value": "print.data.frame = function (x, ..., digits = NULL, quote = FALSE, right = TRUE,\n row.names = TRUE)\n{\n if (! isTRUE(all.equal(rownames(x), as.character(se... | r | chosen |
[
{
"from": "human",
"value": "Add Support Vector regression with R\n"
},
{
"from": "gpt",
"value": "# Support Vector regression for machine learning.\n# \n# Support Vector Machine can also be used as a regression method, maintaining all\n# the main features that characterize the algorithm (maxima... | r | chosen |
[
{
"from": "human",
"value": "Create script to repair (as best as possible) faulty encodings\n"
},
{
"from": "gpt",
"value": "# This script repairs broken encodings in the base database. These \n# flawed encodings are produced by non-utf changelogs and news files.\nlibrary(plyr)\nsource(\"db.r\"... | r | chosen |
[
{
"from": "human",
"value": "Create a quick analysis file to load and peak at FRC data"
},
{
"from": "gpt",
"value": "#Install dependencies\ninstall.packages(\"reshape2\")\ninstall.package(\"ggplot2\")\n\n#Requires\nrequire(\"reshape2\")\nrequire(\"ggplot2\")\n\n#Import the data\nteams <- read.c... | r | chosen |
[
{
"from": "human",
"value": "Add faster implementation of frequent_words\n"
},
{
"from": "gpt",
"value": "source(\"computing_frequencies.r\")\nsource(\"number_to_pattern.r\")\n\nfaster_frequent_words <- function(text, k) {\n frequent_patterns <- {}\n frequency_array <- computing_frequencies(te... | r | chosen |
[
{
"from": "human",
"value": "Solve Salary with Bonus in r\n"
},
{
"from": "gpt",
"value": "input <- file('stdin', 'r')\n\na <- readLines(input, n=1)\nb <- as.integer(readLines(input, n=1))\nc <- as.double(readLines(input, n=1))\n\nwrite(sprintf(\"TOTAL = R$ %.2f\", b + (c * 0.15)), \"\")\n"
}
... | r | chosen |
[
{
"from": "human",
"value": "Add intorduction to R basics\n"
},
{
"from": "gpt",
"value": "# Introduction to data structures in R\n\n# atomic vector\n# -------------\nv <- c(1,2.0,3.5)\nv1 <- c('foo', 'bar')\n\n# always flat\nc(1, c(2, c(3,4)))\n\n# homogenous -- all elements need to be of one t... | r | chosen |
[
{
"from": "human",
"value": "Add R packages for IAS-C188\n\nFixes #814\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n# From https://github.com/berkeley-dsep-infra/datahub/issues/814\n\ndevtools::install_github('cran/stargazer', ref='5.2.2', upgrade_dependencies=FALSE)\ndevtools::insta... | r | chosen |
[
{
"from": "human",
"value": "Solve Simple Sum in r\n"
},
{
"from": "gpt",
"value": "input <- file('stdin', 'r')\n\na <- as.integer(readLines(input, n=1))\nb <- as.integer(readLines(input, n=1))\n\nwrite(paste(\"SOMA =\", a + b), '')\n"
}
] | r | chosen |
[
{
"from": "human",
"value": "Add an R script to fit the model, and compare with survival::clogit\nestimates\n"
},
{
"from": "gpt",
"value": "## example conditional logistic regression using Stan\n## David C Muller\n\nlibrary(survival)\nlibrary(rstan)\n\nset.seed(77834)\n\n## use the infertility ... | r | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.