similar to: replace NA with 9999 in zoo object

Displaying 20 results from an estimated 9000 matches similar to: "replace NA with 9999 in zoo object"

2008 Mar 03
1
write csv file from zoo object
# chron library(chron) fmt.chron <- function(x) { chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x)) } z1 <- read.zoo(SC3.csv, sep = ",", header = TRUE, FUN = fmt.chron) z2 <- read.zoo(SC2.csv, sep = ",", header = TRUE, FUN = fmt.chron) z3<-c(z1, z2) write.table(z3, sep="," , "SC.csv") How do you
2008 Mar 07
1
zoo object won't plot
DateTime RM61 11/30/2006 12:31 NA 11/30/2006 12:46 NA 11/30/2006 13:01 2646784125 11/30/2006 13:16 NA 11/30/2006 13:31 NA 11/30/2006 13:46 NA 11/30/2006 14:01 2666435177 11/30/2006 14:16 NA 11/30/2006 14:31 NA 11/30/2006 14:46 NA 11/30/2006 15:01 2653041914 11/30/2006 15:16 NA 11/30/2006 15:31 NA 11/30/2006 15:46 NA 11/30/2006 16:01 2693126189 11/30/2006 16:16 NA 11/30/2006 16:31 NA 11/30/2006
2008 Mar 05
1
plotting big zoo object memory problem
the comma seperated file is 37Mb, and I get the below message: it is zoo object read in this way: # chron > library(chron) > fmt.chron <- function(x) { + chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x)) + } > z1 <- read.zoo("all.csv", sep = ",", header = TRUE, FUN = fmt.chron) and then the plot is done with:
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
2009 Sep 27
2
zoo: merging aggregated zoo-objects fails
Dear all, I have several text files looking like this: 9063032 19700201 22:00 174.067 9063032 19700201 23:00 174.076 9063032 19700202 00:00 174.085 9063032 19700202 01:00 174.091 9063032 19700202 02:00 174.094 9063032 19700202 03:00 174.091 9063032 19700202 04:00 174.082 9063032 19700202 05:00 174.079 And I run this loop: for (j in 1:nr.of.files) { #Import: DF <-
2010 Jan 29
1
use zoo package with multiple column data sets
Readers, I am trying to use the zoo package with an array of data: file1: hh:mm:ss 1 hh:mm:ss 2 hh:mm:ss 3 hh:mm:ss 4 file2: hh:mm:ss 11 55 hh:mm:ss 22 66 hh:mm:ss 33 77 hh:mm:ss 44 88 I wanted to merge these data set so I tried the following commands: library(chron) library(zoo) z1<-read.zoo("path/to/file1.csv",header=TRUE,sep=",",FUN=times)
2008 Mar 03
2
read.zoo problem reading in date time
DateTime,Temp,SpCond,DOConc,Depth,pH,ORP,Turbidity+,Chlorophyll,Battery,Cond,DO%,Salinity,TDS 01/13/2006 17:01,10.87,84,9.36,0.664,7.3,132,28.8,3.1,11.5,0.062,84.6,0.04,0.055 01/13/2006 17:16,10.9,84,9.36,0.66,7.31,133,28.7,2.9,11.5,0.062,84.7,0.04,0.055 01/13/2006 17:31,10.92,84,9.36,0.655,7.3,132,28.4,2.6,11.4,0.062,84.8,0.04,0.055 01/13/2006
2008 Jul 02
1
Zoo plotting behavior
I have a matrix with data that runs from 1/1/06 00:01:00-1/31/08 23:46:00. I have read in the data with this fmt.chron <- function(x) { chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x)) } x <- read.zoo(file.choose(), sep=",", header=T, FUN=fmt.chron) plotted with this plot(x[,(seq(3, by=9, length.out=12))],
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
2008 Sep 22
1
as.day() Function (zoo question)
I am was going to look at the as.yearmon function in the zoo package and write a as.day function to aggregate a time series of 96 observations per day into the mean for each day, but I don't know how to look at the code so that I can convert it into something I can use. On top of that I believe that it is probably an S3 method and I haven't quite gotten that far in my programming
2008 Nov 04
2
Zoo seems to be running slow in R 2.8.0 windows
R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] StreamMetabolism_0.01 chron_2.3-24 zoo_1.5-4 loaded
2008 Aug 21
1
max and min with the indexes in a zoo object (or anything else that could solve the problem)
library(zoo) library(chron) t1 <- chron("1/1/2006", "00:00:00") t2 <- chron("1/31/2006", "23:45:00") deltat <- times("00:15:00") tt <- seq(t1, t2, by = times("00:15:00")) d <- sample(33:700, 2976, replace=TRUE) sin.zoo <- zoo(d,tt) #there are ninety six reading in a day d.max <- rollapply(sin.zoo, width=96, FUN=max)
2009 Aug 11
1
merge zoo objects contained in a list
I would like to merge zoo objects that are stored in a list into one big zoo object with one index for all of the observations. I have created the list (74 dataframes) with the code below, and have tried the do.call(merge, foo) in the call and the output is not what I expected. Any help would be greatly appreciated. Stephen Sefick ###################################################level logger
2008 Jul 29
1
combining zoo series with an overlapping index?
day<-structure(c(7.7, 7.7, 7.7, 7.7, 7.7, 7.71, 7.7, 7.71, 7.71, 7.7, 7.7, 7.7, 7.7, 7.69, 7.68, 7.68, 7.67, 7.67, 7.67, 7.66, 7.65, 7.65, 7.65, 7.64, 7.64, 7.63, 7.63, 7.63, 7.62, 7.62, 7.62, 7.62, 7.63, 7.63, 7.63, 7.63, 7.63, 7.64, 7.64, 7.65, 7.65, 7.65, 7.66, 7.66, 7.67, 7.67, 7.67, 7.68, 7.68, 7.69, 7.69, 7.69, 7.69, 7.7, 7.7, 7.7, 7.7, 7.7, 7.71, 7.7, 7.7, 7.71, 7.71, 7.7, 7.7, 7.7, 7.7,
2008 Jul 28
1
Interpolating a line and then summing there values for a diurnal oxygen curve (zoo object)
#I would like to interpolate a straight line between 06/08/06 04:16:00 - 06/08/06 20:31:00 with values and then sum them. This is an estimate of ecosystem #respiration and I will be using this in a larger context(48 days of these diurnal curves), but for right now I am just trying to figure out how to do it for this one #day example. I have some other code for Ecosystem (stream) Metabolism that
2010 Jun 28
1
Zoo series to a date time stamp that is regular
NOTE: I will provide data if necessary, but I didn't want clutter everyones mailbox All: I have a time series with level and temperature data for 11 sites for each of three bases. I will have to do this more than once is what I am saying here. OK, The time series are zoo objects with index values in chron format. The problem is that the date and times should be at even 15 min intervals,
2008 Jul 31
2
S 3 generic method consistency warning please help
I would like to include this in a package. The S3 methods on R CMD check says * checking S3 generic/method consistency ... WARNING window: function(x, ...) window.chron: function(data, day1, hour1, day2, hour2, ...) See section 'Generic functions and methods' of the 'Writing R Extensions' manual. I have looked and can not figure it out. This function is for convience. What
2011 Mar 02
1
Create a zoo/xts Time Series with Millisecond jumps
Is there a easy way to create the time index for a zoo/xts object for every 100 milliseconds. eg. time Index would be: 10:00:00:100 10:00:00:200 10:00:00:300 10:00:00:400 I am looking to build an empty zoo/xts object with time index from 10am to 3pm, index jumps by 100ms each row. Thanks, Chris -- View this message in context:
2010 Jul 06
4
Adding two files into one and vlookup
I have two files with dates and prices in each. The number of rows in each of them will differ. How do I create a new file which contains data from both these files? Cbind and merge are not helpful. For cbind because the rows are not the same replication occurs. Also if I have similar data how do I write a vlookup kind of function? I am giving an example below: Say Price1 file contains the
2009 Jun 16
1
Chron / zoo index problem
Hi all I have an irregular zoo series, where the time index looks like the following: > head(time(l.zoo)) [1] "2009-06-15 01:44:20.802 GMT" "2009-06-15 01:44:20.812 GMT" "2009-06-15 01:44:20.837 GMT" "2009-06-15 01:44:20.848 GMT" "2009-06-15 06:00:01.320 GMT" [6] "2009-06-15 06:00:01.330 GMT" >