[R] duplicate row importing issue
Adaikalavan Ramasamy
ramasamy at cancer.org.uk
Wed Jul 14 17:35:26 CEST 2004
Try read.table(choose.files(), row.names=NULL).
BTW, I think you might be using an older R version because in R-1.9.1,
the value for row.names is missing by default in read.table().
> args(read.table)
function (file, header = FALSE, sep = "", quote = "\"'", dec = ".",
row.names, col.names, as.is = FALSE, na.strings = "NA",
colClasses = NA, nrows = -1, skip = 0, check.names = TRUE,
fill = !blank.lines.skip, strip.white = FALSE,
blank.lines.skip = TRUE, comment.char = "#")
Try read.delim() or read.csv() if the data is tab-delimited or comma
separated. Also check to see if you have a header, in which case you
would set the option header=TRUE. For more info, help("read.table").
Do dim(m), head(m) to see if the data has been read correctly.
On Wed, 2004-07-14 at 16:12, Herman, David (NIH/NIMH) wrote:
> Hello,
> I'm simply trying to import a .txt file that has a column of
> about 30,000 pts. I found the file, but I'm getting an error:
> > m <- read.table(choose.files())
> Error in "row.names<-.data.frame"(`*tmp*`, value = row.names) :
> duplicate row.names are not allowed
>
> Any help with getting around this?
>
> I really appreciate all the help.
> Thanks
> dave
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list