Syntax

R Read a CSV File Syntax

In R, read a csv file: loads a CSV into a data frame — df <- read.csv("data.csv")

Quick Answer

Syntax
df <- read.csv("data.csv")
RSyntax

Read a CSV File

Code example
df <- read.csv("data.csv")

Loads a CSV into a data frame.

Learn More

How to read a csv file in R

  1. Open your R file or editor.
  2. Copy the example, then replace its sample names and values for your code.

R Read a CSV File Syntax

Use df <- read.csv("data.csv").

Related Syntax References

Frequently asked questions

What is the R syntax for read a csv file?

Use this pattern: df <- read.csv("data.csv")

Can I copy this R code example?

Yes. Use Copy code and adapt the example to your program.

Is this R syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify