Read in CSV data with all variable catergories lables

Hi,

I am new to R studio and I am attempting to read a csv file into R studio. I can read the file in but it dies not bring all the information across in terms of the names of the variable catergories. I.e if the answer is "yes" or "no" in the csv file, it is converted back to "0" or "1" in R studio. Is there a code to copy in a csv file in exactly the same format as the csv file with all labels and values retained?

Hi @Danielle, you could try to load the .csv on this way:

# Read CSV 
df_1 <- read.csv("your_file.csv", stringsAsFactors = FALSE, check.names = FALSE) # you can paste the path into " ".

library(readr)
df_2 <- read_csv("your_file.csv", col_types = cols(.default = col_character()))

Thank you. I’ll try this out.