Displaying 20 results from an estimated 900 matches similar to: "plotting large time series"
2006 Nov 23
1
dumping/loading objects with 'tsp' attribute
Dear all,
I'm indirectly faced with the fact that setting the 'tsp' attribute of
an object modifies its class definition:
> class( structure(1:2, tsp=c(1,2,1), class=c("myts","ts")) )
[1] "ts" "myts"
In general, this is of really little (ok, I admit: totally no)
interest for me because 'myts' class is added just after assigning the
2004 Jun 22
2
ts & daily timeseries
I have defined a daily timeseries for the 365 days of 2003 issuing:
myts = ts(dati[,2:10],frequency=365,)
> myts
Time Series:
Start = c(1, 1)
End = c(1, 365)
Frequency = 365
and
mytime = as.POSIXct(strptime(as.character(dati[,1]),format="%Y-%m-%d"))
contains the dates from "2003-01-01" to "2003-12-31"
How can I combine mytime and myts in order to list
2013 Mar 21
2
How to store data frames into pdf file and csv file.
Hello,
I have a data frame
> mdl.summary
est.coef std.err t.stat
intercept 0.0011625517 0.0002671437 4.351784
aa -0.0813727439 0.0163727943 -4.969997
dummy1 -0.0002534873 0.0001204000 -2.105376
dummy2 -0.0007784864 0.0001437537 -5.415417
bb -0.0002856727
2012 Mar 28
4
Grafico en 3D
Buenas tardes,
Podria por favor alguien ayudarme a descifrar por que no es posible ver la
grafica 3D cuando se utiliza lattice? Ya se que algunas veces los duendes
hacen de las suyas, pero no estoy seguro de que este sea el caso. He
reiniciado R, cambiado a RStudio y utilizado XP, pero no pasa "nada".
Mi sessionInfo() es:
R version 2.14.0 Patched (2011-11-12 r57642)
Platform:
2009 Oct 06
2
Extracting year from a date object
Hi all,
this one left me a bit puzzled, as I don't seem to find a function to
perform this easily. I must have overlooked the obvious, so sorry in
advance.
I have a list of dates in numerical format (i.e. 34576), defined as
the number of days that passed since january 1st 1900. So I apply the
function :
> MyDate <-as.Date(34576,origin="1900-01-01")
> MyDate
[1]
2008 Oct 16
1
Rscript -e, Sweave and tempdir()
Hello R-Help
I have a question about the "behind the scenes" behaviour of the Rscript -e command and particularly its interaction with Sweave and tempdir().
We are trying to deploy R as a web service to do water quality analyses and have been writing software to call Sweave via Rscript eg:
cmd> Rscript -e Sweave('sweavefile.Rnw')
One problem we have been having is that
2011 Jul 14
2
cbind in aggregate formula - based on an existing object (vector)
Hello!
I am aggregating using a formula in aggregate - of the type:
aggregate(cbind(var1,var2,var3)~factor1+factor2,sum,data=mydata)
However, I actually have an object (vector of my variables to be aggregated):
myvars<-c("var1","var2","var3")
I'd like my aggregate formula (its "cbind" part) to be able to use my
"myvars" object. Is it
2006 May 21
1
POSIX, time zone and Windows
Dear Listers,
Apologize to pile up on the 'tz' issue in POSIX objects. I have a
'simple' thing on which I must make up my mind but cannot do it from the
existing R-help threads. I am currently working on dog telemetry in
China, and download time information from GPS collars. I would like to
set up the corresponding POSIXxx variables in R to a given time zone. Eg
Pekin
2011 Apr 18
1
using "aggregate" when variable names contain spaces
Hello!
my data set has many variables. Unfortuantely, many of those variables
contain spaces in their names.
I need advice on: how to refer to variable names in the formula for
"aggregate". See example below:
### Generating example data set:
mydate = rep(seq(as.Date("2008-12-01"), length = 3, by = "month"),4)
value1=c(1,10,100,2,20,200,3,30,300,4,40,400)
2011 Mar 01
2
Does POSIXlt extract date components properly?
I would like to use POSIX classes to store dates and extract components of
dates. Following the example in Spector ("Data Manipulation in R"), I
create a date
> mydate = as. POSIXlt('2005-4-19 7:01:00')
I then successfully extract the day with the command
> mydate$day
[1] 19
But when I try to extract the month
> mydate$mon
[1] 3
it returns the wrong month. And
2011 Apr 04
2
merging 2 frames while keeping all the entries from the "reference" frame
Hello!
I have my data frame "mydata" (below) and data frame "reference" -
that contains all the dates I would like to be present in the final
data frame.
I am trying to merge them so that the the result data frame contains
all 8 dates in both subgroups (i.e., Group1 should have 8 rows and
Group2 too). But when I merge it it's not coming out this way. Any
hint would be
2013 Apr 02
2
Create a vector without using an external 'if statement'
Dear R-users,
suppose I have three dataframes like these
df1:
mydate min_temp
31032013 12
01042013 8
02042013 -999
df2:
mydate min_temp
31032013 10
01042013 11
02042013 14
df3:
mydate min_temp
31032013 4
01042013 3
02042013 5
where -999 means that the temperature data is not available (at the moment I cannot change it to NA because I am not the db administrator);
suppose also that oggi is
2012 May 10
1
stop calculation in a function
Hi dear R-users,
I have a question about a function I'm trying to improve.
How can I stop the function calculation at the last numeric value of my
data?
The problem is that the end of my data contains missing values (NAs). And
the aim of my function is to compare the first numeric value with the next
one (till the end). For the moment, It works well when my data doesn't
contains any NAs
2009 Aug 28
2
new data.frame summed by date
Hi,
I wonder if someone can suggest how to create a new data.frame Y
from X where X$PL_Pos is summed by each unique X$MyDate. Y should end
up with two (or more) columns Y$MyDate and Y$PL_Sum with its value
being the cumsum of all the values in X for that date. - a 'daily
cumsum'.
Thanks,
Mark
TStoDate = function (TSDate) {
X = strptime(TSDate + 19e6L, "%Y%m%d")
2008 May 06
1
ggplo2: x_discrete labels size/direction
Hi everyone,
I've got quite a few labels along the x axis and ggplot2 basically just
crams them on top of each other.
Is it possible to reduce the font size and/or text direction?
Stretching the "windows" device window manually also helps, but I found that
setting the parameters for the pdf device (where my scripts should print the
data), such as paper="a4r" just results
2011 May 19
1
Creating a "shifted" month (one that starts not on the first of each month but on another date)
Hello!
I have a data frame with dates. I need to create a new "month" that
starts on the 20th of each month - because I'll need to aggregate my
data later by that "shifted" month.
I wrote the code below and it works. However, I was wondering if there
is some ready-made function in some package - that makes it
easier/more elegant?
Thanks a lot!
# Example data:
2020 Mar 10
2
Fwd: Windows upssched does not work
Hi,
I have problem with upssched on windows. Upssched is not executed. I
have 2 scripts, 1 for notification in upsmon and second for scheduling
in upssched. Monitoring is working fine, script write to log. I'm
using binary windows installer 2.6.5-6 from NUT.
Here are my configs:
--- nut.conf
MODE=netclient
--- upsmon.conf
MONITOR ups_1000 at 192.168.3.95 1 <user> <password> slave
2011 Aug 24
2
data manipulation and summaries with few million rows
I have a data set with about 6 million rows and 50 columns. It is a
mixture of dates, factors, and numerics.
What I am trying to accomplish can be seen with the following
simplified data, which is given as dput output below.
> head(myData)
mydate gender mygroup id
1 2012-03-25 F A 1
2 2005-05-23 F B 2
3 2005-09-08 F B 2
4 2005-12-07 F B 2
2008 Jul 01
3
dev.off() inside a function & other glitches
Hi R people
I am using a function to create a pdf device, then send a lot of plots
to it in a loop then a last lattice xyplot (itself within a function)
outside the loop and finally call dev.off() to write to the file.
This works well apart from the fact that the last plot does not get
sent to the file unless I comment out dev.off() and then apply it in
the console afterwards instead:
2009 Mar 11
1
Is this a documentation bug? Spss dates import
Hello R-user
bug seekers are needed!
In order to perform these simple tasks you have to use a copy of SPSS
and obviously R.
The problem is that date conversion of data coming from SPSS
gives wrong results, if we follow ?as.POSIXct
## SPSS dates (R-help 2006-02-17)
z <- c(10485849600, 10477641600, 10561104000, 10562745600)
as.Date(as.POSIXct(z, origin="1582-10-14",