read.csv() function in R Language is used to read “comma separated value” files. It imports data in the form of a data frame.
read.csv(file, header, sep, dec)
file: the path to the file containing the data to be imported into R.
header: logical value. If TRUE, read.csv() assumes that your file has a header row, so row 1 is the name of each column. If that’s not the case, you can add the argument header = FALSE.
sep: the field separator character
dec: the character used in the file for decimal points.
Example 1: Reading file from same folder
V1 V2 V3 1 100 AB ab 2 200 CD cd 3 300 EF ef 4 400 GH gh 5 500 IJ ij
Example 2: Reading file from different directory
X V1 V2 V3 1 1 100 a1 b1 2 2 200 a2 b2 3 3 300 a3 b3
- Reading contents of a Text File in R Programming - read.table() Function
- Scan and Read Data from a File in R Programming - scan() Function
- Read Lines from a File in R Programming - readLines() Function
- Working with CSV files in R Programming
- Printing out to the Screen or to a File in R Programming - cat() Function
- How To Import Data from a File in R Programming
- File Handling in R Programming
- Check if a Function is a Primitive Function in R Programming - is.primitive() Function
- Compute Density of the Distribution Function in R Programming - dunif() Function
- Apply a Function over a List of elements in R Programming - lapply() Function
- Search the Interval for Minimum and Maximum of the Function in R Programming - optimize() Function
- Compute the Natural Logarithm of the Absolute Value of Gamma Function in R Programming - lgamma() Function
- Compute the Logarithmic Derivative of the gamma Function in R Programming - digamma() Function
- Compute the Second Derivative of the Logarithmic value of the gamma Function in R Programming - trigamma() Function
- Get the List of Arguments of a Function in R Programming - args() Function
- Recursively apply a Function to a List in R Programming - rapply() function
- Apply a Function over a Ragged Array in R Programming - tapply() Function
- Applying a Function over an Object in R Programming - sapply() Function
- Compute the value of Cauchy Quantile Function in R Programming - qcauchy() Function
- Compute value of Logistic Quantile Function in R Programming - qlogis() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.