similar to: colClasses

Displaying 20 results from an estimated 30000 matches similar to: "colClasses"

2006 Jun 23
3
Problems with weekday extraction from zoo objects
Hi Folks! I'm struggling with dates - but enough about my personal life..... I have two daily time series files. In one (x) the date format is Y/m/d and the other (y) is d/m/y. I used read.zoo on both and they read into R with no problem. Then I use: weekdays(as.Date(x$DATE)) and get what I expect - all the days of the week in my data set. When I use:
2008 May 02
2
Extract lags from a formula
Hi folks! How do I extract lags from a formula? An example: mod.eq<-formula(x~lag(x,-1)+lag(x,-2)) > mod.eq x ~ lag(x, -1) + lag(x, -2) > mod.eq[1] "~"() > mod.eq[2] x() > mod.eq[3] lag(x, -1) + lag(x, -2)() I'm trying to extract the lags into a vector that would be simply [1,2]. How do I do this? I'm using the dyn package to do dynamic
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: >
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"
2008 Aug 01
3
Reading data in R-metrics
Hi Folks! I used the code below previously with no problems, but now I get: DTB3<-read.table("C:\\Program Files\\R\\R-2.7.1\\DTB3.csv",header=TRUE,sep=",") > tail(DTB3) DATE VALUE 14233 2008-07-23 1.56 14234 2008-07-24 1.62 14235 2008-07-25 1.71 14236 2008-07-28 1.70 14237 2008-07-29 1.69 14238 2008-07-30 1.67 >
2006 May 15
3
Dyn or Dynlm and out of sample forecasts
All: How do I obtain one step ahead out-of-sample forecasts from a model using "dyn" or "dynlm" ? Thanks! Best, John [[alternative HTML version deleted]]
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
2008 Jul 02
1
Multiple time series plots
Hi all: I'm trying to plot two time series created in Rmetrics and label the x-axis with dates. I tried the following: dates <- as.Date(seriesPositions(x.agg)) r <- as.Date(range(dates)) ts.plot(x.agg@Data[,c(1,5)],gpars=list(ylab="Volume", lty=c(1:2),xaxt="n",main="Plot of Volume")) axis.Date(1, at=seq(r[1], r[2], length.out=10),
2008 Jan 24
1
Error using Rmetrics to read data
Hi folks. This set of code used to work, but after upgrading to the latest version of Rmetrics it no longer does. Any ideas? SP500<-read.table("SP500.csv",header=TRUE,sep=",") > head(SP500) Date Open High Low Close Volume Close2 1 8/4/2006 1280.26 1292.92 1273.82 1279.40 2530970112 1279.40 2 8/3/2006 1278.22 1283.96 1271.25 1280.27
2010 Oct 25
4
zoo.read intraday data
Hello all, I'm trying to use zoo.read but can't figure out how to deal with the time format. (example below) would be nice if someone could help. best regards, Immanuel --------------------------- L <- "Date,Time,Open,High,Low,Close,Up,Down 05.02.2001,00:30,421.20,421.20,421.20,421.20,11,0 05.02.2001,01:30,421.20,421.40,421.20,421.40,7,0
2012 May 02
5
uneven vector length issue with read.zoo?
I truncated and simplified my code and the read in data that I'm working with to isolate the issue. Here is the read in data and R script respectively: http://r.789695.n4.nabble.com/file/n4604287/test.csv test.csv http://pastebin.com/rCdaDqPm Here is the terminal/R shell output that I hope the above replicates on your screen: > source("elecLoad.r", echo = TRUE) > #Load
2007 Nov 09
1
Problem reading data in Rmetrics
Hi folks - After upgrading to the latest version of Rmetrics, I can't read in data like I used to. Is anyone seeing the following? It seems to truncate the dates after I use "as.timeSeries". -John SP500<-read.table("SP500.csv",header=TRUE,sep=",") > head(SP500) Date Open High Low Close Volume 1 08/04/06 1280.26 1292.92
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have found an odd problem, that seems to be caused by zoo()'s handling of leap years. Here's my R script with 2 methods (freq=365, 366) for aggregating the daily data to monthly series: library(zoo) J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv" JAXA_data <- read.table(J_link,
2008 Feb 21
2
Unable to create/index a zoo irregular timeseries
In the text file pressione2008.csv I have the following "Data","MAX","MIN","Note" "07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta" "07-01-2008 18:00:00", 135, 85, "" "08-01-2008 08:00:00", 125, 75, "" which is a collection of blood pressure data at different time of the day. I would
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 >
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),
2010 Nov 05
7
How to extract Friday data from daily data.
I am new to Using R for data analysis. I have an incomplete time series dataset that is in daily format. I want to extract only Friday data from it. However, there are two problems with it. First, if Friday data is missing in that week, I need to extract the data of the day prior to that Friday (e.g. Thursday). Second, sometimes there are duplicate Friday data (say Friday morning and
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.
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,