search for: month

Displaying 20 results from an estimated 24000 matches for "month".

Did you mean: months
2007 Jun 13
5
Confusion with sapply
Hi, I have some confusion in applying a function over a column. Here's my function. I just need to shift non-March month-ends to March month-ends. Initially I tried seq.dates, but one cannot give a negative increment (decrement) here. return(as.Date(seq.dates(format(xdate,"%m/%d/%Y"),by="months",len=4)[4]) ) Hence this simple function: > mydate <- as.Date("2006-01-01") > &gt...
2010 Mar 26
3
Help with assigning a value based on existing numbers
Hi All I have a column/variable called time difference. It has a whole list of numbers from 0 through to the hundreds eg 236. I want to assign a corresponding "name" to each variable from a predefined list: Month or less, 1 -2 months, 2-3 months etc So the result would look something like: Time Difference Month 1 Month or less 365 1-2 years 52 2-3 months Etc...
2011 Jun 02
2
shading in overlap between two ranges
I have 2 datafiles 'target' and 'observed' as shown below (I will gladly email these 2 small files to whomever). X25. And X75. Indicate the value of 25th and 75th-percentile of the target ('what should be') and the observed ('what is'). The i.value is simply the month. > target X i.value X25. X75. 1 one.month 1 10.845225 17.87237 2 one.month 2 12.235813 19.74490 3 one.month 3 14.611749 23.44810 4 one.month 4 17.529332 28.09647 5 one.month 5 19.458738 30.56936 6 one.month 6 15.264505 28.29333 7 one.m...
2010 Jul 23
1
Error produced by read.zoo: "bad entries"
Hello! I have a data set similar to the data set "monthly" in the example below: monthly<-data.frame(month=c(20090301,20090401,20090501,20100301,20100401,20090301,20090401,20090501,20100301,20100401),monthly.value=c(100,200,300,101,201,10,20,30,11,21),market=c("Market A","Market A", "Market A","Market A",...
2009 Mar 04
10
total per user
so I am trying to sum month over month the amount that a user has posted. So for example: User 1: Jan $3000 Feb $4000 March $1500, etc. I can get this to work if I sum totals (aggregate of all users) but just not by user. Here is my code in the controller: def index @users = User.find :all, :order => ''name...
2010 Oct 13
3
Matrix subscripting to wrap around from end to start of row
Perhaps it is just that I don't even know the correct term to search for, but I can find nothing that explains how to wrap around from the end to a start of a row in a matrix. For example, you have a matrix of 2 years of data, where rows are years, and columns are months. month.data = matrix(c(3,4,6,8,12,90,5,14,22, 8), nrow = 2, ncol=5) I would like to take the average of months 5:1 for each year (for row 1 =12.5). However, I am passing the start month (5) and the end month (1) as variables. I would like to do something like year.avg = apply(month.data[, star...
2012 Dec 17
3
mean of each month in data
...ng the data of only two cities for simplicity but actually, as i wrote, i have 69 cities and the actuall table runs down very deep.) Column 2 represnts the year for which the data is given (Actuall data for each station is of different length but atleast of 24 years). Column 3 and 4 reprent the month and the day of the data. obviously each year has 12 months and each month as different number of days, but to make table easily understable only 3 months and 3 days of each month are considered. febrary for leap years should also be considered. col5 represents population of that city st. year...
2007 Sep 11
2
Function to get a sequence of months
Hi all, I am looking for a function for following calculation. start.month = "July" end.month = "January" months = f(start.month, end.month, by=1) * f is the function that I am looking for. Actually I want to get months = c("July", "August",.............."January") If start.month = 6 and end.month = 1 then I could use...
2009 Jun 02
3
montly mean temp plot
Dear all i got a problem in monthly mean temperature. here i am attaching the data set as well as the plot i got with the following command plot(month,type='n') plot(month,X1999) this command gave the plot where the month names are in alphabetic order, i want the plot in monthly sequence could you please suggest me how can...
2017 Apr 12
3
"table(droplevels(aq)$Month)" in manual page of droplevels
The last line of the example in droplevels' manual page seems to be incorrect to me. I think it should read: "table(droplevels(aq$Month))". Amazingly (I don't understand) both variants seem to produce the same result (R 3.3.3): --- > aq <- transform(airquality, Month = factor(Month, labels = month.abb[5:9])) > aq <- subset(aq, Month != "Jul") > table(aq$Month) May Jun Jul Aug Sep 31 30 0 31...
2010 Apr 12
1
N'th of month working day problem
...09-12-31 10428.05 2010-01-31 10067.33 2010-02-28 10325.26 2010-03-31 10856.63 *2010-04-30 10997.35 * It seems the script "makes up" dates (?) Best, Costas On 09/04/2010 14:55, Gabor Grothendieck wrote: > The function seems to be working properly. You are asking for a day > of the month which does not exist. I assume this was written a very > long time ago since there are easier ways to do this now. yearmon > class gives an object representing the year and month of a date and if > ym is such an object then as.Date(ym) gives the first of the month and > as.Date(ym, fra...
2011 May 27
2
help with barplot
Hi, I'm really struggling with barplot I have a data.frame with 3 columns. The first column represents an "incident" type The second column represents a "month" The third column represents a "time" Code for a sample data.frame incidents <- rep(c('a','b','d','e'), each =25) months <- rep(c(1,2), each =10) times <-rnorm(100) # make my sample data DF <- data.frame(Incidents=as.f...
2013 Jun 15
2
Plotting two y-axis vs non-numeric x-axis
Hi dear all, the following code is correct. but I want to use non-numeric x-axis, for example if I replace time <- seq(0,72,6) by month <- c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Pag") Ofcourse I use factor(month) instead of time; but I didn't get similar plot...
2009 Jun 25
4
Using by() and stacking back sub-data frames to one data frame
...ve been trying to speed up the process using by(), but I got stuck at the point where I want to stack back the sub- data frames, and I was wondering whether someone could help me out. Here is an example: <-- > y <- data.frame(suid = c(rep(1074034,16),rep(1123003,4)), month = rep(c(12,1,2,3),5), esr = c(6,2,2,2,1,1,1,1,2,2,2,2,9,9,9,9,2,2,2,2)) > by(y,y$month,function(x)return(x)) y$month: 1 suid month esr 2 1074034 1 2 6 1074034 1 1 10 1074034 1 2 14 1074034 1 9 18 1123003 1 2 ----------------------------...
2006 Feb 28
5
Getting number of days in a month
In PHP, there was an argument you could pass to the Date function to get the number of days in the current month: echo date("t"); // Outputs "28" for February I don''t see anything like this in Ruby/Rails. Right now, I''m using a very ugly line to pull the last day of the month: @number_of_days = (Date.strptime(Date.today.strftime("%Y-%m-01")) >> 1) -...
2008 Dec 01
3
Failure to subset in R v 2.8.0
Hello, I've been using a pre-release version of R v 2.8.0 for Windows for the last couple months. I think that there have been consistent problems with subsetting data sets, but I had usually been able to find work-arounds or was unable to confirm this as a bug. I think now I have, and would love advice on what to do if I've made some error. The data set in question ("c") has...
2006 Jan 16
8
[newbie] This Month / Next Month / The One After That
What I want to do is simple. I''d like code that prints out the name of this month (January) the next month (February) and the one after that (March) I''ve been able to print this month: <% t = Time.now %> <%= t.strftime(" This Month is: %B") %> But I can''t figure out how to get the next months to print out! -- Posted via http://www.rub...
2005 Oct 11
6
adding 1 month to a date
Within an R dataset, I have a date field called “date_”. (The dates are in the format “YYYY-MM-DD”, e.g. “1995-12-01”.) How can I add or subtract “1 month” from this date, to get “1996-01-01” or “ “1995-11-01”. --------------------------------- [[alternative HTML version deleted]]
2007 May 10
3
Getting the last day of the month.
Hi, Given a date, how do I get the last date of that month? I have data in the form YYYYMM, that I've read as a date using > x$Date <- as.Date(ISOdate(substr(x$YearEnd,1,4),substr(x$YearEnd,5,6),1)) But this gives the first day of the month. To get the last day of the month, I tried > as.Date(as.yearmon(x$Date,frac=0)) But I don't get...
2007 May 08
3
plotting a point graph with data in X-axis
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070508/1c7def0a/attachment.pl