similar to: loading multiple CSV files into a single data frame

Displaying 20 results from an estimated 20000 matches similar to: "loading multiple CSV files into a single data frame"

2012 Feb 17
6
convert zoo object to "standard" R object so I can plot and output to csv file
Another newbie question I got the 1 minute spine interpolation and 15 mean aggregation working with many thanks to Gabor Grothendieck using Zoo functions. I got a tip from Hasan Diwan to look at xts but it seemed I would make better progress using code from Gabor. Now I'm having trouble plotting this zoo object. I'm thinking I want a function to "split" the zoo object back to
2013 Mar 05
1
ggplot2: two time series with different dates in a single plot
Hi Using the ggplot2 package, I would like to obtain a plot that contains two time series that have data points on different dates. For instance, one data frame looks like: date1, value1 2010-01-05, 2921.74 2010-01-08, 2703.89 2010-01-14, 3594.21 2010-01-20, 3659.22 The other data frame looks like date2, value2 2010-01-01, 285.85 2010-01-02, 229.20 2010-01-05, 333.91 2010-01-06, 338.27
2012 Feb 01
1
Combining month and year into a single variable
Hello all, ## I am trying to convert some year and month data into a single variable that has a date format so I can plot a proper x axis. ## I've made a few tries at this and search around but I haven't found anything. I am looking for something of the format "%Y-%m" ## A data.frame df <- data.frame(x=rnorm(36, 1, 10), month=rep(1:12, each = 3), year=c(2000,2001,2002)) ##
2017 Sep 29
2
Trouble when suppressing a portion of fast-math-transformations
Hi all, In a mailing-list post last November: http://lists.llvm.org/pipermail/llvm-dev/2016-November/107104.html I raised some concerns that having the IR-level fast-math-flag 'fast' act as an "umbrella" to implicitly turn on all the lower-level fast-math-flags, causes some fundamental problems. Those fundamental problems are related to situations where a user wants to
2011 Sep 12
5
Hourly data with zoo
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe. d <- rep(20110101,24) h <- seq(from = 0, to = 2300, by = 100) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) S <- chron(dates. = as.character(df$LST_DATE), times. = paste(as.character(df$LST_TIME/100), ":0:0", sep = ""), format =
2010 Oct 14
5
Replacing N.A values in a data frame
Hello, I have a data frame as below ... in cases where I have N.A. I want to use an average of the past date and next date .. any help? 13/10/2010 A 23 13/10/2010 B 12 13/10/2010 C 124 14/10/2010 A 43 14/10/2010 B 54 14/10/2010 C 65 15/10/2010 A 43 15/10/2010 B N.A. 15/10/2010 C 65 ---------------------------------------------------------------------------- -------------------------- Thanks
2011 Apr 09
5
Yearly aggregates and matrices
Hi, I need to perform calculations on subsets of a data frame: DF = data.frame(read.table(textConnection(" A B C D E F 1 a 1995 0 4 1 2 a 1997 1 1 3 3 b 1995 3 7 0 4 b 1996 1 2 3 5 b 1997 1 2 3 6 b 1998 6 0 0 7 b 1999 3 7 0 8 c 1997 1 2 3 9 c 1998 1 2 3 10 c 1999 6 0 0 11 d 1999 3 7 0 12 e 1995 1 2 3 13 e 1998 1 2 3 14 e 1999 6
2011 May 26
2
zoo column names
I have a zoo object that contains 2 time series named "A-B" and "V1". When I create a third series "V2", the name of the "A-B" series is changed to "A.B". Although I could recreate the names for the 3 series I am wondering if there is a way of preventing the name change from happening ( ... maybe an equivalent of the keep.names=TRUE statement
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
2010 Oct 15
7
Problem with merging two zoo objects
Dear all, I have following 2 zoo objects. However when I try to merge those 2 objects into one, nothing is coming as intended. Please see below the objects as well as the merged object: > dat11 V2 V3 V4 V5 2010-10-15 13:43:54 73.8 73.8 73.8 73.8 2010-10-15 13:44:15 73.8 73.8 73.8 73.8 2010-10-15 13:45:51 73.8 73.8 73.8 73.8 2010-10-15 13:46:21 73.8 73.8 73.8 73.8
2010 Nov 23
2
Plot two zoo object with different indexes
Dear R community, I have the following two zoo objects: MONTHLY CPI > plot(z) > par("usr") [1] 1977.76333 2011.15333 70.39856 227.03744 > z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12) > str(z) ?zooreg? series from Nov 1979 to Oct 2010 Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3 81.1 82 82 82.6 ... Index: Class 'yearmon' num [1:372]
2010 Dec 23
5
Writing a single output file
Dear R helpers! Let me first wish all of you "Merry Christmas and Very Happy New year 2011" "Christmas day is a day of Joy and Charity, May God make you rich in both" - Phillips Brooks ## ---------------------------------------------------------------------------------------------------------------------------- I have a process which generates number of outputs. The R code
2011 Dec 02
2
Moving column averaging
# need zoo to use rollapply() # your data (I called df) df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", "e", "f"), class = "data.frame", row.names = c(NA, -2L)) # transpose and make a zoo object df2 <- zoo(t(df)) #rollapply to get
2012 May 28
2
zoo: variable gets modified at making zoo object
I'm doing: > alyL32007z <- zoo(alyL32007,alyL32007$time) > range(time(alyL32007z)) [1] "2007-01-01 00:00:00 UTC" "2007-12-31 23:30:00 UTC" But then, while the original variable is: > summary(alyL32007$NEE_st) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's -15.340 -1.615 -0.054 -0.814 0.750 8.965 11124 the variable within the zoo object
2010 Oct 25
3
finding the year of a date
I know that I can use as.yearmon in the package "zoo" to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one find just the year of a date? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Sep 27
2
Coercing a character zoo to a numeric
Dear R-helpers, It seems to me that a character zoo cannot be coerced to a numeric zoo. Below is a minimal example. Can someone tell me what I have done wrong? > z<-zoo(1:4,order.by=1:4) > coredata(z)<-as.character(coredata(z)) > str(z) ‘zoo’ series from 1 to 4 Data: chr [1:4] "1" "2" "3" "4" Index: int [1:4] 1 2 3 4 >
2011 Nov 13
2
cannot load zoo package
Using: Mac OS 10.7.2 R version 2.13.2 I cannot load the zoo package. The install runs fine but when trying to load it i get the following error: /Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/Users/ntyhurst/Library/R/2.13/library/zoo/libs/i386/zoo.so': dlopen(/Users/ntyhurst/Library/R/2.13/library/zoo/libs/i386/zoo.so, 6): Library not loaded:
2011 Sep 08
1
Seasonal and 11-day subset for zoo object
I have a zooreg object and I want to be able to generate a value for seasons and 11-day composites paste it onto my zoo data frame, along with year, month and days. Right now I have the following to work from: eg. dat.zoo.mdy <- with(month.day.year(time(dat.zoo)), cbind(dat.zoo, year, month, day, quarter = (month - 1) %/% 3 + 1, dow = as.numeric(format(time(dat.zoo), "%w")))) For
2011 Sep 27
2
Problem with zoo::window()
I have the following time series: > class(CCasadesz2) [1] "zoo" > setmanes <- cut(time(CCasadesz2),breaks="weeks") > CCasadeswz <- aggregate(CCasadesz2,sum,by=setmanes) > class(CCasadeswz) [1] "zoo" > summary(CCasadeswz) Index CCasadeswz 2009-01-12 00:00:00: 1 Min. : 4.0 2009-01-19 00:00:00: 1 1st Qu.:
2012 Sep 05
2
cex.lab ignored in plot.zoo for multiple plots
Hello everyone, a problem with the plot.zoo function. In the parameters of the function, cex.lab is ignored. I tried to reduce the size of the yaxis labels by at least 50%. ------------------ Example: sample <- as.zoo(EuStockMarkets) par(las=1) plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date", yaxt="n", cex.lab=0.5,