course-starter-r
course-starter-r copied to clipboard
/data folder doesn't seem to work
When I add a data folder as I've done here -> https://github.com/UKDataServiceOpen/r-course-starter/tree/master/data
running
# test read in the dataset from /data/test.txt
df <- read.table('data/test.txt', header = FALSE)
causes
Warning message in file(file, "rt"):
“cannot open file 'data/test.txt': No such file or directory”
Error in file(file, "rt"): cannot open the connection
Traceback:
1. read.table("data/test.txt", header = FALSE)
2. file(file, "rt")
meanwhile
# read from web hosted files
df <- read.table("https://s3.amazonaws.com/assets.datacamp.com/blog_assets/test.txt",
header = FALSE)
works
I've tried it with a .csv and it does work, I am guessing somewhere only .csvs are allowed through as datasets but this wasn't clear in the docs.
Thanks anyway Ines!
looking at this again I need to load in SPSS .sav files too, so I might have to convert it to .CSV and lose some benefit in this process.