[R] RGL and Windows 7

2010-09-30 Thread Sven Wagner
Hi! For saving 3d plots I make use of the "rgl.snapshot" command provided within the rgl-Package. So far there was no problem using Windows XP, but under Windows 7 the result is a black image, however in the png-format (see attachment http://r.789695.n4.nabble.com/file/n2844487/Koll_perf.png ).

Re: [R] colored rasterImage()

2010-09-30 Thread Michael Sumner
Use the matrix of colours directly: nx <- 100 ny <- 100 m <- matrix(data = rep(seq(0,1, length = nx), ny), ncol = nx, nrow = ny, byrow = TRUE) plot(1:nx, 1:ny, type = "n") my.color <- matrix(data = (rainbow(100))[m*100], ncol = nx, nrow = ny, byrow = TRUE) rasterImage(my.color, 1, 1, nx, ny) Als

Re: [R] interactive session

2010-09-30 Thread Steven McKinney
For those that want it all... > {cat("?"); a<-readLines(n=1) + print("hey") + print(b<-paste("t",a,sep=""))} ?ada [1] "hey" [1] "tada" > b [1] "tada" > Steven McKinney > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Peter

[R] [Help]:How to use "loop" to achieve this aim?

2010-09-30 Thread qcshare
Hello, Everyone, how to use "loop" to make the process automatic and fast? When compute each sample, the script type in R almost the same, just the input and output file's name is changed(chr1 change to chr2, chr3,chr4...). The first sample's script like this: >chr1=MEDIPS.readAlignedSeqences(BSg

[R] Format of Output of Residuals

2010-09-30 Thread Michael Just
An excerpt from dataset ChickWeight:     weight Time Chick Diet 1   42    0 1    1 2   51    2 1    1 3   59    4 1    1 I am interested in the residuals of the dataset.  Specifically in saving them to another format. I have been creating text files with sink. CW.lm <- lm(

Re: [R] Place constrictions on parameters when using Optim and MaxLik

2010-09-30 Thread Ravi Varadhan
There are several options to implement box constraints including "nlminb", "BB", "minqa", "Rcgmin", "Rvmmin". See the "optimx" package which integrates all of these. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division o

Re: [R] Inserting a plot into another

2010-09-30 Thread Filoche
Ty sire. I'll take a look at it. With regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Inserting-a-plot-into-another-tp2720936p2802966.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Scatterplot matrix - Pearson linear correlation and Density Ellipse

2010-09-30 Thread ashz
Hi, I have modified a known script to generate a scatterplot matrix: panel.cor = function(x, y, digits=2, prefix="Rho=", cex.cor) { usr = par("usr"); on.exit(par(usr)) par(usr = c(0, 1, 0, 1)) r = abs(cor(x, y, use="pairwise.complete.obs", method = "pearson")) txt = format(c(r,

[R] Place constrictions on parameters when using Optim and MaxLik

2010-09-30 Thread Sally Luo
Hi R users, I am trying to restrct the range of two of the parameters in a maximization problem. Both parameters should be between -1 and 1. As far as I know, if I choose the estimation method ="L-BFGS-B" under Optim, I can restrict the parameter space. However, the "L-BFGS-B" always require fi

[R] colored rasterImage()

2010-09-30 Thread Ben Tupper
Hello, I have been exploring the possibility to transition some code that currently uses image() to use the new rasterImage(). To date, I haven't been able to specify a color look-up strategy that works. For example... nx <- 100 ny <- 100 m <- matrix(data = rep(seq(0,1, length = nx), ny

[R] Populating values in a PowerPoint table

2010-09-30 Thread Saar Golde
Dear R-help, I managed (thanks to the R2PPT package) to create a PowerPoint presentation and create a table in it but for the life of me I can't find a way to populate the table with values and text. I'm aware of the function 'PPT.AddDataFrame' which creates an Excel object from a data frame, but

Re: [R] time in year, month, day, hour ?

2010-09-30 Thread MacQueen, Don
Here is an example of how I would do it. Just replace my ‘indx’ with the values in your first column. indx <- 1:13 t0 <- as.POSIXct('2009-01-01 00:00') tms <- t0 + (indx -1 )* 3 * 60 * 60 > tms [1] "2009-01-01 00:00:00 PST" "2009-01-01 03:00:00 PST" [3] "2009-01-01 06:00:00 PST" "2009-01-01 0

Re: [R] second element of a list

2010-09-30 Thread Gregory Ryslik
Thank you both for your help! I was interested in how to get at either element specifically. Your solutions work fine though. If I need the first element its lapply(thelist,'[[',1) and if I need the second its lapply(thelist,'[[',1). Thanks again, you just saved me a slow for loop! Kind regards

Re: [R] second element of a list

2010-09-30 Thread Phil Spector
Gregory - I'm confused -- if the first element is the matrix you want, why would you use 2 as an index? Here's a way to get a list with the first elements of each member of a list: lapply(thelist,'[[',1) - Phil Spector

Re: [R] second element of a list

2010-09-30 Thread Greg Snow
Is the matrix the 1st or 2nd? Your description does not seem consistent. Here is one way to grab just the 2nd element from each sublist from a list: lapply( mylist, '[[', 2 ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -

[R] second element of a list

2010-09-30 Thread Gregory Ryslik
Hi, I have a list of of n elements (where n is unknown beforehand). Each element of the list has two subelements. The first is a matrix, the second is a number. I want to make a list of just the matrices. I want to do something like mylists[[ ,2]] but that obviously doesn't work. Is there a si

Re: [R] Sweave and LaTeX beamer class

2010-09-30 Thread Charles C. Berry
On Thu, 30 Sep 2010, Johannes Huesing wrote: I am failing to uncover Sweave chunks step by step using the LaTeX beamer class. The following minimal example: \documentclass{beamer} \usepackage{Sweave} \begin{document} \begin{frame}[fragile] In the year \uncover<2->{25}\uncover<3->{\Sexpr{5*5}}

[R] barplots with 2 different scales

2010-09-30 Thread Jeremy Claisse
Is there a way to create barplots with pairs of bars plotted on 2 different scales (i.e some bars would be plotted according to the scale on the y-axis on the left and other bars plotted according to a different scale on the right axis)? Thank you, Jeremy [[alternative HTML version d

Re: [R] R Code for paper?

2010-09-30 Thread Abhijit Dasgupta, PhD
Reading Gilbert's paper and references, and going on the web, I see that Gilbert provided Fortran source code for his method as well as Tarone's method. It might be possible to wrap this in R On 09/30/2010 06:40 PM, Jim Silverton wrote: Does anyone has the Rcode for Gilbert's 2005 paper on th

Re: [R] R Code for paper?

2010-09-30 Thread Abhijit Dasgupta, PhD
Look at the "qvalue" package by Dabney and Storey, which might satisfy your last query On 09/30/2010 06:40 PM, Jim Silverton wrote: Does anyone has the Rcode for Gilbert's 2005 paper on the discrete FDR and Tarone's 1990 paper? And Storey's pFDR?

Re: [R] R Code for paper?

2010-09-30 Thread Jim Silverton
Does anyone has the Rcode for Gilbert's 2005 paper on the discrete FDR and Tarone's 1990 paper? And Storey's pFDR? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] getting the output after bootstraping

2010-09-30 Thread Dennis Murphy
Hi: To amplify on David's point, the help page of nlsBoot (package nlstools) states that the function returns the following: nlsBoot returns a list of three objects: coefboot contains the bootstrap parameter estimates bootCI contains the bootstrap medians and the bootstrap 95% confidence inter

Re: [R] interactive session

2010-09-30 Thread Phil Spector
If you don't mind the prompt of 1:, I think scan will do what you want: a = scan(n=1,what='',quiet=TRUE);b = paste("t",a,sep=''); 1: ada b [1] "tada" - Phil Spector Statistical Computing Facility

Re: [R] please help me....

2010-09-30 Thread Joshua Wiley
Hi, I am not entirely certain how you think we can help. Many theses/dissertations are not widely published, but there is often a copy stored at the local institution's library. I would also assume that Jan Ulbricht has a copy, which if it is not available online and it is impossible for you to

Re: [R] getting the output after bootstraping

2010-09-30 Thread David Winsemius
Michael Larkin wrote: > > Thanks to the help of people from this forum I was able to bootstrap my > data > and then apply a model to it. Thanks for all your help. > > Everything worked out well, but I am having a difficult time getting the > new > parameter values. I bootstrapped the data 3

Re: [R] Inserting a plot into another

2010-09-30 Thread Greg Snow
Look at the subplot function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Fi

Re: [R] can I add line breaks to the paste() function?

2010-09-30 Thread Jeremy Miles
Try using cat instead. Then "\n" is the new line character. E.g. cat("1st line\n2nd line\n") Jeremy On 30 September 2010 13:30, David LeBauer wrote: > Can I add a line break to the paste() function to return the following: > > 'this is the first line' > 'this is the second line' > > instea

Re: [R] interactive session

2010-09-30 Thread jim holtman
You might want to use the tcltk package so you can bring up a window in which to input your data. This is better than trying to read from the console especially when 'sourcing' in some files or when cutting/pasting. On Thu, Sep 30, 2010 at 2:55 AM, Pam wrote: > Hi guys, > > My concern is to crea

Re: [R] can I add line breaks to the paste() function?

2010-09-30 Thread Erik Iverson
Hello, Although on the surface a simple request, I think you need to be more specific. ?paste returns a character vector. The first question is: do you want a character vector of length 1 or 2? It sounds like you're trying to format text for display on screen or on a graphics device. Perhaps y

Re: [R] interactive session

2010-09-30 Thread Niels Richard Hansen
On 30/09/10 22.23, Peter Dalgaard wrote: On 09/30/2010 03:33 PM, Pam wrote: Thanks Niels but it won't do.. please copy and paste the 2 lines below together to your console in order to see what I mean: cat("?"); a<-readLines(n=1) b<-paste("t",a,sep="") anyone / any idea to overcome this pr

[R] can I add line breaks to the paste() function?

2010-09-30 Thread David LeBauer
Can I add a line break to the paste() function to return the following: 'this is the first line' 'this is the second line' instead of 'this is the first line this is the second line' ? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] interactive session

2010-09-30 Thread Peter Dalgaard
On 09/30/2010 03:33 PM, Pam wrote: > Thanks Niels but it won't do.. please copy and paste the 2 lines below > together > to your console in order to see what I mean: > > cat("?"); a<-readLines(n=1) > b<-paste("t",a,sep="") > > anyone / any idea to overcome this problem? > > Best, > Fatih >

Re: [R] Nested unbalanced regression analysis

2010-09-30 Thread Wil M Contreras Arbaje
Whoa, easy there: members of the list are volunteers, allow some time before expecting a reply... On Sep 30, 2010, at 3:19 PM, Robert Quinn wrote: Hello, I am having a problem figuring out how to model a continuous outcome (y) given a continuous predictor (x1) and two levels of nest

Re: [R] Can this code be written more efficiently?

2010-09-30 Thread jim holtman
Have you tried using Rprof to determine where time is being spent in the current code? Have you looked at how much memory you are using? Are you paging? Have you run with a size 'x', then '2x' then '4x' to see what the growth in both CPU time and memory usage is? This is what I would do if I wer

Re: [R] time in year, month, day, hour ?

2010-09-30 Thread Joshua Wiley
Dear Yogesh, This will create a vector that I believe does what you want. x <- as.POSIXct(x = cumsum(c(0, rep(3*60*60, 1919))), origin = "2009-01-01") Let me see if I can explain the logic. In the innermost part, I multiply 3*60*60, or hours*minutes*seconds. You said they were three hour bloc

Re: [R] Understanding linear contrasts in Anova using R

2010-09-30 Thread Peter Dalgaard
On 09/30/2010 08:31 PM, Max Kuhn wrote: > These two resources might also help: > >http://cran.r-project.org/doc/contrib/Faraway-PRA.pdf >http://cran.r-project.org/web/packages/contrast/vignettes/contrast.pdf > > Max They're a tad long though. Let me try and say it shorter: Contrast calc

Re: [R] more than two NA value names in my data

2010-09-30 Thread Joshua Wiley
Hi, You were on the right track with na.strings, from ?read.table na.strings: a character vector of strings which are to be interpreted as ‘NA’ values. Blank fields are also considered to be missing values in logical, integer, numeric and complex fields. so, you ca

[R] please help me....

2010-09-30 Thread butchman
ㅣ recently used laq packages author of this package is jan Ulbricht.. and I must read jan ulbricht's Ph.D thesis "variable selection in generalized linear models" but I didn't find this thesis on line and there is any method to view this thesis?? If anybody has this thesis file,please send to me..

[R] xyplot - help please

2010-09-30 Thread Santosh
Dear R Gurus! I would like to generate a multi-panel plot with grouped and reference lines in each panel .. Example dataset and code are provide below. Where am I getting wrong in the code below? Any assistance will be highly appreciated. Thanks so much! -Santosh start dataset --- X,l,

[R] time in year, month, day, hour ?

2010-09-30 Thread Yogesh Tiwari
Dear R Users, I did not get any reply on my question so I am re-asking. This time I am giving sample data: 160.3162 -13.5993 -0.4353 46.09380.1877 -0.194E-07 260.3713 -13.5992 -0.4423 46.12410.2057 -0.231E-06 360.3430 -13.5981 -1.6163

[R] polr, lrm - ordinal data

2010-09-30 Thread Chris Mcowen
Dear List, I have developed a model and am looking to predict a response for 1-6 ( it is ordered i.e the difference between level 1 and 2 is the same as between level 2 and 3 etc. I have used the predict function for a polr model (below) and a lrm model, and both give similar results, however

[R] more than two NA value names in my data

2010-09-30 Thread JoonGi
my data(*.txt) has 1000 observations(numbers with no characters) of 5 variables. quite simple. However, NA values are quite tricky. this observer used more than two names for NA values; "." and "na" and more. 1. If I don't want to manipulate this raw data at all, how can I read this table? (

[R] getting just the x or the y coordinate

2010-09-30 Thread G.R.Nobles
I have a data set (from GRASSGIS) I have imported it to R and I can get the coordinates by: xy<-coordinates(data) but I would like to have the x coordinates and y coordinates in separate dataframes x and y, does anyone know how to do this? Thankyou Gary --- Gary R. Nobles

[R] Inserting a plot into another

2010-09-30 Thread Filoche
Hi everyone. I would like to know if it was possible to insert a plot into another one. For example I have a plot and I would like to add a smaller plot in the top right corner. Best regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Inserting-a-plot-into-another-tp27

[R] R 2.11.1 crashes

2010-09-30 Thread Steve Su
Dear R community, I was using R 2.11.1 without internet connection on Windows XP and whenever I type ?mean for example, R would freeze and crash out... Is this something that can be fixed? I would like to use the internel help file if possible... Thanks. ##

[R] Kernel density estimation - problem with matrix created in loop

2010-09-30 Thread Brocker84
Hi you all! I have a very serious problem. What I am going to do is a kernel density estimation (Nadaraya-Watson) but without any helping packages. I want to do it on my own and just use R as a calculator. The problem is that the matrix which I need does not seem to be calculated correctly in m

Re: [R] interactive session

2010-09-30 Thread Pam
Thanks Niels but it won't do.. please copy and paste the 2 lines below together to your console in order to see what I mean: cat("?"); a<-readLines(n=1) b<-paste("t",a,sep="") anyone / any idea to overcome this problem? Best, Fatih Niels wrote: Hi Fatih I believe that readLines(n=1) will

[R] Problem comparing lme objects with anova using do.call

2010-09-30 Thread Michael Hallquist
Hi all, I am running some linear mixed models for longitudinal data using the nlme package. Part of the code I've developed tests for differences among models using the anova function, but I can't simply pass the corresponding lme objects as parameters to the anova function because some of the mod

[R] Sweave and LaTeX beamer class

2010-09-30 Thread Johannes Huesing
I am failing to uncover Sweave chunks step by step using the LaTeX beamer class. The following minimal example: \documentclass{beamer} \usepackage{Sweave} \begin{document} \begin{frame}[fragile] In the year \uncover<2->{25}\uncover<3->{\Sexpr{5*5}} \uncover<4->{ <>= 5*5*101 @ } \end{frame} \

[R] Nested unbalanced regression analysis

2010-09-30 Thread Robert Quinn
Hello, I am having a problem figuring out how to model a continuous outcome (y) given a continuous predictor (x1) and two levels of nested categorical predictors (x3 nested in x2). The data are observational, not from a designed experiment. There are about 15 levels of x2 and between 3 and 14 level

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Berend Hasselman
arindam fadikar wrote: > > > loglik <- function(par) > { > p=par[1] > q=par[2] > r <- 1 - p - q > if (c(p,q,r) > rep(0,3) && c(p,q,r) < rep(1,3) ) > { > -(2 * nO * log (r) + nA * log (p^2 + 2 * p * r) > + nB * log (q^2 + 2 * q * r) >

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Joshua Wiley
On Thu, Sep 30, 2010 at 12:04 PM, arindam fadikar wrote: > thanks Ravi yes , we were getiing the correct results but we thought > there should be a way to avoid those NaN values ... and now we are done > the if condition was written wrongly there ... instead of that if we do > >  p > 0 && q >

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Ravi Varadhan
Here is how you do it: library(BB) Amat <- matrix(c(1,0,0,1,-1,-1), 3, 2, byrow=TRUE) b <- c(0, 0, -1) p0 <- c(0.5, 0.4) spg(p0, lik ( 176,182 , 60 ,17) , project="projectLinear", projectArgs=list(A=Amat, b=b, meq=0)) Hope this helps, Ravi. _

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread arindam fadikar
thanks Ravi yes , we were getiing the correct results but we thought there should be a way to avoid those NaN values ... and now we are done the if condition was written wrongly there ... instead of that if we do p > 0 && q > 0 && r > 0 && p < 1 && q < 1 && r < 1 its perfectly fine .. but i

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Ravi Varadhan
You also need the constrain that par[1] + par[2] < 1 in order to avoid NaNs. You can do this using the `projectLinear' argument in `spg'. library(BB) ?spg Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatri

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Ravi Varadhan
I forgot to mention: You actually got correct results with using optim and `CG'. The warning messages were just telling you that there were some log(negative number) operations during the iterative process. Ravi. Ravi Var

Re: [R] how to avoid NaN in optim()

2010-09-30 Thread Ravi Varadhan
Change the `else NA' to `else Inf' in your loglik function and then run the following: library(BB) p0 <- runif(2) spg(p0, lik (176,182 , 60 ,17) , lower=0, upper=1) This will give you correct results. Ravi. Ravi Varadh

[R] nested unbalanced regression analysis

2010-09-30 Thread Robert Quinn
Hello, I am having a problem figuring out how to model a continuous outcome (y) given a continuous predictor (x1) and two levels of nested categorical predictors (x3 nested in x2). The data are observational, not from a designed experiment. There are about 15 levels of x2 and between 3 and 14 level

[R] (no subject)

2010-09-30 Thread Robert Quinn
Hello, I am having a problem figuring out how to model a continuous outcome (y) given a continuous predictor (x1) and two levels of nested categorical predictors (x3 nested in x2). The data are observational, not from a designed experiment. There are about 15 levels of x2 and between 3 and 14 level

Re: [R] Understanding linear contrasts in Anova using R

2010-09-30 Thread Max Kuhn
These two resources might also help: http://cran.r-project.org/doc/contrib/Faraway-PRA.pdf http://cran.r-project.org/web/packages/contrast/vignettes/contrast.pdf Max On Thu, Sep 30, 2010 at 1:33 PM, Ista Zahn wrote: > Hi Professor Howell, > I think the issue here is simply in the assumpt

[R] how to avoid NaN in optim()

2010-09-30 Thread arindam fadikar
hi , lik <- function(nO, nA, nB, nAB){ loglik <- function(par) { p=par[1] q=par[2] r <- 1 - p - q if (c(p,q,r) > rep(0,3) && c(p,q,r) < rep(1,3) ) { -(2 * nO * log (r) + nA * log (p^2 + 2 * p * r) + nB * log (q^2 + 2 * q * r) +

[R] Can this code be written more efficiently?

2010-09-30 Thread Guelman, Leo
Dear users, I'm working on binary classification problem using Support Vector Machines (SVM). My objective is to train a series of SVM models on a grid of hyperparameters and then select those that maximize the AUC based on an independent validation sample. My attempted code is shown below. It r

Re: [R] Understanding linear contrasts in Anova using R

2010-09-30 Thread Ista Zahn
Hi Professor Howell, I think the issue here is simply in the assumption that the regression coefficients will always be equal to the product of the means and the contrast codes. I tend to think of regression coefficients as the quotient of the covariance of x and y divided by the variance of x, and

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Katharine Mullen
I also cannot reproduce the crash. sessionInfo() R version 2.11.1 (2010-05-31) x86_64-unknown-linux-gnu locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8

Re: [R] cor() alternative for huge data set

2010-09-30 Thread Peter Langfelder
Hi Jyotasana, if I understand your aim correctly, you want to find correlated sets (clusters) of genes, and then find those clusters that are differentially expressed? You can do that with WGCNA, or you can just use the projectiveKMeans for splitting your probes into blocks and then feed each bloc

[R] relevance vector machines for classification

2010-09-30 Thread Keith McMillan
The rvm function from the kernlab package can only be used for regression at the present time. In fact, in the description in the kernlab documentation for the type argument for rvm says, "type rvm can only be used for regression at the moment". Are there any R packages that do classification

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Ravi Varadhan
No. It still does not crash in Windows. > library(rgl) > library(minqa) Loading required package: Rcpp > newuoa(initpar, optimft) Error in newuoa(initpar, optimft) : non-finite x values not allowed in calfun In addition: Warning message: In log(x[4]) : NaNs produced > Ravi.

Re: [R] Polar coordinates - contour plots

2010-09-30 Thread koen
Like Todor I have been trying to make a contour plot using polar coordinates, unfortunately without success. The problem with converting to a cartesian system and plotting using e.g. filled.contour is that this function requires the same amount and value of x values for each y-value and also the d

[R] getting the output after bootstraping

2010-09-30 Thread Michael Larkin
Thanks to the help of people from this forum I was able to bootstrap my data and then apply a model to it. Thanks for all your help. Everything worked out well, but I am having a difficult time getting the new parameter values. I bootstrapped the data 300 times and I want to get the 300 set

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Gaspard Lequeux
Hej, On Thu, 30 Sep 2010, Ravi Varadhan wrote: You data is not good enough for the model that you are trying to fit (or conversely, the model is not appropriate for the data). Yes. I agree. However, this should not cause R to crash. (Around 100.000 models are fitted, and it is not possible

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Gaspard Lequeux
Hej, On Thu, 30 Sep 2010, Ravi Varadhan wrote: I get this on Windows (it does not crash): library(minqa) library(rgl) newuoa(initpar, optimft) Error in newuoa(initpar, optimft) : non-finite x values not allowed in calfun In addition: Warning message: In log(x[4]) : NaNs produced Does it

Re: [R] panel.pairs in splom

2010-09-30 Thread ibrito
Indeed, some commands are missing. Sorry. My function is as follows, panel.cor1 <- function (x, y, digits=2, prefix="") { usr <- par("usr"); on.exit(par(usr)) par(usr = c(0,

Re: [R] panel.pairs in splom

2010-09-30 Thread ibrito
Sorry, I forget to define temp.df <- sapply(1:10, function(i) rnorm(20, 0,1)) Best, Isabel -- View this message in context: http://r.789695.n4.nabble.com/panel-pairs-in-splom-tp2720948p2720968.html Sent from the R help mailing list archive at Nabble.com. _

[R] panel.pairs in splom

2010-09-30 Thread ibrito
Hello, I have a customized pairs () fonction as follows that displays correctely my data. panel.cor1 <- function (x, y, digits=2, prefix="") { usr <- par("usr"); on.exit(par(usr)) par(usr = c(0,

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Ravi Varadhan
You data is not good enough for the model that you are trying to fit (or conversely, the model is not appropriate for the data). Some of the parameters in your model will not be estimable because there is no information in the data. See the following: xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,

Re: [R] AIC for tweedie glm

2010-09-30 Thread eleadbeater
Many thanks! Using a fresh session didn't work, but I upgraded to R.2.11.1 and it runs fine now. bbolker wrote: > > eleadbeater sussex.ac.uk> writes: > >> Dear R-users, >> >> I'm trying to model some data using a tweedie GLM approach. My response >> variable is the number of pupae that are t

Re: [R] Fitting a half-ellipse curve

2010-09-30 Thread Niklaus Hurlimann
Hello Michael, Thanks very much for the hint to my problem this helps really a lot. Cheers Niklaus -- Niklaus Hürlimann Doctorant-PhD Université de Lausanne Institut de Minéralogie et Géochimie L'Anthropole CH-1015 Lausanne Suisse E-mail: niklaus.hurlim...@unil.ch Tel:+41(0)21 692 4452

Re: [R] String split and concatenation

2010-09-30 Thread Gabor Grothendieck
On Wed, Sep 29, 2010 at 4:15 AM, Steven Kang wrote: > x <- rep(letters[1:3], 2) > > Are there any ways to transform & assign the above as the one shown below > to an object? (in exact format; i.e length of 1 & class of character), > i.e >>x > "('a', 'b', 'c', 'a', 'b', 'c')" > > Highly appreciate

[R] polr, lrm - ordinal data

2010-09-30 Thread Chris Mcowen
Dear List, I have developed a model and am looking to predict a response for 1-6 ( it is ordered i.e the difference between level 1 and 2 is the same as between level 2 and 3 etc. I have used the predict function for a polr model (below) and a lrm model, and both give similar results, however

Re: [R] AIC for tweedie glm

2010-09-30 Thread Ben Bolker
eleadbeater sussex.ac.uk> writes: > Dear R-users, > > I'm trying to model some data using a tweedie GLM approach. My response > variable is the number of pupae that are the offspring of a subordinate wasp > on a wasp's nest. However, they're not count data- for each nest, I only > know the mean

Re: [R] Ordered logit with polr won't match SPSS output

2010-09-30 Thread Juliet Hannah
I think the most common reason to see different parameter estimates with ordinal regression is that programs set up the model differently. For example, check out library(MASS) ?polr We see polr uses: logit P(Y <= k | x) = zeta_k - eta and notes that other software packages may use the opposite

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Ravi Varadhan
I get this on Windows (it does not crash): > library(minqa) > library(rgl) > newuoa(initpar, optimft) Error in newuoa(initpar, optimft) : non-finite x values not allowed in calfun In addition: Warning message: In log(x[4]) : NaNs produced > This tells me that you should be constraining your pa

Re: [R] conditional assignment of colors in xyplot()

2010-09-30 Thread nathan pellegrin
Thank you, Deepayan, for the answer - and for creating amazingly helpful tools! Thanks also to Jim Lemon who pointed out a typo in the code: S2 < .025 should read S2 > .025, Nathan On Thu, Sep 30, 2010 at 5:21 AM, Deepayan Sarkar wrote: > On Mon, Sep 27, 2010 at 7:11 AM, nathan pellegrin > wr

[R] AIC for tweedie glm

2010-09-30 Thread eleadbeater
Dear R-users, I'm trying to model some data using a tweedie GLM approach. My response variable is the number of pupae that are the offspring of a subordinate wasp on a wasp's nest. However, they're not count data- for each nest, I only know the mean number of pupae per subordinate, which is conti

Re: [R] R crashes when loading rgl package before minqa package

2010-09-30 Thread Ben Bolker
Gaspard Lequeux biomath.ugent.be> writes: > Calling newuoa (from the minqa package) makes R crash when > the package rgl > is loaded first. This however only on certain selected data. > > The data used for testing (saved to 'bugs.R'): > > xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,16,18,19,21,22,

Re: [R] Opening a .R file with R (Windows)

2010-09-30 Thread Gabor Grothendieck
On Tue, Sep 28, 2010 at 1:11 PM, Kye Gilder wrote: > I am new to using R.  I installed R on my computer (Windows) and everything > things appears to be just fine.  However, I have a simple script RTest.R > that does a few simple calculations.  When I double-click the RTest.R icon, > I get an Infor

Re: [R] Unix batch to different nodes

2010-09-30 Thread Ben Bolker
stephen sefick gmail.com> writes: > > This, I think, all depends on how the server is set up. > > On Thu, Sep 30, 2010 at 1:21 AM, Daisy Englert Duursma > gmail.com> wrote: > > Hello, > > > > I am struggling with computing nodes in Unix. > > > > I have the use of a Unix server that has 30 node

Re: [R] String split and concatenation

2010-09-30 Thread Greg Snow
Steven, I noticed that I hit the send button too early. I answered the question you asked, but probably not the one that you should be asking. Why do you want to do this? It looks suspiciously like you are trying to create code to then evaluate. That is usually like printing a document, sca

Re: [R] What's the meaning of "Species ~ ." in IRIS data

2010-09-30 Thread S Ellison
See ?lm and, more usefully, ?formula >>> Gundala Viswanath 29/09/2010 15:51 >>> I am refering to a function call like this: >data(iris) >x <- svmlight(Species ~ ., data = iris) I tried to see the content of it by typing: > Species ~ . but it gives nothing. How can I see it's content ? - P

Re: [R] how to make list() return a list of *named* elements

2010-09-30 Thread Gabor Grothendieck
On Thu, Sep 30, 2010 at 7:49 AM, Hans Ekbrand wrote: > If I combine elements into a list > > b <- c(22.4, 12.2, 10.9, 8.5, 9.2) > my.c <- sample.int(round(2*mean(b)), 5) > my.list <- list(b, my.c) > > the names of the elements seems to get lost in the process: > >> str(my.list) > List of 2 >  $ :

Re: [R] How to get a proportion of a Vector Member

2010-09-30 Thread Petr PIKAL
Hi or prop.table(table(foo)) Regards Petr r-help-boun...@r-project.org napsal dne 30.09.2010 03:45:30: > On Wed, Sep 29, 2010 at 6:43 PM, Gundala Viswanath wrote: > > I have a vector that looks like this: > > > >> foo > > [1] "o" "o" "o" "x" "o" "o" "o" "o" "o" "x" "x" "o" "x > > > > How can

Re: [R] Opening a .R file with R (Windows)

2010-09-30 Thread Nutter, Benjamin
Here's a thread that has some good discussion on the topic http://r.789695.n4.nabble.com/Running-script-with-double-click-td1579014.html -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Tuesday, September 28, 2010

Re: [R] interactive session

2010-09-30 Thread Niels Richard Hansen
Hi Fatih I believe that readLines(n=1) will do the job. It works fine from the Windows RGui, but I noticed that it hangs my Aquamacs/ESS when R runs from there, and a C-g was needed (which may be completely irrelevant to you). Best, Niels On 30/09/10 08.55, Pam wrote: Hi guys, My concern is

Re: [R] how to make list() return a list of *named* elements

2010-09-30 Thread Henrique Dallazuanna
You should try: eapply(.GlobalEnv, I)[c('b', 'my.c')] On Thu, Sep 30, 2010 at 8:49 AM, Hans Ekbrand wrote: > If I combine elements into a list > > b <- c(22.4, 12.2, 10.9, 8.5, 9.2) > my.c <- sample.int(round(2*mean(b)), 5) > my.list <- list(b, my.c) > > the names of the elements seems to get l

[R] how to make list() return a list of *named* elements

2010-09-30 Thread Hans Ekbrand
If I combine elements into a list b <- c(22.4, 12.2, 10.9, 8.5, 9.2) my.c <- sample.int(round(2*mean(b)), 5) my.list <- list(b, my.c) the names of the elements seems to get lost in the process: > str(my.list) List of 2 $ : num [1:5] 22.4 12.2 10.9 8.5 9.2 $ : int [1:5] 11 8 6 9 20 If I explic

Re: [R] cor() alternative for huge data set

2010-09-30 Thread Jyotasana Gulati
Peter, Many thank for suggesting me this package. I very much believe that this will help me. But I was trying to correlate all probes(correlation between entities not variables) to calculate differentially coexpressed gene sets using package coXpress in R. I could not reduce the number on the b

Re: [R] conditional assignment of colors in xyplot()

2010-09-30 Thread Deepayan Sarkar
On Mon, Sep 27, 2010 at 7:11 AM, nathan pellegrin wrote: > # Dear R Community, > > # I have this data frame: > > df1 <- data.frame( >        F1 = factor( c( rep("D1",12),rep("D2",12),rep("D3",12) ) ), >        F2 = factor( rep( rep( paste("O",1:6,sep=""), rep(2,6) ), 3) ), >        F3 = factor( re

Re: [R] Regular expressions: offsets of groups

2010-09-30 Thread Titus von der Malsburg
Ok, we decided to have a shot at modifying gregexpr. Let's see how it works out. If anybody is interested in discussing this please contact me. R-help doesn't seem like the right place for further discussion. Is there a default place for discussing things like that? Thanks everybody for your re

Re: [R] Unix batch to different nodes

2010-09-30 Thread stephen sefick
This, I think, all depends on how the server is set up. On Thu, Sep 30, 2010 at 1:21 AM, Daisy Englert Duursma wrote: > Hello, > > I am struggling with computing nodes in Unix. > > I have the use of a Unix server that has 30 nodes and I would like to > batch scripts. > > Here is an R example that

Re: [R] Fitting a half-ellipse curve

2010-09-30 Thread Michael Bedward
Hello Niklaus, I'm not sure if the following is the sort of thing you are looking for (?) You can fit an ellipse to your data using a deterministic least squares method. The following is a function that I use to do this... fit.ellipse <- function (x, y = NULL) { # Least squares fitting of an ell

  1   2   >