similar to: cut.Date problem when starting on first day of week (PR#13159)

Displaying 20 results from an estimated 6000 matches similar to: "cut.Date problem when starting on first day of week (PR#13159)"

2008 Oct 11
1
problem with cut.Date/date plotting in ggplot2
I've hit a problem in ggplot2 which I can trace back to cut.Date , which is either a bug or (??) ggplot2 trying to do something it shouldn't with cut.Date (although its use of cut.Date seems OK). Apparently any (?) call of the form cut(as.Date("2008-07-07"),"weeks") where the date *begins the week*, gives the error Error in 1:(1 + max(which(breaks < maxx))) :
2003 Jan 07
2
Extracting means for given strata from dissimilarity object
Is there a way of extracting mean distance or dissimilarity for a given strata from a 'dist' or 'dissimilarity' object, e.g. extract mean distances for each species in Anderson's iris data? data(iris) iris.dist<-dist(iris[,1:4]) then what? Mikkel Grum, PhD Genetic Diversity Scientist International Plant Genetic Resources Institute (IPGRI) Sub-Saharan Africa Group ***
2003 Sep 02
1
Plotting dates
I'm trying to plot observations against observation dates and getting julian dates along the x-axis: library(date) Week<-as.date(c("05/02/03","05/09/03","05/16/03","05/23/03","05/30/03","06/0 7/03","06/14/03")) Leafminers<-c(0,2,5,10,4,6,5) Diglyphus<-c(0,0,4,5,7,3,1) LeafDig<-cbind(Week,Leafminers,Diglyphus)
2002 Jan 08
6
Subsets without NA
Is there a way of removing all rows with missing values from a data frame? I usually use subset(x, var1!="NA") and repeat for each variable. It would be nice to be able to do it in one fell swoop. Also, surprisingly, it doesn't always work. Sometimes I'm left with an empty set even though not all rows have missing values for the variable. Cheers, mikkel Mikkel Grum,
2002 Jan 08
3
colour coding and different point types in a plot
I'm trying to plot four different sorghum types on a plot using a different colour/symbol combination for each sorghum type (TYPBOTA in the script below). What am I doing wrong?: plot(xx$LATITUDE,xx$SFD1, points(xx$SFD1,xx$LATITUDE, col=1:4[codes(xx$TYPBOTA)],pch=c(4,3,1,2)[codes(xx$TYPBOTA)]) grid() I get the following error message Error in 1:4[codes(xx$TYPBOTA)] : NA/NaN argument
2001 Aug 13
3
subset syntax
Can anyone tell me what's wrong with this command?? xx<-subset(x,LOCAL.NAME==c("Chifumbata","Chikota"),select=c(13,16,19,23,26,2 9,30,33:48)) Warning message: longer object length is not a multiple of shorter object length in: LOCAL.NAME == c("Chifumbata", "Chikota") both of the following commands work fine
2006 Jan 27
3
substituting an object not found
Is there any function in R like is.not.found(x, y) meaning if you can't find object x, then use object y?? Mikkel Grum
2017 Nov 14
1
Dates to numeric in for loop
Hi Can anyone explain why a date becomes numeric when you loop over a series of dates? > dt <- Sys.Date() > dt [1] "2017-11-14" > class(dt) [1] "Date" > dts <- dt - 1:0 > class(dts) [1] "Date" > > for (i in dts) { + print(i) + print(class(i)) + print(as.Date(i, "1970-01-01")) + print(class(as.Date(i,
2001 Aug 21
4
looking for a smarter way
I have two problems where I've come up with some code that will do the analysis that I want, but it looks pretty clumsy. In the first case, I calculate the variance on five different columns for each of 14 clusters and get them into one matrix. I get the job done, but I would have thought that it could be done in one or two lines, not six, and be generalized so that it didn't matter how
2006 Jan 02
1
"7:9, 12:14" in dataframe to c(7:9, 12:14)
I want to do something like df[df$b %in% df2[i, 2], ] where df$b is a numeric vector and df2[i, 2] is a factor with levels like "7:9, 12:14". For example: a <- c(paste("A", 1:10, sep = ""), paste("B", 1:10, sep = "")) b <- 1:20 df <- as.data.frame(cbind(a, b)) df$b <- as.numeric(levels(df$b))[as.integer(df$b)] f <-
2001 Aug 09
1
Mixed mode import problem
First question: I have an Excel file with both character and numeric variables that I want to import to a data.frame, so I've saved the data to a tab-delimited text file. read.table : * Won't identify the mode of my character variables, as some of them contain only numbers and none of them are surrounded by quotes, * Won't allow me to specify the mode of my variables, * Doesn't
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
2006 Mar 15
3
"\r" with RSQLite
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") > con <- dbConnect(drv, dbname = "Test")
2002 May 14
0
RE: cut.dendrogram (PR#1552)
>>>>> "MikG" == M GRUM <M.GRUM@CGIAR.ORG> writes: MikG> I'm resending this bug report with a new example. As MikG> seen below, cut.dendrogram gives an error message for MikG> some heights, but not for others and with some MikG> datasets adn not others. I can't see why. MikG> Last time I unwittingly sent my message with
2002 May 15
0
RE: cut.dendrogram (PR#1552)
>>>>> "MM" == Martin Maechler <maechler@stat.math.ethz.ch> writes: >>>>> "MikG" == M GRUM <M.GRUM@CGIAR.ORG> writes: MikG> I'm resending this bug report with a new example. As MikG> seen below, cut.dendrogram gives an error message for MikG> some heights, but not for others and with some MikG> datasets
2002 May 14
0
RE: cut.dendrogram (PR#1552)
I'm resending this bug report with a new example. As seen below, cut.dendrogram gives an error message for some heights, but not for others and with some datasets adn not others. I can't see why. Last time I unwittingly sent my message with HTML formatting. This time I'm travelling and using an e-mail system that I am unfamiliar with. As far as I can see, I am not using HTML.
2006 Feb 05
6
WinRAR.exe errors
I had instaled winrar3.51 and I get this errors: fixme:actctx:CreateActCtxW stub! err:rebar:REBAR_AdjustBands Phase 1 failed, x=692, maxx=-4, start=0, end=0 err:rebar:REBAR_AdjustBands Phase 1 failed, x=692, maxx=-4, start=0, end=0 err:rebar:REBAR_AdjustBands Phase 1 failed, x=40, maxx=-4, start=1, end=1 err:rebar:REBAR_AdjustBands Phase 1 failed, x=692, maxx=-4, start=0, end=0
2007 Dec 30
3
Date formats
Is the following expected behaviour for a date used in an ifelse function? > date <- Sys.Date() > date [1] "2007-12-30" > ifelse(TRUE, date-1, date) [1] 13876 > ifelse(FALSE, date-1, date) [1] 13877 > ifelse(TRUE, as.character(date-1), date) [1] "2007-12-29" > if (TRUE) {date} [1] "2007-12-30" It would seem more natural to me if a date produced
2007 Mar 19
2
Graphic problem
Hello ! I'm a new user of Ubuntu Edgy , but when I try to lauch WINRAR , via the console , I receive that error message : libGL warning: 3D driver claims to not support visual 0x5b libGL warning: 3D driver claims to not support visual 0x5b fixme:shell:SHAutoComplete SHAutoComplete stub err:rebar:REBAR_AdjustBands Phase 1 failed, x=692, maxx=-4, start=0, end=0 err:rebar:REBAR_AdjustBands Phase
2005 May 11
1
Echo from a mail loop in list
Every time I post to the list I get the following response indicating that there is a mail loop. the recipient maxx@digital-system.it has some problems with looping. Hi. This is the qmail-send program at smtp.register.it. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out.