Usually, I store my datasets in an ASCII/CSV file where the first column is the output or response and the subsequent columns are the input variable, with on row per pattern/observation. In order to load those datasets in R, I'll often find myself separating the input from the output into two variables to feed them into some algorithm. Therefore I created the following function, that can be added to the .Rprofile
With the previous function I can read the dataset in one line, and access separatly the input variables and the output
The function also works if the output is not in the first column, changing the optional parameter response. Optional parameters are also passed along to R function read.table, for instance if the columns are delimited by commas instead of spaces.
Twitter Facebook LinkedIn
The Git Team maintains a bash script that sets a message in your prompt displaying the current branch and status. The script can be found here. To install th...
Inspired partly by this and this Stackoverflow questions, I wanted to test what is the fastest way to create a new column using dplyr as a combination of oth...
This small example aims to provide some use cases for the tidyr package. Let’s generate some example data first:
library(lubridate)
library(tibble)
library(...
The name for the different functions that work with probability distributions in R and SciPy is different, which is often confusing. The following table list...