Displaying 20 results from an estimated 4000 matches similar to: "difference between 2 dates: IN MONTHS the way Mothers compute it"
2009 Nov 02
3
question about difference in date objects
Hi R Community:
I want to take the difference in two dates:
dt2 - dt1.
But, I want the answer in months between those 2 dates.
Can you advise me?
Please respond to: pzs6 at cdc.gov
Thank you!
Phil Smith
Centers for Disease Control and Prevention
2009 Apr 03
1
US county map question
Hi R-help:
I'm just an old guy and new to this list... But have been using R for
years now.
I want to make a map of counties in the US with shaded colors that
depend on the level of variable "Y" that I want to map.
I have the US county and state fips codes and the Y variable.
How do I do this?
Please reply to pzs6@cdc.gov
Thanks,
Phil Smith
pzs6@cdc.gov
[[alternative HTML
2007 Aug 23
1
state map question
Hi R-Help:
I want to produce a map of the US with different colors for selected
states.
I installed the map package, and then used:
library(maps)
I can see that by using
map( 'state' )
you get the state boundaries, also.
How do I fill in different colors for the different states? I see there
is a col parameter for map, but can't see how to get it to work!
Please reply
2007 Feb 22
2
question about boxplot
Here is a question from an old guy:
I want to use the boxplot function as follows:
boxplot( p.prop ~ R + bins )
This command makes nice boxplot for the factor "R" crossed with the factor "bins".
I am having alot of trouble getting control of the labels on the X axis. I want to control it more by specifying what the labels are, controling the 'size' of those
2006 Jun 20
1
Help with dimnames()
Hi R people:
I'm trying to set the dimnames of a data frame called "ests" and am
having trouble!
First, I check to see if "ests" is a data.frame...
> is.data.frame( ests )
[1] TRUE
... and it is a data frame!
Next, I try to assign dimnames to that data frame....
> dimnames( ests )[[ 1 ]] <- as.character( ests$stfips )
Error in
2012 Jun 01
2
Day or Month difference between dates???
HI, R-Users:
I got a questions. have been struggling so long time....
I have this data:
> m1$Year_Month
201009 201010 201011 201101 201102
> min(m1$Year_Month)
201009
I want to calculate the following two answers, how do I program it?
> difference in Month?????
[1] 0 1 2 4 5
>difference in Days?????
0 31 61 ....
Thank you in advance!!!
Tammy
[[alternative
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 Jan 23
1
extract certain months toyears (zoo)
Dear useRs and developeRs,
In my diploma thesis I work with a daily time series of glacier runoff
data.
I did already aggregate them to monthly means etc.
Now i want to use just the summer values (I am indecisive by now what
that means, but let's make it easy and use months like June).
Is there a way to extract the data off this zoo into another zoo with
frequency=1 ?
Do you have
2006 Mar 20
2
Special characters: plus/minus - a method that works
Dear R-people:
François Michonneau's method to obtain the special character plus/minus works on Windows 2000 professional.
Many Thanks to François for his work!
Phil Smith
Centers for Disease Control and Prevention
Atlanta, GA
_____
From: François MICHONNEAU [mailto:francois.michonneau@gmail.com]
Sent: Monday, March 20, 2006 1:58 PM
To: r-help@stat.math.ethz.ch; Smith, Phil
2007 Nov 08
2
centile reference chart / clildren growth chart - what package/method to use
We are constructing growth charts (age/weight and age/length) for children
with diagnosis that impacts weight/length.
But we we don't know how to use R for producing growth charts.
We are collection data of Age, Weight and Length.
The data are used to produce diagnosis-specific Growth charts (like the CDC
Growth Charts:
2010 Mar 03
1
Finding a date 6 months before
Hello everyone
I use zoo objects and I need to find a date 6 months before today's date.
Example, today we have 3rd March 2010, I need to find the date 3rd
September 2009.
How could I do that, please?
Regards,
Sergey
--
Simplicity is the last step of art./Bruce Lee
The more you know, the more you know you don't know.
2010 Jul 12
3
How to create sequence in month
Hi all, can anyone please guide me how to create a sequence of months? Here
I have tried following however couldn't get success
> library(zoo)
> seq(as.yearmon("2010-01-01"), as.yearmon("2010-03-01"), by="1 month")
Error in del/by : non-numeric argument to binary operator
What is the correct way to do that?
Thanks for your time.
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:
2005 Dec 19
3
given a mid-month date, get the month-end date
I have a vector of dates.
I wish to find the month end date for each.
Any suggestions?
e.g.
For 12/15/05, I want 12/31/05,
For 10/15/1995, I want 10/31/1995, etc
__________________________________________________
[[alternative HTML version deleted]]
2010 May 12
2
How to extract sum of particular months in a monthly data series
Dear Users,
I have a monthly data for a number of years(1960-2007) for a number of
stations and i wish to extract sesonal time-series for the months of
March-May and October-November for very station. I have read this data with
read.table in R with stations as columns and time (months) as rows. My
attempt to aggregate with the zoo package using the function as.yearqtr
failed since this sums
2010 Aug 13
3
transforming dates into years
Hello!
If I have in my data frame MyFrame a variable saved as a Date and want
to translate it into years, I currently do it like this using "zoo":
library(zoo)
as.year <- function(x) as.numeric(floor(as.yearmon(x)))
myFrame$year<-as.year(myFrame$date)
Is there a function that would do it directly - like "as.yearmon" -
but for years?
Thank you!
--
Dimitri
2010 Aug 18
1
Controlling the dates in R;
Dear R gurus,
I am currently using the chron package for date manipulation in R and I
am able to control the date which take the format
- 1998/07/03, and
- 2006-09-15 (date without time)
Library(chron)
As.Date(2006-09-15, format = '%Y-%m-%d')
However I have a problem with the date containing only the year and
month (i.e. 2006-09, 2007/08, 200609).
2010 Nov 08
2
finding the last day of the month
Dear R Help,
I am trying to get fields showing the last day of each month for a monthly
closing project. In order to find the last day of the previous month, I
subtract the number of days from the current month. For all months my code
works; however, for October, my code doesn't work...it returns
2010-09-*29* instead
of 2010-09-*30*.
format(strptime("2010-10-31",
2009 Jan 12
3
roll weekly data to monthly level
Dear R users:
I have a data set that looks something like this:
ID time y
1 2/01/2008 4
1 2/09/2008 12
1 9/01/2008 8
2 1/06/2008 3
2 3/01/2008 4
2 3/09/2008 9
2 6/03/2008 4
3 1/02/2008 3
3 1/10/2008 8
3 2/02/2008 7
3 2/10/2008 3
I'd like to sum up the weekly data to the monthly level, so that it looks
something
2007 Jul 03
1
Please help with legend command
Hi R-ers:
I'm drawing a plot and have used different line types (lty) for
different race/ethnicity groups. I want a legend that explains what line
types correspond to the different race/ethnicity groups. I used the
following code:
legend( 1992 , 42 , c("Hispanic" , "non-Hispanic white (NHW)" ,
"non-Hispanic black" , "AI/AN" , "Asian" ) ,