File Input/Output
When coding in R, you will often need to input datasets to work with! The easiest ways to do so are either from a .csv file or a .txt file. To do this, you can use the read.csv() and read_table() functions, respectively. The following demonstrates these functions using a hypothetical "hospital_data" dataset.
To output a file from R, use the syntax sink("FileName.FileType").
File Input:
File Output:
Resources:
R Documentation: read.csv file input
More read.csv resources here
R Documentation: read_table file input
R Documentation: File output
Last updated