similar to: importing date vector with read.table

Displaying 20 results from an estimated 20000 matches similar to: "importing date vector with read.table"

2009 Nov 25
3
Feature request for as.Date() function
Hello - I have a csv file with a few date columns. Some of the records have an "NA" character string instead of the date. When I attempt to use read.csv() and typecast the columns using colClasses, I receive the following error: Error in charToDate(x) : character string is not in a standard unambiguous format Similarly, the following command produces the same error:
2012 Jun 07
1
factor coercion with read.csv or read.table
How do I fix this error ? I tried coercion to a vector but that didn't work. msci <-read.csv("..MSCIexUS.csv", header=TRUE) head(msci) Date index 1 Dec 31, 1969 100 2 Jan 30, 1970 97.655 3 Feb 27, 1970 96.154 4 Mar 31, 1970 95.857 5 Apr 30, 1970 85.564 6 May 29, 1970 79.005 > str(msci) 'data.frame': 510 obs. of 2 variables: $ Date : Factor w/ 510
2011 Jul 26
2
How to use as.Date (or something else) with "31-Jul-2010 23:59:00"
Hello I have a huge file (not an R-file) in which the first column is a string with date, hour, minutes and seconds (For instance, "31-Jul-2010 23:59:00"). I tried as.Date but the error msg was "Error in charToDate(x) : character string is not in a standard unambiguous format". I have checked the help for the function as well as date but to no avail. How can that sort
2011 Jun 01
2
Problems Dating....
I'm trying to convert a column in a data frame with dates from a "Factor" type to a "Date Object" but I am encountering and error. (I am having trouble plotting an x,y scatter and I suspect it's something with my data format). I have a table with two columns and 8,000 rows. > dsort=read.delim("C:\\Documents and Settings\\E066582\\My
2011 Jun 24
2
SQL Changing Data Type
Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried setting back to a Date via as.Date, but get an error the error: character string is not in a standard unambiguous format. Any thoughts appreciated. Code/Results listed below: > summary(df.possible.combos) Date Hour Min. :2011-03-01 Min. : 0.00 1st Qu.:2011-03-23 1st Qu.: 5.75
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 >
2008 Dec 10
2
read.table with different row lengths
Hi, I need to read in a series of text files with a time series on each row. The series are of different lengths and I'd like to just use the first row as the length and have R ignore extra values in rows that go over this length. For example: 1 0 3 4 5 1 3 5 6 8 7 7 2 1 1 1 4 7 7 7 So the 7s would be ignored and I would have a 5x3 matrix. I tried creating a series of colClasses
2017 Oct 24
2
read.table(..., header == FALSE, colClasses = <vector with names attribute>)
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 example was slightly malformed and in fact gives an error under R version 3.2.2. Please allow me to try again; in older versions of R, ?? > read.table(file =
2017 Oct 23
2
read.table(..., header == FALSE, colClasses = <vector with names attribute>)
Hello I noticed that starting with R version 3.3.0 onward, this generates a warning: ?? > txt <- c("a", "3.14") ?? > read.table(file = textConnection(txt), header = FALSE, colClasses = c(x = "character", y = "numeric")) the warning is "not all columns named in 'colClasses' exist" and I guess the change was made in response
2017 Oct 24
0
read.table(..., header == FALSE, colClasses = <vector with names attribute>)
You are constructing the equivalent of a two-line data file, and complaining that it is not treating it like it was one line. If it did used to accept this silently [skeptical] then I for one am glad it produces a warning now. -- Sent from my phone. Please excuse my brevity. On October 23, 2017 2:53:21 PM PDT, Benjamin Tyner <btyner at gmail.com> wrote: >Hello > >I noticed that
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
2013 Apr 30
0
performance issue with as.Date
We encounted a performance problem when a large number of R scripts are run simulatanously. A large number of stat() system calls to /etc/timezone was limiting how many scripts could be run effectively. I traced the problem to as.Date.character where strptime() is called without a timezone argument when there is no format argument. as.Date.character <- function(x, format="", ...) {
2012 Jan 11
2
Checking dates for entry errors
Hello Everyone, ? I have a question about how best to check dates for?entry errors. I recently discovered that R will read?the incorrectly entered date "11/23/21931" without producing a warning or an?error message at least under some circumstances. ? > as.Date("11/23/21931", format = "%m/%d/%Y") [1] "2193-11-23" > as.Date("21931-11-23")
2005 Apr 18
2
colClasses = "Date" in read.delim, how to pass date-format?
Hi I have a huge data-set with one column being of type date. Of course I can import the data using this column as "factor" and then convert it later to dates, using: sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat), format = c(dates = "d.m.y")) But the conversion requires a huge amount of memory (and time), therefore I would
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"
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",
2004 Jul 28
1
read.table() and NULL for colClasses
Hi, is there are reason for not supporting NULL or "NULL" values for argument colClasses in read.table(), much like you can use NULL values for argument 'what' in scan()? This would help quite a bit when reading large data files where only a few columns are of interest. I've modfied read.table() to so it calls scan(what=...) also with NULLs for the fields to be skipped.
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 <-
2007 Oct 09
1
Read in date fomat while colClasses="character"
Hi R users, I am using xlsReadWrite to read a particular excel file. In one of the columns I have dates ( say col=5). Now date column is read by default as numeric. So I used dateTimeAs= "isodatetime". This enables reading in the date format. However in the earlier column (say col=1) I have data which however starts from row 10. So to read data from column one I use
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