Displaying 20 results from an estimated 10000 matches similar to: "zoo plot not showing whole date"
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 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:
2008 Mar 06
2
replace NA with 9999 in zoo object
This is the same set of data that I have been working with for those
in the know. it is a matrix of ~174 columns and ~70,000 rows. I have
it as a zoo object, but I could read it in as just a matrix as long as
the date time stamp won't be corrupted.
here is an example of what a column would look like:
1/1/06 12:00, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,6 ,7, NA
#read in with the
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 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 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 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,
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.
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 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,
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 Aug 15
3
ylab with an exponent
plot(1,2, ylab= paste("insects", expression(m^2), sep=" "))
I get insects m^2
I would like m to the 2
what is the problem?
--
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 up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being
2008 Feb 22
3
Combining Data Frames
I have two dataframes in R that were tab seperated .txt files
y<-read.table("foo.txt", header=T)
x<-read.table("foo.txt", header=T)
these are set up like this:
Datetime Temp
01/01/07 00:01 11.5
01/01/07 00:16 11.6
etc etc to 66000 rows in y and 33000 rows in x
The two files overlap with the same data for a period of time but
contain
2008 Apr 08
3
simple graphing question
#copy and paste this into R
f <- (structure(list(TKN = c(0.103011025, 0.018633208, 0.104235702,
0.074537363, 0.138286096), RM = c(215, 198, 148, 119, 61)), .Names = c("TKN",
"RM"), class = "data.frame", row.names = 25:29))
plot(f$TKN~f$RM, type="b")
I would like to reverse the X-Axis. How do I do this?
--
Let's not spend our time and resources
2008 Jul 15
2
POSIXct extract time
RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat
+datum=WGS84"))
d060101 <- as.POSIXct("2006-01-01", tz="EST")
study_seq <- seq(from=d060101, length.out=761, by="days")
up.215 <- sunriset(RM215.sp, study_seq, direction="sunrise",
POSIXct.out=TRUE)
down.215 <- sunriset(RM215.sp, study_seq, direction="sunset",
2009 Aug 13
3
split number in a vector and then make a chron object out of it
These are date and times in the format YYYYMMDDhhmmss. I would like
to take this column and make a chron object form them. I have tried a
couple of the split family of functions but they need character input
here is the data:
date.time <- c(19851001001500, 19851001003000, 19851001004500, 19851001010000,
19851001011500, 19851001013000, 19851001014500, 19851001020000,
19851001021500,
2008 Jan 21
4
Stationarity of a Time Series
Does anyone know of a test for stationarity of a time series, or like
all ordination techniques it is a qualitative assessment of a
quantitative result. Books, papers, etc. suggestions welcome.
thanks
Stephen
--
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 up and
make us feel like gods. We are
2009 Jan 15
3
Bar Plot ggplot2 Filling bars with cross hatching
#I am putting a test together for an introductory biology class and I
would like to put different cross hatching inside of each bar for the
bar plot below
color <- c("Brightly Colored", "Dull", "Neither")
lizards <- c(277, 70, 3)
liz.col <- data.frame(color, lizards)
qplot(color, lizards, data=liz.col, geom="bar", ylab="Observed
Matings",
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)
2008 Jul 19
2
extracting colnames to label plots in a function
#this is my little function that I would like to use the column names of the
x and y arguments in the function. I would like it to read
# site1-site2 how would I do this
diff.temp <- function(x, y ,use="pairwise.complete.obs")
{
na.method <- pmatch(use, c("all.obs", "complete.obs",
"pairwise.complete.obs"))
par(mfrow=c(2,1))