can't read in files

270 views
Skip to first unread message

Christoph Ruehlemann

unread,
Jan 22, 2018, 7:46:20 AM1/22/18
to corplin...@googlegroups.com
Hey all,

Something's gone wrong all of a sudden: I can't read in files into RStudio anymore. Here's the error message:

> top<-read.table("/Users/chris/Documents/R/Txt/Turn-openers.txt", header=T, quote="", sep="\t", fill=F)
Error in if (!header) rlabp <- FALSE :
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In Ops.factor(left) : ‘!’ not meaningful for factors
2: In Ops.factor(left) : ‘!’ not meaningful for factors
3: In Ops.factor(left) : ‘!’ not meaningful for factors
4: In Ops.factor(left) : ‘!’ not meaningful for factors
5: In if (!header) rlabp <- FALSE :
  the condition has length > 1 and only the first element will be used

Stefan Th. Gries

unread,
Jan 22, 2018, 9:28:58 AM1/22/18
to corplin...@googlegroups.com
Hard to say without seeing the input file and when you say "can't read in files _into RStudio_ anymore", does that mean you CAN read that file _into R_ (R GUI)?

Best,
STG
--
Stefan Th. Gries
----------------------------------
Univ. of California, Santa Barbara
http://tinyurl.com/stgries
----------------------------------

Susie Kim

unread,
Jan 22, 2018, 10:59:37 AM1/22/18
to CorpLing with R
Perhaps you have a vector or any type of data previously set as "T" and therefore inducing the error with the header (i.e., "header = T")?

Alex Perrone

unread,
Jan 22, 2018, 12:46:39 PM1/22/18
to corplin...@googlegroups.com
Yeah, it looks like it can't parse "header=T", and may be thinking that T is a factor ("! not meaningful for factors), or possibly also as Susie said, a vector (condition has length > 1 and only the first element will be used). No clue why. Try:

top<-read.table("/Users/chris/Documents/R/Txt/Turn-openers.txt", header=TRUE, quote="", sep="\t", fill=F)

Also, double-check that you actually have a header -- a row of column names -- in that file. If you don't, or if the column names are screwy but the data looks ok and you delete the first line of the text file, take out the header just to see if that works:

top<-read.table("/Users/chris/Documents/R/Txt/Turn-openers.txt", header=FALSE, quote="", sep="\t", fill=F)

--
You received this message because you are subscribed to the Google Groups "CorpLing with R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to corpling-with-r+unsubscribe@googlegroups.com.
To post to this group, send email to corpling-with-r@googlegroups.com.
Visit this group at https://groups.google.com/group/corpling-with-r.
For more options, visit https://groups.google.com/d/optout.

Earl Brown

unread,
Jan 23, 2018, 1:25:35 AM1/23/18
to CorpLing with R
Perhaps try a function from the readr package:
http://readr.tidyverse.org/reference/read_delim.html

Christoph Ruehlemann

unread,
Jan 23, 2018, 2:27:26 AM1/23/18
to corplin...@googlegroups.com
Thanks a lot to everybody who got on in on this with good advice.
I've resolved the issue by now (guess how: by quitting R studio and signing on again!)

I guess the error was caused by me uninstalling some java (on which, perhaps, R studio is running) and replacing it with another java without having closed R Studio.

Many thanks again
Chris

--
You received this message because you are subscribed to the Google Groups "CorpLing with R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to corpling-with-r+unsubscribe@googlegroups.com.
To post to this group, send email to corpling-with-r@googlegroups.com.
Visit this group at https://groups.google.com/group/corpling-with-r.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages