Displaying 20 results from an estimated 8000 matches similar to: "questions on csv reading"
2009 Oct 01
2
(no subject)
Hi,
Does anyone know where the following package is available:
Holleczek B, Gondos A, Brenner H.
PeriodR - an R package to calculate long term survival estimates using period analysis.
Methods of Information in Medicine 2009; 48: 123-128.
Thanks
Jens Oehlschl?gel
--
GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT!
2005 Feb 03
3
Reading Dates in a csv File
Hi all. I'm reading in a flat, comma-delimited flat file using read.csv.
It works marvelously for the most part. I am using the colClasses argument
to, basically, create numeric, factor and character classes for the columns
I'm reading in. However, a couple of the fields in the file are date
fields. I'm fully aware that POSIXct can be used as a class, however the
field must obey,
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)
>
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.
2011 Nov 21
1
extending the colClasses argument in read.table
Hello,
We've released the int64 package to CRAN a few days ago. The package
provides S4 classes "int64" and "uint64" that represent signed and
unsigned 64 bit integer vectors.
One further development of the package is to facilitate reading 64 bit
integer data from csv, etc ... files.
I have this function that wraps a call to read.csv to:
- read the "int64"
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
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",
2012 Apr 23
1
Can I specify POSIX[cl]t column classes inside read.csv?
I'm loading a nicely formatted csv file.
? ? #!/usr/bin/env Rscript
? ? kpi <- read.csv(
? ? ? # This is a dump of the username, date_joined and last_login columns
? ? ? # from the auth_user Django table.
? ? ? 'data/2012-04-23.csv',
? ? ? colClasses = c('character')
? ? )
? ? print(kpi[sample(nrow(kpi), 3),2:3])
Here's what the three rows I printed look like.
? ? ? ?
2009 Jun 14
2
read.csv
If read.csv's colClasses= argument is NOT used then read.csv accepts
double quoted numerics:
1: > read.csv(stdin())
0: A,B
1: "1",1
2: "2",2
3:
A B
1 1 1
2 2 2
However, if colClasses is used then it seems that it does not:
> read.csv(stdin(), colClasses = "numeric")
0: A,B
1: "1",1
2: "2",2
3:
Error in scan(file, what, nmax, sep,
2008 Aug 20
1
read.csv : double quoted numbers
Hello;
I am new user of R; so pardon me.
I am reading a .txt file that has around 50+ numeric columns with '\t'
as separator. I am using read.csv function along with colClasses but
that fails to recognize double quoted numeric values. (My numeric
values are something like "1,001.23"; "1,008,000.456".) Basically
read.csv fails with - "scan() expected 'a
2012 Jan 19
1
Help with .csv file reading !
Hello,
Here's my problem :
I have a csv file which I have to read with read.table() function (or
read.csv). The file has about 60000 lines whose data are written this way:
character;character;character;character
14/10/2010 13:10;0;49;0;49;
14/10/2010 13:20;0;49;0;49;
14/10/2010 13:30;0;49;0;49;
I tried to use the function this way: read.csv("file.csv",sep =
2011 Mar 09
4
Help with read.csv
Hello,
I have a file that looks like this:
Date,Hour,DA_DMD,DMD,DA_RTP,RTP,,
1/1/2006,1,3393.9,3412,76.65,105.04,,
1/1/2006,2,3173.3,3202,69.20,67.67,,
1/1/2006,3,3040.0,3051,69.20,77.67,,
1/1/2006,4,2998.2,2979,67.32,69.10,,
1/1/2006,5,3005.8,2958,65.20,68.34,,
where the ',' is the separator and I tried to read it into R, but...
> y <- read.csv("Data/Data_tmp.csv",
2001 Aug 24
1
RFC: type conversion in read.table
Currently read.table is rather limited in its type conversion.
The algorithm is
0) Read as character
1) Try to convert to numeric. If that works, quit
2) Convert to factor unless !as.is.
I am thinking about adding more flexibility and more classes by the
following two changes.
A) Anticipating the arrival of classes for all R objects, add an
argument say `colClasses' that allows the user to
2010 Jan 19
2
Memory usage in read.csv()
I'm sure this has gotten some attention before, but I have two CSV
files generated from vmstat and free that are roughly 6-8 Mb (about
80,000 lines) each. When I try to use read.csv(), R allocates all
available memory (about 4.9 Gb) when loading the files, which is over
300 times the size of the raw data. Here are the scripts used to
generate the CSV files as well as the R code:
Scripts (run
2011 Nov 08
3
Reading a specific column of a csv file in a loop
Dear all:
I have two larges files with 2000 columns. For each file I am
performing a loop to extract the "i"th element of each file and create
a data frame with both "i"th elements in order to perform further
analysis. I am not extracting all the "i"th elements but only certain
which I am indicating on a vector called "d".
See an example of my code below
2005 Apr 23
2
How to override coerion error in 'scan'
I am using 'read.csv' in V2.0.1 to read in a CSV file with the
colClasses option and am getting an error from 'scan' when it encounters
a non-numeric value for a 'numeric' column, i.e.
> ds <- read.csv(in_file, nrows=irow, row.names=NULL,
colClasses=zclass,
comment.char="")
Error in scan(file = file, what = what, sep = sep, quote =
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 <-
2002 May 29
1
warning message for setAs when using class AsIs
This seemed too advanced for r-help and is related to the recent discussion of
character vectors in dataframes.
Following Brian Ripley's most excellent advice, we are moving to a world in
which character vectors in dataframes are always of class AsIs. The cool way of
doing this seemed to be the following:
> cat(c("x", "y", "z"), file = "test.txt",
2002 Jul 02
1
POSIX formats have problems with NA (PR#1732)
# pure replication code at end
> # These work
>
> Sys.time() + NA
[1] NA
> as.POSIXlt(Sys.time(), "GMT") + NA
[1] NA
>
> class(Sys.time() + NA)
[1] "POSIXt" "POSIXct"
> class(as.POSIXlt(Sys.time(), "GMT") + NA)
[1] "POSIXt" "POSIXct"
>
> x <- Sys.time() + NA
> y <- as.POSIXlt(Sys.time(),
2010 Feb 11
3
read numeric values with thousands seperator from csv file
Hello,
Is there an easy way to read a csv file with numeric values that contain
thousands seperators. The file looks like this:
Date;opening;High;Low;closing;Volume
12/02/08;4,764.95;4,897.62;4,729.13;4,895.31;-
13/02/08;4,868.02;4,927.81;4,833.85;4,898.60;-
14/02/08;4,942.18;4,962.43;4,877.88;4,895.99;-
I want to get the numeric values as..., well, numeric values, and not as
character strings.