[R] help with stepAIC and boot

2014-03-05 Thread Luca Braglia
Hello everybody. I've a problem with stepAIC inside a boot function (i'm trying to do bootstrap backward elimination, with a statistic function that allow one to specify the formula of a coxph model) For the moment the function would be aimed storing selected vars However I've a problem in the

Re: [R] Building R for better performance

2014-03-05 Thread Simon Zehnder
Jonathan, I myself tried something like this - comparing gcc, clang and intel on a Mac. From my experiences in HPC on the university cluster (where we also use the Xeon Phi, Landeshochleistungscluster University RWTH Aachen), the Intel compiler has better code optimization in regard to

[R] Having a plot with points and line with different colors

2014-03-05 Thread Baro
Hi experts I want to have a plot, which consist of line and points something like this: plot(data, type=o) but I would like that lines and point have different colors. for example line should be blue and points should be black how can I do that in R? [[alternative HTML version

Re: [R] Having a plot with points and line with different colors

2014-03-05 Thread Jim Lemon
On 03/05/2014 08:59 PM, Baro wrote: Hi experts I want to have a plot, which consist of line and points something like this: plot(data, type=o) but I would like that lines and point have different colors. for example line should be blue and points should be black how can I do that in R? Hi

Re: [R] Having a plot with points and line with different colors

2014-03-05 Thread Baro
thanks Jim, could you please show me some example? On Wed, Mar 5, 2014 at 2:02 AM, Jim Lemon j...@bitwrit.com.au wrote: On 03/05/2014 08:59 PM, Baro wrote: Hi experts I want to have a plot, which consist of line and points something like this: plot(data, type=o) but I would like that

Re: [R] Having a plot with points and line with different colors

2014-03-05 Thread Jim Lemon
On 03/05/2014 09:09 PM, Baro wrote: thanks Jim, could you please show me some example? # plot lines, then points plot(1:5,type=l,col=blue) points(1:5,col=black) # plot both, then overplot points plot(1:5,type=o,col=blue) points(1:5,col=black) Jim

Re: [R] Is this a mistake in 'An Introduction to R'?

2014-03-05 Thread peter dalgaard
On 04 Mar 2014, at 21:21 , Geoff Loveman ge...@lovemans.co.uk wrote: In 'An Introduction to R', section 11.7 on nonlinear least squares fitting, the following example is given for obtaining the standard errors of the estimated parameters: To obtain the approximate standard errors (SE)

[R] Sweave: cat() in a chunk with option results=tex doesn't producelinebreaks at the end of a character string anymore

2014-03-05 Thread Gerrit Eichner
Hello, everyone, I am struggling with an Sweave-problem that didn't occur sofar (and I have no clue what I might have changed in my system; see below). The following example *.Rnw file's only task is (for simplicity) to output text with a little bit of TeX-code with linebreaks (e. g., to be

Re: [R] Sweave: cat() in a chunk with option results=tex doesn't producelinebreaks at the end of a character string anymore

2014-03-05 Thread Duncan Murdoch
On 05/03/2014 7:32 AM, Gerrit Eichner wrote: Hello, everyone, I am struggling with an Sweave-problem that didn't occur sofar (and I have no clue what I might have changed in my system; see below). The following example *.Rnw file's only task is (for simplicity) to output text with a little bit

[R] Sampling according to type

2014-03-05 Thread Thomas
I have a matrix where each entry represents a data subject's type, 1 or 0: n - 10 ntype - rbinom(n, 1, 0.5) and I'd like to sample say 3 subjects from ntype where those subjects who are Type 1 are selected with probability say 0.75, and Type 0 with (1-0.75). (So the sample would produce a

Re: [R] Sweave: cat() in a chunk with option results=texdoesn'tproducelinebreaks at the end of a character string anymore

2014-03-05 Thread Gerrit Eichner
Thanks, Duncan, but, sorry, including \SweaveOpts{strip.white=true} doesn't help. Have tried that before and forgot to mention; sorry! BTW: using \SweaveOpts{strip.white=true}, i.e., with quotation marks as requested in RweaveLatex()'s help file, throws out Error in

Re: [R] Sweave: cat() in a chunk with option results=texdoesn'tproducelinebreaks at the end of a character string anymore

2014-03-05 Thread Duncan Murdoch
On 05/03/2014 9:29 AM, Gerrit Eichner wrote: Thanks, Duncan, but, sorry, including \SweaveOpts{strip.white=true} doesn't help. Have tried that before and forgot to mention; sorry! true is the default. You want false. Duncan Murdoch BTW: using \SweaveOpts{strip.white=true}, i.e., with

Re: [R] Sampling according to type

2014-03-05 Thread Suzen, Mehmet
If I understood correctly, you need weighted sampling. Try 'prob' argument from 'sample'. For your example: n - 10 ntype - rbinom(n, 1, 0.5) myProbs - rep(1/10, 10) # equally likely myProbs[ which(ntype == 0)] - 0.75/7 # Divide so the sum will be 1.0 myProbs[ which(ntype == 1)] - 0.25/3

Re: [R] Sampling according to type

2014-03-05 Thread Suzen, Mehmet
myProbs[ which(ntype == 0)] - 0.75/7 # Divide so the sum will be 1.0 myProbs[ which(ntype == 1)] - 0.25/3 Here of course you need to divide by number of 0s and 1s, 7 and 3 were was just an example. __ R-help@r-project.org mailing list

Re: [R] Having a plot with points and line with different colors

2014-03-05 Thread David Carlson
Alternatively use type=c instead of l which will create line breaks where the points will go. plot(1:5,type=c, col=blue) points(1:5,col=black) David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Wednesday, March

Re: [R] Sweave: cat() in a chunk with option results=texdoesn'tproducelinebreaksatthe end of a character string anymore

2014-03-05 Thread Gerrit Eichner
Thanks, Duncan, I got it! I missread/-understood strip.white's meaning and thought it would refer only to blank lines within real code chunks (i.e., to those between \begin{Schunk} and \end{Schunk}), but not to the (TeX-)output which was generated by code chunks with results=tex. My goal: I

Re: [R] Having a plot with points and line with different colors

2014-03-05 Thread Baro
Thanks a lot for your helps On Wed, Mar 5, 2014 at 7:53 AM, David Carlson dcarl...@tamu.edu wrote: Alternatively use type=c instead of l which will create line breaks where the points will go. plot(1:5,type=c, col=blue) points(1:5,col=black) David -Original Message- From:

[R] histograms embedded in a plot (as alternative to jitter)

2014-03-05 Thread Bernard North
Dear R list, I am plotting a discrete valued number on the y axis against a continuous variable on the x axis. To allow sample size to be viewed for the discrete groups I am using vertical jitter. So my code is along the lines of y-rpois(500,2) x-rnorm(500,y,1) plot(x,jitter(y)) It has not

[R] margins and device: different results with pdf() and svg()

2014-03-05 Thread Agustin Lobo
The following works fine with either the plot window or a pdf device: pdf(test.pdf,width=12,height=8) par(mar=c(5,4,4,5)) plot(421:450,1:30,xlim=c(300,1100), ylim=c(0,100), type=l,col=blue,xlab=Wavelength,ylab=Transmittance %) lines(401:1000, (401:1000)/10,col=green) par(new=TRUE) axis(4)

[R] pdf: plotting very small points

2014-03-05 Thread Rebecca.Hiller
Dear all, Ghostscript (version 9.05) cannot open pdfs produced with R (version 3.0.2) that contain very small points in plots. Other pdf readers (evince, AcrobatReader) are able to open the file. If setting cex=0, the pdf is readable again: # does open with gs pdf(cex_small.pdf)

[R] To obtain a graph by geom_bar or other

2014-03-05 Thread Michel ARNAUD
Hi I have the dataframe following : data.frame(Annee =c(rep(2004,200), rep(2005,200)), CiradMed = c(rep(Cirad,100), rep(Med, 100), rep(Cirad,100), rep(Med, 100)) , Type=c(rep(T1, 25), rep(T2, 20), rep(T3, 30), rep(T4, 25), rep(T1, 20), rep(T2, 30), rep(T3, 40), rep(T4, 10), rep(T1, 25), rep(T2,

[R] Script question

2014-03-05 Thread Milton O Faison
I have a script that works fine if I copy the whole thing from from a text editor and paste it into R, but doesn't execute properly if the file is called by the source command. Any clues on how to fix this? I can post the script if necessary. o M. Omar Faison, PhD Director, Office of

Re: [R] pdf: plotting very small points

2014-03-05 Thread Duncan Murdoch
On 05/03/2014 8:34 AM, rebecca.hil...@meteoswiss.ch wrote: Dear all, Ghostscript (version 9.05) cannot open pdfs produced with R (version 3.0.2) that contain very small points in plots. Other pdf readers (evince, AcrobatReader) are able to open the file. If setting cex=0, the pdf is readable

Re: [R] Specifying strip.names in Lattice plots [UPDATE]

2014-03-05 Thread Rich Shepard
On Tue, 4 Mar 2014, Rich Shepard wrote: What I want to learn how to do is either 1) put the ylab in the strip or 2) eliminate the strip as redundant. The latest iteration, and the accompanying warning message: xyplot(cbind(dalles.disch.ts, dalles.temp.ts), main = Columbia River @ The

Re: [R] Specifying strip.names in Lattice plots [SEMI-RESOLVED]

2014-03-05 Thread Rich Shepard
On Wed, 5 Mar 2014, Rich Shepard wrote: 2) eliminate the strip as redundant. Did this. It works. Would like to learn how to use par.strip.text to change the text on each strip, but removing them when redundant works for this figure. Rich __

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread McCloskey, Bryan
Here is some example data (hopefully the monospace formatting is preserved): a b c d e - - - - - 1 | F | T | F | T | F | - - - - - 2 | T | F | T | F | T | - - - - - 3 | T | T | F | F | F | - - - - - 4 | F | T | F | T | F | - - -

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread Bert Gunter
(Mod my ignorance) This appears to be computer science/math problem and has nothing specifically to do with statistics nor R. So I suggest you post on a more appropriate venue rather than here. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not

Re: [R] Shortest connected path in a matrix

2014-03-05 Thread Suzen, Mehmet
You may want to check bioconductor packages doing graph algorithms. Maybe this one: http://www.bioconductor.org/packages/release/bioc/manuals/RBGL/man/RBGL.pdf See for example ?dijkstra.sp On 5 March 2014 18:44, McCloskey, Bryan bmcclos...@usgs.gov wrote: Here is some example data (hopefully

[R] books and datasets

2014-03-05 Thread Carlos Hernandez
Dear R-users, I am looking for books and R examples that focus on the analysis of advertising, marketing, web metrics, and social media datasets. I wonder if you have recommendations for me. Thanks much! [[alternative HTML version deleted]] __

[R] Two maps with different legends with spplot

2014-03-05 Thread Gian
Hi all, I am using spplot to plot two maps in the same device. In my case, I have a map of a certain variable and the same map of the standard deviation of the same variable. The range of the second is much smaller than the range of the first so my wish is to plot both but to have them on

Re: [R] alternative to wireframe()

2014-03-05 Thread MacQueen, Don
Have you looked at persp() ? -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/4/14 2:56 AM, Rainer M Krug rai...@krugs.de wrote: Hi I am slowly getting enough of wireframe() from the package lattice, as it is to

Re: [R] problem with previous code

2014-03-05 Thread Elio Shijaku
Hi Arun, Yes, that last command m1[indx2N] - m2[sort(indx1)] did exactly the trick, now the variable and their values are perfectly matched. Thanks a lot for your great help. Best, Elio On Wed, Mar 5, 2014 at 1:17 AM, arun smartpink...@yahoo.com wrote: Hi Elio, If you change the last

Re: [R] Script question

2014-03-05 Thread MacQueen, Don
You haven't said what, exactly, doesn't execute properly means (please read the posting guide). At a guess, you need to put print() around the expressions whose output you aren't seeing. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550

Re: [R] books and datasets

2014-03-05 Thread Bert Gunter
Google is your friend! Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Wed, Mar 5, 2014 at 10:40 AM, Carlos Hernandez carlos.u...@gmail.comwrote:

Re: [R] histograms embedded in a plot (as alternative to jitter)

2014-03-05 Thread David Carlson
Not histograms, but here are two alternatives. The first gives you kernel density plots for each value and the second uses violin plots. Both plot points if there are fewer than 5. set.seed(42) y-rpois(500,2) x-rnorm(500,y,1) plot(x,y, type=n) for (i in seq(min(y), max(y), by=1)) { if

Re: [R] Specifying strip.names in Lattice plots [UPDATE]

2014-03-05 Thread Duncan Mackay
Hi Rich Without an example it is hard to work out. trellis.par.get(c(... is not correct, see names(trellis.par.get()) try strip= strip.custom(factor.levels = c(string vector of names for each panel), par.strip.text = list(cex = 0.8) ), Duncan Duncan Mackay Department of Agronomy and

[R] Remove lattice panel

2014-03-05 Thread catalin roibu
Dear all, Is there a possibility to remove the panel (with names) from a lattice plot? Thank you very much for your help! --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29

[R] AIX 7.1 and R build problems

2014-03-05 Thread Mike Beddo
Has anyone managed to build R-3.0.2 from source on AIX 7.1 using gcc 4.2.0. The configure script finishes with: ... checking whether wctrans exists and is declared... no checking whether iswblank exists and is declared... no checking whether wctype exists and is declared... no checking whether

Re: [R] Remove lattice panel

2014-03-05 Thread Bert Gunter
I am not sure what you mean by remove (reproducible example??, code??) but see the skip argument of xyplot, which says: skip: A logical vector (default FALSE), replicated to be as long as the number of panels (spanning all pages). For elements that are TRUE, the corresponding panel position is

Re: [R] Remove lattice panel

2014-03-05 Thread Duncan Mackay
Hi If you want to remove a panel with no plots in it see ?lattice::xyplot and look for drop.unused.levels If you want to remove a factor that has plot values in it then the easiest way may be to create a column of the factor and NA the values of the panel, relevel the factor and use the

Re: [R] histograms embedded in a plot (as alternative to jitter)

2014-03-05 Thread Jim Lemon
On 03/06/2014 12:44 AM, Bernard North wrote: Dear R list, I am plotting a discrete valued number on the y axis against a continuous variable on the x axis. To allow sample size to be viewed for the discrete groups I am using vertical jitter. So my code is along the lines of y-rpois(500,2)

[R] ZeligChoice - error

2014-03-05 Thread cauder
Dear R-users, nbsp; On the basis of ZeligChoice Manual I wrote several commands to create a plot of probabilities for a bivariate logit model. However, after sim() command I receive information about non-conformable arguments. Could you interpret the message? R is, as far as I know, the only

[R] Fitting two parameter observations into copulas

2014-03-05 Thread Yang Yang
Hi, I have one set of observations containing two parameters. How to fit it into copula (estimate the parameter of the copula and the margin function)? Let's say the margin distribution are log-normal distributions, and the copula is Gumbel copula. The data is as below: 1 974.0304 1010 2

Re: [R] Is this a mistake in 'An Introduction to R'?

2014-03-05 Thread Geoff Loveman
Peter I see there is no mistake. The phrase about the 'number of parameters' confused me, it is a little ambiguous. Many thanks for taking the time to help me. Geoff On 5 Mar 2014, at 11:20, Peter Dalgaard-2 [via R] ml-node+s789695n4686243...@n4.nabble.com wrote: On 04 Mar 2014, at

Re: [R] Building R for better performance

2014-03-05 Thread Anspach, Jonathan P
Simon, Thanks for the information and links. First of all, did you ever resolve your problem? If not, did you file an issue in Intel Premier Support? That's the best way to bring it to our attention. If you don't want to do that I can try to get a compiler or MKL support engineer to look

Re: [R] Building R for better performance

2014-03-05 Thread ce
Hi Jonathan, I think most people would be interested in such a tool, because main complaint of R is its slowness for some operations and big data. Even thought the intel software is paying , I could install it free since I am not selling any software and work for non-profit. I compiled

[R] Survfit Error

2014-03-05 Thread Lucy Leigh
Hi everyone, I am not new to R, but new to running survival models in R. I am trying to create some basic KM curves, using the following code: library(survival) library(KMsurv) (import data etc - basic right censored, with continuously observed time of death) sleepfit - survfit(Surv(timeb,

Re: [R] AIX 7.1 and R build problems

2014-03-05 Thread Prof Brian Ripley
Such questions belong on R-devel -- see the posting guide. On 05/03/2014 22:28, Mike Beddo wrote: Has anyone managed to build R-3.0.2 from source on AIX 7.1 using gcc 4.2.0. The configure script finishes with: ... checking whether wctrans exists and is declared... no checking whether iswblank