Displaying 20 results from an estimated 2000 matches similar to: "Calculate a mean for several months for several years"
2012 Jan 31
2
testing for temperature differences between years and sites?
Hello!
I have a dataset with monthly temperatures for 4 different years and I would
like to test if they are significantly different between the years. As I
collected the data for different sites I wondered if there were some
possibility to perform the calculation at once or if I have to repeat it for
each site.
I tried like this:
Model_Temp <- lmer(Temp ~Year +
2013 Apr 06
2
How to plot several years data with date information by months?
Hi, all
I have a medium sized data, 6 years. Each observation is a case with a date variable, such as '2004-08-02'.
Some of the months didn't occur a case.
I want to plot the 6 years data by month, and the Y_axis is the freqency of cases for each month, meaning 12*6=72 bars or points in the figure.
I though of a method, 1st, using the months function, then ploting. But I need to
2009 May 29
0
ggplot2 date help (minor gridlines months and major grid lines years in a readable format)
library(ggplot2)
melt.updn <- (structure(list(date = structure(c(11808, 11869, 11961, 11992,
12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418,
12600, 12631, 12753, 12996, 13057, 13149), class = "Date"), variable =
structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L,
2011 May 06
1
Extracting months and years from Dates while keeping order
Hello!
I'd like to take Dates and extract from them months and years - but so
that it sorts correctly. For example:
x1<-seq(as.Date("2009-01-01"), length = 14, by = "month")
(x1)
order(x1) # produces correct order based on full dates
# Of course, I could do "format" - but this way I am losing the "Date"
quality of the data:
2009 Aug 20
4
expanding 1:12 months to Jan:Dec
Dear R users
I would like to do some spreadsheet style expansion of dates. For
example, I would need to obtain a vector of months. I approached in an
obviously wrong way:
> paste(01:12)
[1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12"
> as.Date(paste(01:12),
2008 Jan 12
0
hist.Date() and cut.Date(): approximations used when using breaks = 'months' or 'years'
Hi all,
I came across some curious behavior today in using hist.Date() and
subsequently noted the same behavior in cut.Date(), both of which are
using similar code when 'breaks = "months"' or 'breaks = "years"'.
I was in the process of creating a histogram of subject enrollment in a
clinical trial. The counts needed to be by month, so essentially used:
2008 Jul 14
2
aggregate months to years
Many thanks for the recent answers to my question about pattern recognition.
The hint to "grep" and the "pattern" argument brought me a big deal forward.
# Now, I have a data frame:
DATE <- c("1930-01-01", "1930-01-01", "1930-02-01", "1931-01-01",
"1931-02-01", "1931-03-01") # almost all months until
2008 Apr 25
4
Constructing dummy variables for months for a time series object
I have a TS of monthly observations.
head(data4)
1991(1) 1991(2) 1991(3) 1991(4) 1991(5) 1991(6)
12.00864 11.94203 11.98386 12.01900 12.19226 12.15488
Now I want to make 11 dummy variables indicating months. Therefore I did followings :
For Jan :
rep(c(rep(0,0), 1, rep(0, 11)), 17)
For Feb :
rep(c(rep(0,1), 1, rep(0, 10)), 17)
........ and so on
But my
2008 Oct 01
0
plotting several yearly/monthly time series on the same plotting several yearly/monthly time series on the same graph
I have searched the forums but I am having trouble trying accomplish two
specific plots. I am not sure if this is a very basic task but I am having a
lot of trouble Here is my data frame:
date prod_daily price
1 2003-08-15 12050 4.83
2 2003-08-18 12050 4.94
3 2004-08-10 12300 5.78
4 2004-08-11 12300 5.64
5 2004-08-12 12300
2019 Nov 11
0
NUT 2.7.4 is several years ago - new stable release?
Hi,
The last stable release for NUT (version 2.7.4) was several years ago.
Is there a reason for the long hiatus?
The reason I ask is that all of the distros seem to package that version.
I'm hitting issues with NUT, and a Redditor suggested it was due to my old
version - but I'm just using the distro version:
2011 Mar 23
2
mean of runoff for several years
Hello everyone
I have a dataframe with 4 colums (year, month, day, runoff) for 1993-2009.
Now I like to calculate the average runoff for each day. Finally I like to
plot the median runoff for all this years.
I tried with some loops, but it didn't work. Do you have any Tips for my
problem?
Any help is greatly appreciated! Thank you very much.
Dominique
--
View this message in context:
2007 Nov 13
2
finding the annual maximun within several years
dear r-helpers
i've got a table that in extracts looks like this:
V1 V2 V3 V4 V5
1 01/01/1975 00:00:00 125.837 3.691 296.618
2 01/01/1975 01:00:00 124.799 3.679 281.307
3 01/01/1975 02:00:00 111.607 3.536 281.307
4 02/24/1976 11:00:00 21.602 2.555 93.893
5 02/24/1976 12:00:00 27.804 2.623 93.893
6 02/24/1976 13:00:00 26.105 2.604 114.716
7 10/18/1977
2004 Jun 07
7
Vectors of years, months, and days to dates?
The interface for dates in R is a little confusing to me.
I want to create a vector of Date objects from vectors of years, months, and
days.
One solution I found is:
years <- c(1991, 1992)
months <- c(1, 10)
days <- c(1, 2)
dates <- as.Date(ISOdate(years, months, days))
But, in this solution the ISOdate function converts the vectors into
characters,
which can cause serious
2007 Oct 26
2
how do i find the annual maximun within several years?
dear kind helper,
i would like to know how to find the annual maximun for a table that
basicly looks like this:
date time measurement1 measurement2 measurement3
mm/dd/yyyy hh:mm:ss m1 m2 m3
there are about 9000 measurements for each year, which makes it quite
large...
i already tried to subset all rows for a year, to find the maximum
within these choosen rows,
y <-
2008 Sep 12
1
how to plot monthly mean data showing missing months
Dear R users,
As per my attached script I am ploting monthly mean data which has missing
months.
But in the plot missing months are not shown (plot attached).
Kindly help how to show complete plot (Jan-Dec) with missing months.
Regards,
Yogesh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: script.txt
URL:
2013 Feb 12
3
Changing the order of months within a year
I have data that looks like below and I would like to re-order the values within the "date" column. I would like to have each year organized like so:
Sep-71
Oct-71
Nov-71
Dec-71
Jan-71
Feb-71
Mar-71
Apr-71
May-71
Jun-71
Jul-71
Aug-71
Sep-72
Oct-72
etc...
Is there any way I can order the column in my own fashion and just move Sep-Dec to the beginning of each year? I am planning on doing
2011 Mar 15
2
Calculate monthly means
I am trying to calculate monthly means by year of phosphates and nitrates from a multi year data set. Can anybody help me out with the most effective way to do this?
My data looks like this:
Collection_Date Test.Name Value
2000-01-24 17:00:00 Phosphate 0.108
2000-01-24 17:00:00 Nitrate 0.037
2001-11-12
2006 Jul 07
3
calculate number of months difference between two dates
hi,
Is there an easy way of calculating the difference in months between two
dates in a controller.
thanks
--
Posted via http://www.ruby-forum.com/.
2007 Sep 24
2
Calculate difference between dates in years
Hello,
I would like to be able to calculate the age of someone at a particular
date. Both dates are date objects. Here is what I have come up with:
floor(as.numeric(sampleInfo$Date.of.DIAGNOSIS-sampleInfo$Date.of.birth)/365.25)
Is this the best approach? or is there an inbuilt function? I have
looked at difftime but that does not seem to allow output in years.
Many thanks
Dan
--
2011 Jan 28
4
Months in alphabetical order rather than chronological order in graph
Greetings
Though I have months in chronological order in my data table, the data
were sampled every other month (i.e., February, April, June, August,
October, December), every time I try to plot them (on the x-axis) they are
plotted in alphabetical order. What am I missing?
Cheers
Kurt
***************************************************************
Kurt Lewis Helf, Ph.D.
Ecologist
EEO