I'm trying to read a SAV file into SAS then write it as CSV. Below is an example of what someone gave me to do. What they gave me is in bold. I only changed the file path names.
library(haven)
library(readr)
HNIR62FL_data_2 <-
read_sav("C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Original Data Set")
write_csv(x=HNIR62FL_data_2, path="C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\CSV.csv")
I received an error message when I ran the above. The error message is:
16 library(haven)
-------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
17 library(readr)
18 HNIR62FL_data_2 <-
19 read_sav("C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Original Data Set")
20 write_csv(x=HNIR62FL_data_2, path="C:\Users\gtuck\OneDrive\Documents\Gretchen
20 ! Dissertation\SAS\CSV.csv")
I don't know what I need to do. What does the two library names mean? Can they be called anything? What is the HNIR62FL_data_2<- for?