Re: [R] Creating an R package in windows- where to put images?

2012-12-09 Thread Subramanian S
Thank you Jeff for that.. Thanks Tyler.. that worked.. i put the image in inst/extdata and then built the pkg..and gave the path using system.file().. thanx again [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https:/

[R] Time Series Prediction using Gaussian Process

2012-12-09 Thread Mohit Dhingra
*Hello All,* I tried figuring out the problem, I was trying to use laplacedot to predict the long term, which however would not do a good job. Then, I tried to do a point by point prediction and building the model again, everytime. It shows me better results. I tried writing my kernel function (m

Re: [R] Creating an R package in windows- where to put images?

2012-12-09 Thread Tyler Rinker
I recently included a .bib file in a package in the directory: package_name/inst/extdata I then recall this file using: <- system.file("extdata/bibTest.bib", package = "metaDAT") I assume something similar could be helpful here. > From: jdnew...@dcn.davis.ca.us > Date: Sun, 9 Dec 2012 22:11

Re: [R] Can I run rscript with php?

2012-12-09 Thread Berend Hasselman
On 10-12-2012, at 00:04, DIMITRIS KARAKOSTIS wrote: > > HiThanks for the answer.My actual problem is that I am trying to execute > rscript through php by using the exec function.I am trying to execute a very > simple Rscript by using PHP and the exec function.When I run the rscript > through

Re: [R] Creating an R package in windows- where to put images?

2012-12-09 Thread Jeff Newmiller
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages Don't get stuck on your idea that the file is a gif... once you load it into memory it is an R object. --- Jeff NewmillerThe

[R] Class definition and "contains": No definition was found for superclass

2012-12-09 Thread Johannes Graumann
Hi, What goes wrong when the following error shows up: > Error in reconcilePropertiesAndPrototype(name, slots, prototype, > superClasses, : > No definition was found for superclass “sequencesuperclass” in the > specification of class “sequences” Has this something to do with recursive class

[R] Creating an R package in windows- where to put images?

2012-12-09 Thread Subramanian S
My R version: 2.15.1- windows While creating an R package in windows, i want to include an image (a .gif image) that will finally be in the package. A function in my package will call the gif image. Where should i put the images before running "Rcmd build mypkg" or "Rcmd INSTALL --build mypkg", so

[R] Long equation in documentation

2012-12-09 Thread Tyler Rinker
I have a long equation that I need to break in the R documentation of a package or it trails off the right hand side of the page. Here's the formula: \deqn{Cov(r_{ist}, r_{iuv})= [.5\rho_{ist}\rho_{iuv}(\rho_{isu}^2 + \rho_{isv}^2 + \rho_{itu}^2 + \rho_{itv}^2) + \rho_{isu}\rho_{itv}+ \rho_{i

[R] Can I run rscript with php?

2012-12-09 Thread DIMITRIS KARAKOSTIS
HiThanks for the answer.My actual problem is that I am trying to execute rscript through php by using the exec function.I am trying to execute a very simple Rscript by using PHP and the exec function.When I run the rscript through terminal (mac osx) then I get the output that I want (a plot).Bu

[R] Error message "cs_lu(A) failed: near-singular A (or out of memory)"

2012-12-09 Thread Rui Neiva
Hi there everyone, I have the following model (this is naturally a simplified version just for showing my problem, in case you're wondering this is a translog cost function with the associated cost share equations): C ~ á + â1 log X + â2 log Y + ã1 log Z + ã2 log XX C1 ~ â1 + â2 log YY + ã1 log Z

Re: [R] Making fifo work (Linux)

2012-12-09 Thread Jeff Newmiller
Your problem seems to be unfamiliarity with this operating-system-specific feature. You should be reading the OS documentation (e.g. "man fifo" and learning how to use the feature in general before using it in R. (Hint: off-topic here.) Some words to the wise: Make sure you test with two proces

[R] Making fifo work (Linux)

2012-12-09 Thread Worik R
Friends I need to get R reading from a fifo. I want it to block till there is some data in the fifo, consume what input it gets there, do some thing with it then loop back and block again. Very simple. Yes? No. The example in the documentation works OK.. zz <- fifo("foo-fifo", "w+")

Re: [R] unrelated to R but possibly interesting

2012-12-09 Thread Jeff Newmiller
Yes, I thought it was good, but for a book on graphics the coin problem was noticeably lacking in clarity. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#.

Re: [R] Some coefficients are doubled when I use the step() function

2012-12-09 Thread Ben Bolker
Chris Beeley gmail.com> writes: > Such a strange problem, can't figure it out at all. Using binomial glm > models, and the step() function, so the call looks like this: > > sectionmodel = glm(formula = Target3 ~ S1Q12_NUM.1 + S1Q9_NUM.1 + S1Q5_NUM.1 + [snip] > But when I run step() on the res

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-09 Thread Brent Caldwell
Dear Professor Carlson Thank you so much! The $Structure command displays the loadings with the same style of column heading as the $scores (i.e. [,1] [,2][,3] [,4][,5] [,6] [,7] [,8] [,9] [,10] [,11]), and makes me so much more c

Re: [R] unrelated to R but possibly interesting

2012-12-09 Thread Jim Lemon
On 12/10/2012 05:52 AM, Mark Leeds wrote: Below has nothing to do with R but people into statistics ( or even those not into statistics. it's very basic ) might find it interesting. I can't say anything about the book itself. http://press.princeton.edu/chapters/s8863.pdf Another brilliant piece

[R] Some coefficients are doubled when I use the step() function

2012-12-09 Thread Chris Beeley
Hello- Such a strange problem, can't figure it out at all. Using binomial glm models, and the step() function, so the call looks like this: sectionmodel = glm(formula = Target3 ~ S1Q12_NUM.1 + S1Q9_NUM.1 + S1Q5_NUM.1 + S1Q7_NUM.1 + S1Q8_NUM.1 + S1Q6_NUM.1 + S1Q10_NUM.1 + S1Q12_BURG.1 + S1

Re: [R] Where is located the rscript in mac osx??

2012-12-09 Thread Berend Hasselman
On 09-12-2012, at 20:36, DIMITRIS KARAKOSTIS wrote: > > > > Dear all, > I have a very simple question. I am trying to find where islocated the > rscript in mac os x. The r is installed in the applications folderbut I can > not find the rscript. Which R do you mean? R.app? There is also a c

[R] Where is located the rscript in mac osx??

2012-12-09 Thread DIMITRIS KARAKOSTIS
Dear all, I have a very simple question. I am trying to find where islocated the rscript in mac os x. The r is installed in the applications folderbut I can not find the rscript. Thank you.Dimitris [[alternative HTML version deleted]] _

Re: [R] turning R expressions into functions?

2012-12-09 Thread Jochen Voß
Dear all, Sorry for my slow answer, and thanks for all the suggestion. On 23 Jul 2012, at 22:25, William Dunlap wrote: > You can use the odd idiom substitute(...()) to get the unevaluated ... > arguments: >> f1 <- function(x, ...) substitute(...()) >> f1(1, warning("Hmm"), stop("Oops"), cat("so

[R] unrelated to R but possibly interesting

2012-12-09 Thread Mark Leeds
Below has nothing to do with R but people into statistics ( or even those not into statistics. it's very basic ) might find it interesting. I can't say anything about the book itself. http://press.princeton.edu/chapters/s8863.pdf [[alternative HTML version deleted]] _

Re: [R] Mean-Centering Question

2012-12-09 Thread David L Carlson
If you are willing to rethink the definition of your special function, the process can be simplified. The function lmc() log-mean centers a single grouped numeric vector. Then sapply() can be used to center a batch of them. > lmc <- function(x, g) unsplit(lapply(split(log(x), g), scale, scale=FALS

Re: [R] about loop, 10 times, 10 matrix

2012-12-09 Thread David Winsemius
On Dec 9, 2012, at 9:06 AM, 歐詠芝 wrote: Dear all: I have simulated ability(500 examinees) and difficulty(40 items). as: N <- 500 theta <- rnorm( N ) I <- 40 b <- seq( -2 , 2 , len=I ) p1 <- plogis( outer( theta, b, "-" ) ) I want to simulate 10 responses matrix through this syntax: respR <- 1

[R] about loop, 10 times, 10 matrix

2012-12-09 Thread 歐詠芝
Dear all: I have simulated ability(500 examinees) and difficulty(40 items). as: N <- 500 theta <- rnorm( N ) I <- 40 b <- seq( -2 , 2 , len=I ) p1 <- plogis( outer( theta, b, "-" ) ) I want to simulate 10 responses matrix through this syntax: respR <- 1 * ( p1 > matrix( runif( N*I ) , nrow=N , nc

Re: [R] Mean-Centering Question

2012-12-09 Thread arun
Hi, You could also use: newFunction1<-function(x) {t(t(log(x))-colMeans(log(x)))}  res1<-by(dat1[c("Units","AveragePrice")],dat1["Location"],newFunction1)  res1 #Location: Los Angeles # Units AveragePrice #1  0.213682659  0.071790268 #2 -0.005370907 -0.072872965 #3 -0.208311751  0.0010826

[R] macosx 10.8 install of rgl

2012-12-09 Thread Greg Minshall
by the, just in case anyone is wondering, on macosx 10.8 with Fink 0.34.4 and r-base215 (et al.), the following caused the R package rgl to build, install, and (seemingly) work: install.packages("rgl", configure.args='--with-gl-libs=/usr/X11/lib \ --disable-cocoa') (without --with-gl-lib

Re: [R] defmacro and bwplot incompatibilities?

2012-12-09 Thread Jeff Newmiller
bwplot is a trellis function. There is something very basic about the way that library works that any intro to trellis/lattice should tell you: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f --

[R] How can I cite the result of a symbolic calculation when defining a function?

2012-12-09 Thread I
For example,> library(orthopolynom)> A<- chebyshev.s.polynomials( 2, normalized=FALSE)and A is a list of the Chebyshev polynomials with degree 0, 1 and 2. I want to define a function s.t.f(x)=T0(x)+T1(x)+2*T2(x)where T0,T1,T2 are the  Chebyshev polynomials with degree 0, 1 and 2, respectively. O

[R] defmacro and bwplot incompatibilities?

2012-12-09 Thread Geoffrey
My macro doesn't work for bwplot. But is working elsewhere. What changes should i make to fix my macro. Thanks. The complete code sample is: library(gtools) library(lattice) pic <- defmacro(fn, plotfunc, expr={png(filename=fn); plotfunc; dev.off()}) # this one fails. pic("bw.png", {bwplot(Speci