conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "human",
"value": "Add Multiple linear regression in R\n"
},
{
"from": "gpt",
"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 basically th... | r | chosen |
[
{
"from": "human",
"value": "Install margins for ENVECON C118.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n\nsource(\"/tmp/class-libs.R\")\n\nclass_name = \"2020 Spring Env Econ C118\"\nclass_libs = c(\n \"margins\", \"0.3.23\"\n)\nclass_libs_install_version(class_name, class_libs)... | r | chosen |
[
{
"from": "human",
"value": "Solve Extremely Basic 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\nsoma = a + b\n\nwrite(paste(\"X =\", soma), '')\n"
}
] | r | chosen |
[
{
"from": "human",
"value": "Add a testing file for Windows\n"
},
{
"from": "gpt",
"value": "REBOL []\n\nmsvcrt: make library! %msvcrt.dll\ngetdrives: make routine! compose/deep [\n\t[return: [uint32]]\n\t(msvcrt) \"_getdrives\"\n]\n\nmaps: getdrives\ni: 0\nwhile [i < 26] [\n\tunless zero? maps ... | r | chosen |
[
{
"from": "human",
"value": "Add a test for converting rectypes\n"
},
{
"from": "gpt",
"value": "context(\"Converting rectypes\")\n\ntest_that(\"Converting rectypes works.\",\n expect_equal(\n ripums:::convert_rectype(\n c(`1` = \"H\", `2` = \"P\", `3` = \"I\"),\... | r | chosen |
[
{
"from": "human",
"value": "Solve Average 2 in r\n"
},
{
"from": "gpt",
"value": "input <- file('stdin', 'r')\n\na <- as.double(readLines(input, n=1))\nb <- as.double(readLines(input, n=1))\nc <- as.double(readLines(input, n=1))\n\nresult = sprintf(\"MEDIA = %.1f\", (a * 2.0 + b * 3.0 + c * 5.0... | r | chosen |
[
{
"from": "human",
"value": "Split evaluation and training code\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/Rscript\nmodel <- read(\"model.txt\")\nlayer.size <- model$layer.size\nneuron.size <- model$neuron.size\nsynapse <- model.synapse\n\npf.in <- file(\"test-images\", \"rb\")\npf.out <- file(... | r | chosen |
[
{
"from": "system",
"value": "Remove a currently broken test.\n\nSomething funny is going on here; I'm filing #41 to track it.\n"
},
{
"from": "human",
"value": "context(\"fake\")\n\n# We want to make sure these installed.\nlibrary(lubridate)\nlibrary(stringr)\n\ntest_that(\"returns 3\", {\n ex... | r | chosen |
[
{
"from": "human",
"value": "Add Random Forest Regression in R\n"
},
{
"from": "gpt",
"value": "# Random Forest Regression for machine learning.\n# \n# Random forest algorithm is a supervised classification algorithm. As the name\n# suggest, this algorithm creates the forest with a number of dec... | r | chosen |
[
{
"from": "human",
"value": "Implement doc parsing and display for modules\n\nAdd the following mechanisms:\n\n * Parsing of doc comments for a loaded module (`parse_documentation`)\n * Display module object documentation (`module_help`)\n * Transparent replacements for ``utils::`?``` and `utils::help`\n"
... | 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": "human",
"value": "Add test cases for module file search\n"
},
{
"from": "gpt",
"value": "context('Find module path relative files')\n\ntest_that('module_file works in global namespace', {\n expect_that(module_file(), equals(getwd()))\n expect_true(nchar(module_file('run-all.r'))... | r | chosen |
[
{
"from": "human",
"value": "Add script to make inputs for phast\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/Rscript\n\nlibrary(ape)\n\ntree <- read.nexus('mcc.tree')\nnms <- tree$tip.label\nabs <- sapply(strsplit(nms, '_'), '[[', 1)\nind <- match(abs, state.abb)\nreg <- state.region[ind]\n\nreg... | r | chosen |
[
{
"from": "human",
"value": "Create R script for plotting results related to the master thesis.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env Rscript\n\nsource('functions.r')\n\nresults_path <- '~/Projects/goldfish/results'\ngraphs_path <- '~/Projects/goldfish/graphs'\n\n# list of data set fil... | r | chosen |
[
{
"from": "human",
"value": "Add R Interpolation Research Document.\n"
},
{
"from": "gpt",
"value": "data <- c(xy.coords(0,100), xy.coords(2556288,0), xy.coords(1364832,30), xy.coords(711936,50), xy.coords(498816,60), xy.coords(362880,65), xy.coords(128640,75), xy.coords(88120,84))\n\ndata <- xy... | r | chosen |
[
{
"from": "human",
"value": "Install script for most common/useful packages\n"
},
{
"from": "gpt",
"value": "###############################################\n### COMMONLY USED PACKAGES IN AIM R SCRIPTS ###\n###############################################\n\n#### DATA WRANGLING ####\ninstall.pack... | r | chosen |
[
{
"from": "human",
"value": "Solve Average 1 in r\n"
},
{
"from": "gpt",
"value": "input <- file('stdin', 'r')\n\na <- as.double(readLines(input, n=1))\nb <- as.double(readLines(input, n=1))\n\nresult = sprintf(\"MEDIA = %.5f\", (a * 3.5 + b * 7.5) / 11.0)\nwrite(result, \"\")\n"
}
] | r | chosen |
[
{
"from": "human",
"value": "Add regression template for R\n"
},
{
"from": "gpt",
"value": "# Regression template for machine learning.\n\n# Importing the data set\ndataset = read.csv('Position_Salaries.csv')\ndataset = dataset[2:3]\n\n# Splitting the Dataset into a Training set and a Test set\n... | r | chosen |
[
{
"from": "human",
"value": "Add (R) script to generate histograms of projects wto. number of commits\n"
},
{
"from": "gpt",
"value": "setwd(\"/home/brito/salt/JSRepairClass/input/applications/\")\ndata <- read.csv(\"repositories_metrics.csv\")\nhist(data$TotalCommits, main = paste(\"Histogram f... | r | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.