similar to: read.table issue with "#"

Displaying 20 results from an estimated 10000 matches similar to: "read.table issue with "#""

2012 Jul 09
4
Skipping lines and incomplete rows
I have a text file that has semi-colon separated values. The table is nearly 10,000 by 585. The files looks as follows: ******************************************* First line: Skip this line Second line: skip this line Third line: skip this line variable1 Variable2 Variable3 Variable4 Unit1 Unit2 Unit3 10 0.1 0.01 0.001 20
2012 Feb 12
3
Writing output into a file
Hi everyone, I'm an R newbie working with the poLCA module. I achieved my target without having to bother anyone, but It seems that I've got stuck at the last minute. My problem is simple. I need to write my results into a file. My results are in the shape of a list (unbalanced columns) I've considered several methods (sink(), write.file) etc. etc. Unfortunately, I'm not the best
2012 Oct 31
5
extracting information from txt file
Hello, Here is a link to some data: http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/wchem/chmval.txt I am trying to read this in, and want to use: chmval <- read.table("http://www.epa.gov/emap/html/data/surfwatr/data/mastreams/9396/wchem/chmval.txt", sep=",", skip= 84, header=T) the # 84, for 84 lines skipped needs to be derived from the 5th line of the
2004 May 01
5
skip lines on a connection
Hi, I am looking for an efficient way of skipping big chunks of lines on a connection (not necessarily at the beginning of the file). One way is to use read lines, e.g. readLines(1e6), but a) this incurs the overhead of construction of the return char vector and b) has a (fairly remote) potential to blow up the memory. Another way would be to use scan(), e.g. scan(con, skip=1e6, nmax=0)
2003 Apr 30
5
Scanning data files line-by-line
Hi all, is there a way to read a data file into R line-by-line, akin to what fscanf does in C, say? It seems that "scan" and "read.table" both read the entire data file in at once, whereas "readLines" allows one to read a file partially, but doesn't quite read line-by-line either. I guess what I was hoping to do is something like this: while( linebyline(
2011 Jul 12
1
suggestions regarding reading in a messy file
I have a file in stata format, which I have read in, and I am trying to create a text file. I have exported the data using various delimiters, but I'm unable to read it back in. I originally read in the file with: library(foreign) myData <- read.dta("mydata.dta") I then exported it with write.table using comma, tab, and exclamation marks as a delimiter. When I was unable to
2014 Mar 12
3
Lectura de texto
Hola a todos, Me gustaria leer el texto que se encuentra en http://dl.dropboxusercontent.com/u/9601860/txt.txt He intentado txt <- 'http://dl.dropboxusercontent.com/u/9601860/txt.txt' r <- scan(txt) #Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : # invalid multibyte string at '<ff><fe>M' r <- read.table(txt, header = FALSE)
2007 Sep 06
2
problems in read.table
Dear R-users, I have encountered the following problem every now and then. But I was dealing with a very small dataset before, so it wasn't a problem (I just edited the dataset in Openoffice speadsheet). This time I have to deal with many large datasets containing commuting flow data. I appreciate if anyone could give me a hint or clue to get out of this problem. I have a .dat file
2012 Jan 24
2
read.table: how to ignore errors?
I get this error from read.table(): Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 234 did not have 8 elements The error is genuine (an extra field separator between 1st and 2nd element). 1. is there a way to see this bad line 234 from R without diving into the file? 2. is there a way to ignore the bad lines and get the data from the good lines only (I do
2014 Mar 12
2
Lectura de texto
Hola. Con r <- scan(txt, character(0)) creo que debiera montarse el texto carácter a carácter. He comprobado que funciona pero no he validado la importación del texto. Igual es un camino que lleva a alguna parte.... Un Saludo, Miguel. -----Mensaje original----- De: r-help-es-bounces en r-project.org [mailto:r-help-es-bounces en r-project.org] En nombre de Carlos Ortega Enviado el:
2014 Mar 12
2
Lectura de texto
Hola Jorge, Algo pasa con el fichero... He abierto el link de Dropbox, y he salvado el texto como "txt.txt" en local. Pruebo a abrirlo en R y...: > scan(file="txt.txt")Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : scan() expected 'a real', got 'ÿþM'> getwd()[1] "C:/Users/xIs12136/Downloads" Pruebo a abrirlo
2012 Dec 02
6
Warning message: In scan(file, what, nmax...)
Dear R-users, When i try - Data1<-read.table("/Users/kama/Analysis/GDP10.csv",header=TRUE,sep=";") i am getting this error: Warning message: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : number of items read is not a multiple of the number of columns I wonder what Iam doing wrong. i guess it is something simple, however, i do not understand
2012 May 04
2
Can't import this 4GB DATASET
Dear Experienced R Practitioners, I have 4GB .txt data called "dataset.txt" and have attempted to use *ff, bigmemory, filehash and sqldf *packages to import it, but have had no success. The readLines output of this data is: readLines("dataset.txt",n=20) [1] " "
2013 Oct 04
2
Tab Separated File Reading Error
Hello, I have a seemingly simple problem that a tab-delimited file can't be read in. > annoTranscripts <- read.table("matched.txt", sep = '\t', stringsAsFactors = FALSE) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 5933 did not have 12 elements However, all lines do have 12 columns. > lines <-
2009 Sep 22
1
Weird read.table error? (line `n' did not have `m' elements)
Hi, I have the following commands. It says line 5205 does not have 22 elements. But I use my 'vim' checked that line in the file. It has 22 fields. Can somebody let me know how to further debug this case? Regards, Peng > annotation = read.table("../EC_results/Juan_15wks_gene_core.xls", header=T, sep='\t',quote='') Error in scan(file, what, nmax, sep, dec,
2013 Sep 30
4
read.table() with quoted integers
Hi! It seems that read.table() in R 3.0.1 (Linux 64-bit) does not consider quoted integers as an acceptable value for columns for which colClasses="integer". But when colClasses is omitted, these columns are read as integer anyway. For example, let's consider a file named file.dat, containing: "1" "2" > read.table("file.dat",
2009 Nov 10
3
Error: cannot allocate vector of size...
I'm trying to import a table into R the file is about 700MB. Here's my first try: > DD<-read.table("01uklicsam-20070301.dat",header=TRUE) Error: cannot allocate vector of size 15.6 Mb In addition: Warning messages: 1: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : Reached total allocation of 1535Mb: see help(memory.size) 2: In scan(file, what,
2008 Sep 19
4
Novice question about getting data into R
I found it easy to use R when typing data manually into it. Now I need to read data from a file, and I get the following errors: > refdata = > read.table("K:\\MerchantData\\RiskModel\\refund_distribution.csv", header > = TRUE) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1 did not have 42 elements > refdata = >
2012 Oct 18
4
speeding read.table
R 2.15.1 OS X Colleagues, I am reading a 1 GB file into R using read.table. The file consists of 100 tables, each of which is headed by two lines of characters. The first of these lines is: TABLE NO. 1 The second is a list of column headers. For example: TABLE NO. 1 COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10
2008 Jul 30
2
problem with read.table()
Hello R-User I have a table as tab-delimited textfile (291 rows, 83 columns). The first row are labels and the first line the variable names. I used the following code several times with different similar tables and it always worked. But now: setClass("of") setAs("character", "of", function(from) as.ordered(from)) Classe82<-cclasses <-