Page 1 of 1

Problem: read txt file with no headers

Posted: Thu Jan 24, 2019 6:12 pm
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.

Re: Problem: read txt file with no headers

Posted: Fri Jan 25, 2019 3:30 am
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

Re: Problem: read txt file with no headers

Posted: Fri Jan 25, 2019 3:15 pm
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.

Re: Problem: read txt file with no headers

Posted: Fri Jan 25, 2019 9:57 pm
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

Re: Problem: read txt file with no headers

Posted: Mon Jan 28, 2019 6:23 pm
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.

Re: Problem: read txt file with no headers

Posted: Mon Jan 28, 2019 10:14 pm
by jonathon
great to hear bob :)

jonathon