similar to: Reading multiple text files where some files are empty

Displaying 20 results from an estimated 10000 matches similar to: "Reading multiple text files where some files are empty"

2010 Dec 21
4
Keeping Leading Zeros, Treating numbers as text
Hello, I have a data set, with some numerical values, some non-numerical data, my issue is that I need to preserve my ID numbers (numerics) with the leading zeros, but when I import the data into R (it's in .csv format) using the read.csv(" ") command, it turns all the ID numbers (Example: 00210) into numbers, removing the leading zeros, so I end up with 210. I tried using the
2003 Jan 29
2
calling sweave function from latex
System info: Mandrake 9.0 R Version 1.6.1 ESS 5.1.21 Emacs 21.2.1 ------------------- Colleagues I've been calling R-code embedded in my LaTex document using Sweave, but would like to make things more convenient. At present as I understand it you first process the R chunks of code using the Sweave function called from within R to process a "precursor file" e.g. foo.sw to get a
2003 Jan 29
2
calling sweave function from latex
System info: Mandrake 9.0 R Version 1.6.1 ESS 5.1.21 Emacs 21.2.1 ------------------- Colleagues I've been calling R-code embedded in my LaTex document using Sweave, but would like to make things more convenient. At present as I understand it you first process the R chunks of code using the Sweave function called from within R to process a "precursor file" e.g. foo.sw to get a
2011 Feb 11
2
tzone and DST
I'm reading in ~3 years worth of data that includes hourly timestamps. Presumably to avoid DST confusion, all the data is in PST time zone -- no discontinuities in the spring or fall. The data comes in a csv file, which I'm reading with myvariable <- read.csv("my_data_file.csv",header=FALSE,
2011 Nov 21
5
R ignores number only with a nine under 10000
Hello R users, I'm trying to replace numerical values in a datamatrix with strings. R does this except for numbers under 10000 starting with a 9 (eg 98, 970, 9504 etc). This is really weird and I wondered whether someone had encountered such a problem or knows the solution. I'm using the next script: test_1 <- read.table("5+ref_151111clusters3.csv", header = TRUE, sep =
2009 Sep 26
1
questions on csv reading
Hi, Is there any official way to determine the colClasses of a data.frame? Why has POSIXct such a strange class structure? Why is colClasses "ordered" not allowed (and doesn't work)? Background ========== I am writing a chunked csv reader that provides the functionality of read.table for large files (in the next version of package ff). In chunked reading, one wants to learn the
2013 Nov 18
1
Reading in csv data with ff package
I've spent some time trying to wrap my head around reading in large csv files with the ff-package. I think I know how to do it, but am bumping into some problems. I've tried to recreate the issues as best as I can with a smaller example and maybe someone can help explain the problems. The following code just creates a csv file with an integer column, character column and logical column.
2006 Mar 07
7
reading in only one column from text file
How do I manipulate the read.table function to read in only the 2nd column??? [[alternative HTML version deleted]]
2017 Oct 24
0
read.table(..., header == FALSE, colClasses = <vector with names attribute>)
>>>>> Benjamin Tyner <btyner at gmail.com> >>>>> on Tue, 24 Oct 2017 07:21:33 -0400 writes: > Jeff, > Thank you for your reply. The intent was to construct a minimum > reproducible example. The same warning occurs when the 'file' argument > points to a file on disk with a million lines. But you are correct, my >
2012 Sep 14
1
Any way to get read.table.ffdf() (in the ff package) to pass colClasses or comment.char parameters through to read.fwf() ?
Hi everyone, my apologies if I'm overlooking something obvious in the documentation. I'm relatively inexperienced with the (awesome) ff package. My goal is to use the read.table.ffdf() function to call the read.fwf() function and pass through the colClasses and comment.char arguments. The code below shows exactly what doesn't work for me. If the colClasses and comment.char
2004 Sep 08
1
A couple of issues with colClasses/setAs
Consider this: $ cat test.dat 1 a 2 b Now, we want to read the 2nd column as a factor and ignore the first (since it's just a sequential ID). We can't just put "factor" among the colClasses (would have been nice), so let's try this instead > setAs("character","factor",as.factor) Arguments in definition changed from (x) to (from) >
2006 Sep 26
2
colClasses: supressed 'NA'
Hi, The colClasses seem to be supressing 'NA' vlaues. How do I fix this? R script and first 5 lines of output is below. File "test2.dat" has blanks that are read as "NA" when I do not use 'colClasses', but as blanks when I use 'colClasses'. temp.df <- read.fwf("test2.dat", width=c(10,1,1,1,1,2,2,3,3,1),
2011 Dec 07
2
reading partial data set
Hi all, I'm trying to read a data set into R, but the file is messy, so I have to do it partially. The whole data is in a .txt file, and the values are separated by a space. So far ok. The problem is that in this file, not all the lines have the same number of elements, and the reading stops. And I loose the reading of the previous lines. ex. of data set: 11 12 13 21 22 23 31 32
2010 Mar 19
1
how to drop fields by name when reading in data?
I have a number of space separated files of weather data, with some equivalent column names, and differing number of fields in each file. Some of the files have 40 or more vars, but I only want a subset of the fields. I can use colClasses with read.table to drop some of the fields, but only if I know where those columns are in the first place, and they're not always in the same place. So I
2011 Jul 12
1
Connecting to Empress DB using RODBC
Hi there, I am using the RODBC library to connect to an Empress database. I have installed the ODBC data source with the server DNs number and port, and named the source "Trawl". It is the odbcDriverConnect that seems to have the problem, and I suspect one of the settings in my Data Source is wrong, or that my syntax to identify the database is wrong. I have not set CodeSet or ODBC
2012 Nov 17
1
Strange problem with reading a pipe delimited file
I am trying to read in a pipe delimited file that has rows with varying number of columns, here is my sample data: A|B|C|D A|B|C|D|E|F A|B|C|D|E A|B|C|D|E|F|G|H|I A|B|C|D A|B|C|D|E|F|G|H|I|J You can see line 6 has 10 columns. Yet, I can't explain why R does like so: > test <- read.delim("mypaths4.txt", sep="|", quote=NULL, header=F,
2012 Jul 25
3
ff package: reading selected columns from csv
*Dear R users, Ive just started using the ff package. There is a csv file (~4Gb) with 7 columns and 6e+7 rows. I want to read only column from the file, skipping the first 100 rows. Below Ive provided different outcomes, which will clarify my problem * > sessionInfo() R version 2.14.2 (2012-02-29) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: ... attached base packages: [1] tools
2008 Feb 26
3
using eval-parse-paste in a loop
R-helpers I have 120 small Excel sheets to read and I am using library(xlsReadWrite): one example below. I had hoped to read sheets by looping over a list of numbers in their name (eg Book1.xls, Book2.xls, etc). I thought I had seen examples which used eval-parse-paste in this way. However, I have not been able to get it to work.. 1. is this a feasible approach? 2. if not
2004 Oct 11
4
colClasses
Hi I am trying to read a data frame from a text editor in to R. I want some of the columns to be read in as "character" not numeric. I figured that I can do that by using "colClasses" in "read.table" command. However, I couldn't find out how to use "colClasses". e.g. say I have 5 column in the data file. I want 1st and 3rd column to be read in as
2010 Feb 11
2
trouble with read.table and colClasses='raw'
Hi all, First off, it is surprising that there are no examples of how to use read.table() under ?read.table ! I am trying to read in a flat file of type 'raw'. It has 1000 rows and 600K columns. I have the RAM to accomplish this, but can't get the data into R using read.table: x <- read.table("data",header=TRUE,colClasses=rep(,600000)) #returns error: no method or