similar to: NextMethod() example from S Programming by Venables and Ripley (page 78)

Displaying 20 results from an estimated 2000 matches similar to: "NextMethod() example from S Programming by Venables and Ripley (page 78)"

2013 Mar 18
4
plotting CIE chromaticity diagram?
Has anyone plotted or is it possible to plot CIE *xy* chromaticity diagram http://en.wikipedia.org/wiki/File:CIE1931xy_blank.svg I need this plot in color. ishida [[alternative HTML version deleted]]
2013 Jun 12
2
grDevices::convertColor XYZ space is it really xyY?
grDevices::convertColor has arguments 'from' and 'to' which can take on value 'XYZ'. Can someone confirm that 'XYZ' is the same as the CIE chromaticity coordinates that are also sometimes refered to as 'xyY' in the literature? Or are these the CIE tristimulus values? It looks to me like the first case is true, but I would appreciate hearing from one of
2009 Dec 08
4
lower.tail option in pnorm
Hi, I would have thought that these two constructions would produce the same result but they do not. Resp <- rbinom(10, 1, 0.5) Stim <- rep(0:1, 5) mm <- model.matrix(~ Stim) Xb <- mm %*% c(0, 1) ifelse(Resp, log(pnorm(Xb)), log(1 - pnorm(Xb))) pnorm(as.vector(Xb), lower.tail = Resp, log.p = TRUE) > ifelse(Resp, log(pnorm(Xb)), log(1 - pnorm(Xb))) [1] -0.6931472 -1.8410216
2013 Oct 21
3
speeding up "sum of squared differences" calculation
All, I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested for loops, but my suspicion is that the calculation could be done even quicker. Please see the code below for a simple example. If anyone can point out a faster way I would appreciate it greatly. Thanks, Roger
2008 Oct 16
1
packages in Depends field and NAMESPACES
Must packages in the Depends field of the DESCRIPTION file have NAMESPACES? I haven't seen this explicitly indicated anywhere. I am writing a small package and find that when I add the abind package to the list of the Depends field, I get an error in R CMD check of the build. * checking package name space information ... OK * checking package dependencies ... ERROR Packages required but not
2010 Feb 11
1
Sweave, lty = 3 line incorect in pdf output
I'm having a problem with dotted lines (lty = 3) in the pdf output in documents generated with Sweave. In the displayed pdf, the dotted line does not show up and in the printed output, it is there but does not seem to respect the lwd argument, for example, it is very faint despite using lwd = 3. The dotted line is correct in a quartz window and if I save the Quartz window to a pdf and
2012 Aug 14
3
self-starter functions for y = a + b * c^x
Hi there are some predefined self-start functions, like SSmicmen, SSbiexp, SSasymp, SSasympOff, SSasympOrig, SSgompertz, SSflp, SSlogis, SSweibull, Quadratic, Qubic, SSexp (nlrwr) Btw, do you know graphic examples for this functions? The SSexpDecay (exponential decay) for y = (y0 - plateau)*exp(-k*x) + plateau from
2011 Feb 18
1
reading a matlab file
Dear R-people, I am trying to read a matlab file, unfortunately without success. I enclosed the zipped file. Do you have an idea how to read this file by ReadMat package into the R system? Thanks for your time! Wim Krijnen
2012 Feb 02
3
How to get intersection of multiple vectors?
v1<-c("a","b","c","d") v2<-c("a","b","e") v3<-c("a","f","g") I want to get the intersection of v1,v2,v3,ie "a" How can I do then? What I know is only for 2 vectors via "intersect" function,but don't know how to deal with multiple vectors. Many thanks
2010 Mar 08
1
MaxDiff Scaling
Dear R List, I have found that R handles a remarkable number of analytic tasks that are overlooked by major commercial packages. However, I have not found an R package that handles MaxDiff Scaling - does one exist? Thanks in Advance, Stephen Brand
2009 Sep 14
3
How to convert numbers to words?
I am trying to convert numbers to English words, e.g. 123 -> One hundred twenty three. After some searching, I have been unable to find any info on this. I could certainly write code to do it, but my question is this: Does anyone know of a function that does this? Thanks, Derek McCrae Norton
2009 Nov 30
2
How do I run to or more R consoles on Mac OS X?
This is really annoying me... when I click R application icon it brings already opened session in the focus and it DOESN'T open new session.... any ideas? -- View this message in context: http://n4.nabble.com/How-do-I-run-to-or-more-R-consoles-on-Mac-OS-X-tp930979p930979.html Sent from the R help mailing list archive at Nabble.com.
2010 Apr 01
1
Stack with factors
Hi R users: I found that I cannot stack() a data.frame with factors. db1<-data.frame(replicate(6,factor(sample(c("A","B"),6,replace=TRUE)))) str(db1) db2<-stack(db1) db2 "db2" does not have any row. How can I stack them by the variables X1,X2,...,X6? Thank you for your help. Kenneth
2010 Sep 30
1
Several Lattice plots in one Plot
Hi all, I've been trying for hours, but I do not find a Solution. I want to plot 12 variables over time in separate diagrams in one plot/window using lattice. Two columns, six rows. I used print with the split command, but the graphics are getting really small. Can someone please help me. Following data example: dta = data.frame( day=c(1,2,3,4,5,6,7),
2011 Jan 06
1
Deselect one of the array's matrix
Hello everyone and season's greetings. I have an array that looks like that R<-c(1,2,3,4,5,6). Is it possible to select all the elements but except one? For example to not select the third element and get back (1,2,4,5,6)? How can I do that? I would like to thank you in advance for your help Best Regards Alex [[alternative HTML version deleted]]
2011 Oct 04
1
Plotting a polygon with xyplot
Dear R helpers I would like to plot a string of points as a polygon in xyplot. I'm a bit lost as to how to get the points plotting in the correct order. I would also like some hints on how to render or fill the polygon. Scrpt below and data file attached Thanks Markm library("lattice") # set size of the window windows(height=7, width=10,rescale=c("fixed"))
2012 Mar 01
2
User defined link function with extra parameters
Hello R users, I would like to fit a generalized linear model for the binomial family with some non standard link functions. For instance, this is the Aranda-Ordaz link: ? = ln( ( (1 - ?)^-? - 1 )/?) I know how to define a new link function to use with glm(), but I my problem is that I have an extra parameter to estimate and I have no clue how to incorporate that. Is there any way to tell
2008 Sep 09
1
puzzle about contrasts
Hi, I'm trying to redefine the contrasts for a linear model. With a 2 level factor, x, with levels A and B, a two level factor outputs A and B - A from an lm fit, say lm(y ~ x). I would like to set the contrasts so that the coefficients output are -0.5 (A + B) and B - A, but I can't get the sign correct for the first coefficient (Intercept). Here is a toy example, set.seed(12161952) y
2010 Mar 14
1
Direction and scaling of cumulative distribution in ecdfplot
I have two questions regarding the ecdfplot function in the latticeExtra package. 1. How can I plot the fraction of values >= x rather than <=x, like the what = "1-F" argument in the Ecdf function in the Hmisc package? 2. When I try to log-transform the y-axis, I get a warning that it can't have log Y-scale, and it fails to scale properly: How can I log-transform the y-axis
2012 Apr 05
3
Apply function to every 'nth' element of a vector
Dear R users, how do I e.g. square each second element of a vector with an even number of elements? Or more generally to apply a function to every 'nth' element of a vector. I looked into the apply functions, but found no hint. For example: v <- c(1, 2, 3, 4) mysquare <- function (x) { return (x*x) } w <- applyfun(v, mysquare, 2) then w should be c(1, 4, 3, 16) Thanks for