Problem: read txt file with no headers

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)

by bobk » Thu Jan 24, 2019 6:12 pm

HI, when I try to read in a comma delimited txt file, with no headers, the first line of data becomes the variable names. I can't figure out how to avoid this.

I tried reading in the file via the Rj editor, with this syntax:

tf <- c("C:/R/grades.txt")
read.csv(tf, header = FALSE)

and that read the data in... to the syntax window, not into jamovi (where I'd like to do some analysis)! The first column of the jamovi, 'spreadsheet', first cell, now contains the last syntax command!

Any help appreciated.
bobk
 
Posts: 5
Joined: Thu Nov 29, 2018 3:42 pm

by jonathon » Fri Jan 25, 2019 3:30 am

hi,

probably the easiest way would be top open the data set in a spreadsheet, and copy/paste the data into jamovi.

we will add an option to exclude the reader in the future.

cheers

jonathon
User avatar
jonathon
 
Posts: 994
Joined: Fri Jan 27, 2017 10:04 am

by bobk » Fri Jan 25, 2019 3:15 pm

Thank you; I did know that editing the file was a solution, but was hoping for a "header = FALSE" way around it.

Anything about why my read.cvs command didn't populate jamovi with the data, just showed it in the syntax window? Is that not implemented either? I tried putting it in 'data' which seems to be the default name of the dataframe (data <- read.csv etc.), but that didn't work either.

Thanks again!

bob k.
bobk
 
Posts: 5
Joined: Thu Nov 29, 2018 3:42 pm

by jonathon » Fri Jan 25, 2019 9:57 pm

hey,

well, copy/pasting all the cells from a spreadsheet into jamovi isn't quite editing, but sure.

> was hoping for a "header = FALSE" way around it.

yup, we'll add that in the future.

read.csv() is an R function which reads the data set into R, which makes it available inside your R script, but it doesn't load it into jamovi. so it's working as expected in this situation.

(one could imagine a situation where someone is reading data files in a loop, and they wouldn't want the data set updating over and over.)

cheers

jonathon
User avatar
jonathon
 
Posts: 994
Joined: Fri Jan 27, 2017 10:04 am

by bobk » Mon Jan 28, 2019 6:23 pm

Thanks! I love what you're doing, and my Department here is going to teach our stat classes using jamovi instead of SPSS starting this semester; FYI!

bob k.
bobk
 
Posts: 5
Joined: Thu Nov 29, 2018 3:42 pm

by jonathon » Mon Jan 28, 2019 10:14 pm

great to hear bob :)

jonathon
User avatar
jonathon
 
Posts: 994
Joined: Fri Jan 27, 2017 10:04 am


Return to Help

cron