similar to: Successive Graphs

Displaying 20 results from an estimated 3000 matches similar to: "Successive Graphs"

2005 Jan 13
4
zero index and lazy evaluation in ifelse()
I don't understand this behavior: > a <- c(0, 1, 2, 3) > b <- c(1, 2, 3, 4) > ifelse (a == 0, 0, b[a]) [1] 0 2 3 1 rather than the desired 0 1 2 3. Thanks for any explanation.
2003 Apr 04
3
creating function bodies using body()
I'm having trouble figuring out how to create a function using "body<-" (). The help file for body() says that the argument should be a list of R expressions. However if I try that I get an error: > tmpfun <- function(a, b=2){} > body(tmpfun) <- list(expression(z <- a + b),expression(z^2)) Error in as.function.default(c(formals(f), value), envir) :
2003 Sep 29
4
Data frame transpose
Hi All, I want to ask if there is a transpose function for data frame like the procedure of transpose in SAS? Because I want to partially transpose a data frame which contains 5 columns (siteid, date, time, obs, mod), what I want to do is to put time as the column variables along with siteid, and date, and put obs and mod in the row names. specifically to transpose a data frame: siteid date
2005 Jul 12
4
Calculation of group summaries
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly straight forward: data(PlantGrowth) attach(PlantGrowth) stack(mean(unstack(PlantGrowth)))
2005 Oct 07
2
Assign references
Folks, I've run into trouble while writing functions that I hope will create and modify a dataframe or two. To that end I've written a toy function that simply sets a couple of variables (well, tries but fails). Searching the archives, Thomas Lumley recently explained the <<- operator, showing that it was necessary for x and y to exist prior to the function call, but I haven't
2002 Aug 29
8
lme() with known level-one variances
Greetings, I have a meta-analysis problem in which I have fixed effects regression coefficients (and estimated standard errors) from identical models fit to different data sets. I would like to use these results to create pooled estimated regression coefficients and estimated standard errors for these pooled coefficients. In particular, I would like to estimate the model \beta_{i} = \mu +
2004 Mar 30
4
rank() vs SAS proc rank
SAS proc rank has ties options of high and low that would allow producing ranks of the type found in the sports pages, e.g., rank (c(1,1,2,2,2,2,3)) == 1 1 3 3 3 3 7 Could R support these ties.methods?
2003 Feb 11
3
Problems with Rcmd check on Win 2000 & rw1062
When I run Rcmd check on a package on my Windows 2000 machine, I get a series of error messages like the following: * checking generic/method consistency ...c:\DOCUME~1\R5018~1.WOO\LOCALS~1\Temp/R utils138414013: cannot open c:DOCUME~1R5018~1.WOOLOCALS~1Temp/Rin138408157: no s uch file It looks as if a Windows style path to the temp directory is not being interpreted correctly, with backslashes
2003 Mar 05
2
reserved words documentation
I wanted a data frame component to be named "next", for example: > m <- data.frame (matrix (0, nrow=2, ncol=2)) > names (m) <- c("prev", "next") > m prev next 1 0 0 2 0 0 But "next" being reserved prevents $ indexing without quotes: > m$next Error: syntax error > m$"next" [1] 0 0 Although they are mostly
2002 Feb 19
2
cdf of the standard normal distribution
Dear Experts, I need to calculate the cdf of the standard normal distribution, i.e. H(x) = 1/sqrt(2*pi) integral(exp(-z^2/2) dz), where z is b/w -infi to infi. I know there should be a way to do it in R, but did not know to do it. I'd appreciate any help you could offer. Charlie Liu Graduate student intern at EPA/ECO
2002 Jan 23
4
driving R from Python (calldll?)
Sam Rushing's Python extension 'calldll' will supposedly give me access to any DLL, and presumably R.DLL in particular, from Python. I have no experience manipulating DLLs as yet. I am learning Python. I can't find any simple step-by-step instructions on how to get done what I want to do. Does anyone have experience with this? Is there a better way? Of course, one can use
2004 Jan 05
3
optim function : "BFGS" vs "L-BFGS-B"
Dear kind R-experts. Does anybody have an experience to use optim function? If yes, what is the main difference between two method "BFGS" vs "L-BFGS-B"? I used "BFGS" method and got what I wanted. But when I used "L-BFGS-B" the error message said that "L-BFGS-B needs finite values of fn". So that means "BFGS" method can handle even if fn
2001 Jul 31
4
nlme: bug in getCovariateFormula (PR#1038)
I found that predict.gnls failed with a wierd error message about a non-numeric argument to a binary vector in one of three nearly identical uses. Error in Inh/Ki : non-numeric argument to binary operator (Inh and Ki are arguments to the function used in the formula for the object whose predictions were requested). It turns out that the problem is in getCovariateFormula(). The final line in
2004 May 19
2
POSIX to ts and back to POSIX
I am trying to use POSIX datetime objects rather than chron datetime objects but am having difficulty with POSIX in a time series. My question: Once a POSIXct vector is bound to a time series, is there a function to convert back to POSIXct? The following code demonstrates what I am trying to do. > ts(as.POSIXct(strptime(tmp,"%m/%d/%Y %H:%M:%S")),freq=1440) Time Series: Start =
2011 Sep 16
3
Help writing basic loop
Hello, I would like to write a loop to 1) run 100 linear regressions, and 2) compile the slopes of all regression into one vector. Sample input data are: y1<-rnorm(100, mean=0.01, sd=0.001) y2<-rnorm(100, mean=0.1, sd=0.01) x<-(c(10,400)) #I have gotten this far with the loop for (i in 1:100) { #create the linear model for each data set model1<-lm(c(y1[i],y2[i])~x)
2007 Aug 22
2
gWidgets (tcltk): problem extracting values from widgets in glayout grid
Hello, I haven't been able to find an example for the second case below -- or perhaps I didn't recognize it when I saw it. Is there a value for x such that svalue(x) will return "bbb", either by itself or as part of an array? Or do I need to do something else entirely? (R2.5.1; Windows XP) > #### gWidgets test > options("guiToolkit"="tcltk") >
2001 Mar 08
2
surprising behavior of match.arg() (PR#872)
If a function needs to be passed as an argument to another function, default arguments to the function being passed are lost. Consider this example: fun1 <- function(x, A=c("power","constant")) { arg <- match.arg(A) cat(paste("A is:",paste(A,collapse=", "),"\narg is:",arg,"\n")) cat("formals:\n") print(formals())
2002 Mar 06
2
Installing a Package in Windows 2000
I'm using R 1.4.1 under Windows 2000 and am experiencing difficulty installing a package. I've included an example output using Rcmd build, but the same problem occurs with Rcmd check and Rcmd INSTALL. The error (make[1]: /bin/sh.exe: Command not found) is not a new one - it's referenced in readme.packages among other locations. I've placed a copy of sh.exe in C:\bin, but it
2001 Dec 13
3
R-1.4.0: how to use getSymbolInfo()?
I have a package that solves systems of ordinary differential equations coded as an R function (odesolve, on CRAN). The function is passed to R code, and c and Fortran code called by it uses lang4() and eval() to evaluate the R function inside a compiled c function to use in a compiled ODE solver. This works quite well, but can be slow. I'd like to be able to supply the name of a compiled
2000 Oct 25
3
.Alias
Probably I've just misread the documentation, but I don't understand the behavior of .Alias. Consider this (on R-1.1.1, both Windows and SGI): > tmp <- matrix(nrow=3,ncol=2) > new <- .Alias(tmp) > new[1,1] <- 1 > tmp [,1] [,2] [1,] NA NA [2,] NA NA [3,] NA NA > new [,1] [,2] [1,] 1 NA [2,] NA NA [3,] NA NA I expected tmp[1,1] to