Displaying 20 results from an estimated 20000 matches similar to: "plotting zoo object"
2009 Aug 01
1
zoo plot warning messages - I don't know what they mean or how to inspect the data to figure this out
I have a time series from 1933-2005 of precipitation at Fayetteville
NC. I get the following error messages when I plot the zoo series.
Any help would be appreciated. If you need the data I can dput it or
send the csv. I didn't include it here because I didn't want to clog
up anybodies email account. I know that this is not reproducible, and
I will send along the file if needed.
2012 Mar 20
3
Wrong output due to what I think might be a data type issue (zoo read in problem)
Here's the small scale version of the R script:
http://pastebin.com/sEYKv2Vv
Here's the file that I'm reading in:
http://r.789695.n4.nabble.com/file/n4487682/weatherData.txt weatherData.txt
I apologize for the length of the data. I tried to cut it down to 12 lines,
however, it wasn't reproducing the bad output that I wanted to show.
The problem is that my whole data set
2009 Mar 31
3
labeling panels in lattice plots
I am using windows XP with R 2.8.1
I am generating a lattice plot of annual rain patterns using the following
function:
> xyplot(rain.stats$min+ rain.stats$max + rain.stats$ave ~
rain.stats$month |rain.stats$year,
lty = 1, data = rain.stats, type = c("l","l", "l"), col =
c("red", "blue", "green"), distribute.type =
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))],
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:
2010 Jun 10
2
[R[ dates on zoo objects
Dear R People:
I have a zoo object with its date index as a factor.
> xAle1.zoo$index
Error in xAle1.zoo$index : $ operator is invalid for atomic vectors
> str(xAle1.zoo)
Class 'zoo' atomic [1:32] 1253 1316 1038 1157 1710 1489 1159 1142 945 1245 ...
..- attr(*, "index")= Factor w/ 32 levels "04/16/09","04/17/09",..:
1 2 3 4 5 6 7 8 9 10 ...
>
2008 Mar 13
3
zoo object: replace NAs from another zoo object
Hello,
I have two zoo objects, new and old, indexed by chron objects. Their structure is like this:
(05/25/06 00:00:00) NA NA NA
(05/25/06 00:02:00) 948.20 24.198 0
(05/25/06 00:04:00) 948.26 20.640 0
(05/25/06 00:06:00) 948.37 19.653 0
(05/25/06 00:08:00) 948.48 19.135 0
(05/25/06 00:10:00) 948.54 22.510 0
(05/25/06 00:12:00) 948.55 27.175 0
(05/25/06 00:14:00) 948.46
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 Dec 04
2
Question about #1 zoo-faq
Hi all,
I have a zoo object issue. When I create a zoo object I have following error
message: "some methods for 'zoo' objects do not work if the index entries in
'order.by' are not unique."
I checked if I have some duplicates in the 'Time' column, R says yes, but
when I check the data set I can't explain why. Here is the code.
>
2011 Sep 27
1
Does replacing some values of a zoo object by NA reduce it's size ?
Dear R-helpers,
Please have a look at the following. f1 is the same as f2 except that it has
some values replaced by NA. But it's corresponding file is slightly bigger
than the file containing f2. Could someone please tell me if this is an
anomaly ?
> load("file1")
> ls()
[1] "f1"
> load("file2")
> ls()
[1] "f1" "f2"
>
>
2008 Jul 08
1
making zoo objects with zoo without format argument?
#this is a subset of a larger data frame and I am okay with subsetting it as
there are redundant time stamps, but I would like to create a zoo object out
of this and I am having a hard #time figuring out how to do this the date
structure is year and then month
x <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L,
3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L,
2010 Jul 26
1
zoo objects and "c"
Dear R People:
I would like to combine a zoo object with some observations at the end.
Here is the set up:
> xgh
2010-06-15 2010-06-16 2010-06-17 2010-06-18 2010-06-19 2010-06-20 2010-06-21
5 6 1 5 0 0 13
2010-06-22 2010-06-23 2010-06-24 2010-06-25 2010-06-26 2010-06-27 2010-06-28
9 6 4 6
2008 Oct 19
1
zoo in ggplot2
library(zoo)
d<-(structure(c(1.39981554315924, 0.89196314359498, 0.407816250252697,
0.823496839063978, 1.14429021220358, 1.23971035967413, 0.960868900583432,
0.927685306209829, 1.22072345292821, 0.249842897450642, 1.00879641624694,
0.925372139878243, 0.317259909172362, 0.382677149697482), index =
structure(c(11808,
11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631,
12753, 12996,
2008 Apr 02
1
zoo plot not showing whole date
z1 = read.zoo("chemmgL.csv", sep=",", header=T, format="%m/%d/%y")
I would like to the entire date field in the plot - 1/1/07 all that I
get now is 2007
I do not include data because it is to large of a data set for an email
--
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us
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 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi,
again i am stuck in my presentation, and i have never learn R before in my
life but need this to be done, so please help me out for a favour:
http://www.nabble.com/file/p20333155/kew.dat kew.dat
run this in R and these comes up:
Month Year Rain
1 Jan 1900 74.400000
2 Feb 1900 80.500000
3 Mar 1900 23.600000
4 Apr 1900 23.600000
5 May 1900 25.100000
6
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
2013 Mar 14
1
ggplot2 problem
Hello all!
I have a problem with ggplot2 library. I want to do an heat map and the y
variables are the year months. If I use the following code, he y values are
in alphabetical order, but I want it in month order.
The code is:
library(reshape)
library(ggplot2)
library(scales)
p <- ggplot(data.m, aes(variable, Month)) + geom_tile(aes(fill = value),
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)
2011 Jan 06
1
[zoo] - Individual zoo or data frames from non-continuous zoo series
#Is there a way to break the below zoo object into non-NA data frames
algorithmically
#this is a small example of a much larger problem.
#It is really no even necessary to have the continuous chunks
#end up as zoo objects but it is important to have them end
#up with the index column.
#thanks for all of your help in advance, and
#if you need anything else please let me know
library(zoo)
ind.