In my RStudio and data that came in a.CSV file. There is variable information including data element label, type, number of digits, etc. that have been provided in a.SAS as well as a .do file. I understand these correspond to either SAS or STATA. These are all (.csv, .sas, .do) in a single folder on my desktop.
The below code of for importing the dataset:
library(readr)
NRD_2017_Hospital <- read_csv("My Documents/Data/2017/2017_School.CSV")
View(2017_School)
SASIN <- "C:/Users/Quix/Documents/My Documents/Data/2017/2017_School.SAS"
Getting the headers and other variable information isn't working. I've tried the library(SAScii) and it comes up with errors:
data1<- read.SAScii(2017_School, SASIN)
The error:
Error in if (as.numeric(x[j, "start"]) > as.numeric(x[j - 1, "end"]) + :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In parse.SAScii(sas_ri, beginline, lrecl) : NAs introduced by coercion
2: In parse.SAScii(sas_ri, beginline, lrecl) : NAs introduced by coercion
3: In parse.SAScii(sas_ri, beginline, lrecl) : NAs introduced by coercion
4: In parse.SAScii(sas_ri, beginline, lrecl) : NAs introduced by coercion
5: In parse.SAScii(sas_ri, beginline, lrecl) : NAs introduced by coercion
How to get the data and headers to load together in R?