Complete the code to read a CSV file named 'data.csv' into a variable called df.
df <- [1]("data.csv")
The read.csv function reads CSV files into R as data frames.
Complete the code to save the data frame df to a CSV file named 'output.csv'.
[1](df, "output.csv")
The write.csv function saves data frames to CSV files.
Fix the error in the code to read a CSV file with headers.
df <- read.csv("data.csv", [1] = TRUE)
The correct argument to specify that the CSV file has headers is header.
Fill both blanks to read a CSV file with semicolon separator and save it back with row names excluded.
df <- read.csv("data.csv", sep = [1]) write.csv(df, "output.csv", row.names = [2])
To read a CSV with semicolon separator, use sep = ";". To exclude row names when saving, use row.names = FALSE.
Fill all three blanks to read a CSV file without converting strings to factors, then write it with UTF-8 encoding and no row names.
df <- read.csv("data.csv", stringsAsFactors = [1]) write.csv(df, "output.csv", fileEncoding = [2], row.names = [3])
Set stringsAsFactors = FALSE to keep strings as characters. Use fileEncoding = "UTF-8" to write with UTF-8 encoding. Set row.names = FALSE to exclude row names.