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)
Post Reply
bobk
Posts: 7
Joined: Thu Nov 29, 2018 3:42 pm

Problem: read txt file with no headers

Post by bobk »

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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Problem: read txt file with no headers

Post by jonathon »

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
bobk
Posts: 7
Joined: Thu Nov 29, 2018 3:42 pm

Re: Problem: read txt file with no headers

Post by bobk »

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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Problem: read txt file with no headers

Post by jonathon »

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
bobk
Posts: 7
Joined: Thu Nov 29, 2018 3:42 pm

Re: Problem: read txt file with no headers

Post by bobk »

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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Problem: read txt file with no headers

Post by jonathon »

great to hear bob :)

jonathon
Post Reply