Displaying 20 results from an estimated 4000 matches similar to: "Feature request for as.Date() function"
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
2010 Nov 12
3
Replicate Excel's LOGEST worksheet function in R
Hi -
I have a dataframe of (x,y) values. I'd like to fit an exponential
curve to the data for further statistical analysis (pretty much the same
functionality provided by Excel's LOGEST worksheet array function). Can
someone point me to the (set of) functions/ package that is best suited to
provide this functionality? Admittedly, I am a novice in the use of R
statistical functions,
2009 Nov 15
2
Segmentation faults on SEXP conversion
Hello -
I am making a first attempt at writing a simple C++ routine to print
out R objects (this is a simple proof-of-concept as part of a larger
package development). The relevant C++ routine is as follows:
void Rwrite(SEXP fd, SEXP msg) {
int *ofd = INTEGER(fd);
const char * omsg = CHAR(asChar(msg));
printf("[%i] %s",*ofd,omsg);
}
And the corresponding interface in R is as
2010 Dec 10
1
importing date vector with read.table
Hi,
I understand this should be an easy task but I am still struggling a bit to
read a .txt file with a date vector. My code is as below:
data<-read.table(file.choose(),header=TRUE,sep="\t",dec=",",colClasses=c("Date","numeric","numeric","numeric"))
But I am getting an error:
Error in charToDate(x) :
character string is not in a
2011 Mar 23
4
Modifying a particular column in a tab-delimited file
Hello R users,
Good day!!
I was wondering if there is a way in R to read in a particular column from a tab-delimited file, edit it and write it back into the file with all other columns intact. When I say edit I mean just replacing all the values in that column.
I know to read a particular column from a file using colClasses option in read.delim() function.
Is there any such option to write out
2009 Aug 12
3
Zoo and numeric data
Hi,
I have a csv file with different datatypes:
2009-01-01, character1, 10, 20.1
2009-01-02, character2, 11, 21.1
(I have attached the file to this post)
I read this file with read.zoo as I want a zoo/xts timeseries:
> t = read.zoo("./data.txt", sep=",", dec = ".", header=FALSE)
If I look at the zoo data all integer/numeric columns are read as
character:
>
2009 Jul 11
1
Passing arguments to forked children
Hi -
I have attempted to use the fork::fork() function to perform
parallel processing. However, the child R function called needs to
know a given set of parameters to complete its task. Specifically, I
iterate through a vector, and output values based on the elements of
that vector to a database. The output strings contain elements of the
iterated vector. I mocked-up the following code as an
2017 Jun 13
2
reading data
Hi all,
I am using R to extract data on a regular basis.
However, sometimes using the same script and the same data I am
getting different observation.
The library I am using and how I am reading it is as follows.
library(stringr)
namelist <- file("Adress1.txt",encoding="ISO-8859-1")
Name <- read.fwf(namelist,
colClasses="character",
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 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 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 Jun 14
0
reading data
You need to provide reproducible data. What does the file contain? Why
are you using 'sep=' when reading fixed format. You might be able to
attach the '.txt' to your email to help with the problem. Also you did not
state what the differences that you are seeing. So help us out here.
Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?
Tell me what
2007 Mar 11
3
read.table for a subset of data
Hi R-experts,
I have data from four conditions of an experiment. I tried to create four
subsets of the data with read.table, for example,
read.table("Experiment.csv",subset=(condition=="1"))
. I found a similar post in the archive, but the answer to that post was
no. Any new ideas about reading subsets of data with read.table?
Thanks!
Feng
[[alternative HTML version
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
2008 Jun 05
1
problems with reading the data and merge
I have a problem with reading a file data.txt that has a header
Each row has the individual ID and then some data that are letter and
numbers such as 00
If I read the file as
data<-read.table("data.txt",sep='\t', header=T)
write.table(data,file="data1.txt", sep='\t', quote=F, col.names=T,
row.names=F)
data1.txt looks different than data.txt. In
2009 May 14
2
How to do a pretty panel plot?
The pretty picture that I saw at:
http://chartsgraphs.wordpress.com/2009/02/09/r-panel-chart-beats-excel-chart/#more-1096
inspired me to try something similar. The code that I wrote is:
------snipsnip---------------------------------------------------------------------
M <- structure(list(date = structure(c(13634, 13665, 13695, 13726,
13757, 13787, 13818, 13848, 13879, 13910, 13939, 13970,
2014 Sep 15
7
[Bug 83897] New: GK106 (GeForce GTX 660): Frequent GPU lockups
https://bugs.freedesktop.org/show_bug.cgi?id=83897
Priority: medium
Bug ID: 83897
Assignee: nouveau at lists.freedesktop.org
Summary: GK106 (GeForce GTX 660): Frequent GPU lockups
QA Contact: xorg-team at lists.x.org
Severity: major
Classification: Unclassified
OS: Linux (All)
Reporter: freedesk.apriori at
2005 Sep 11
4
Returned mail: see transcript for details (fwd)
Every post I do to this mailinglist is followed by a bounce message from
"centos.5.warren at recursor.net".
I have no clue why this is being send to me, afaics some IP address is
being blacklisted but I am not related to it.
Am I the only one who gets this and can we remove this person from the
mailinglist ?
Kind regards,
-- dag wieers, dag at wieers.com, http://dag.wieers.com/
2007 Jun 07
2
Display Multiple page lattice plots
Gudday,
I am generating a series of lattice contourplots that are conditioned on a variable (Year) that has 27 different levels. If I try and put them all on one plot, it ends up pretty messy and you can't really read anything, so instead I have set the layout to 3x3, thus generating three pages of nine plots each. The problem is that I can't display all these on screen at once, because
2017 Jun 22
2
For loop
Hello R users,
The code below is for loop in R that I want to do to following
calculation at each time i and i-1 in 2:75 dataset
(Litterfall_Ahmed97).
ac = ((LeafBiog at date i
-LeafBiog at date i-1, dataset = leafbiom97) + (littperiod at date i,
dataset= Litterfall_Ahmed97))/(sum (GPP from date i-1 to date i,
dataset=GPP_Ahmed13)/2) .
#code for loop
GPP_Ahmed13$Date <-