Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-17 Thread Yihui Xie
Bars are corresponding to bins, and the bin-width for lines is 0; please tell me what is the frequency at a fixed point (rather than over an interval)? Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage:

Re: [R] Lattice key title color and trellis par settings

2008-10-17 Thread Meesters, Erik
Thank you all! This is a great course on Lattice par settings (though not answering the question)! And a truly must have: Lattice: Multivariate Data Visualization with R (Use R). Thank you Dr. Sarkar! Here's it all summed up. #Looking at lattice par settings: library(lattice)

[R] Odp: R plot

2008-10-17 Thread Petr PIKAL
Hi AFAIK you need to adjust xlim and ylim in first call of plot as the plot itself is not redrawn but you only add points (or other graphing objects like lines) to existing plot. If you know what you want to plot you can use xlim=range(all.values.you.want.to.plot) for automatic adjustment of

Re: [R] stablefit can fit the parameters of a truncated normal distribution?

2008-10-17 Thread drbn
Thanks John , I did look at this function but seems that only works with censored (not truncated) normal distributions. I know that a straightforward to do it is with fitdistr from MASS package: library(MASS) #fitdistr library(msm) #dtnorm, rtnorm #Generate truncated normal sample

Re: [R] R plot

2008-10-17 Thread Wacek Kusnierczyk
Haoda Fu wrote: All - When I plot something like a-rnorm(5) b-rnorm(5) plot(a,b,col = red) points(10,-10) The last point is missing because it is out of range of the first plot. I just try to switch from Matlab to R. In Matlab, it always can automatic adjust the xlim and ylim for

[R] Analyzing hemispheric photos in R?

2008-10-17 Thread opheliawang
Hi all, The pre-installed Windows Vista 64-bit in my new laptop does not support Gap Light Analyzer. Has anyone used R to analyze hemispheric photos and calculate % canopy openness, LAI, etc.? Which package can be used for that? Thanks a lot! Ophelia

Re: [R] R plot

2008-10-17 Thread Benoit Boulinguiez
Hi, Personally I always use xlim and ylim with the plot or points function like that: plot( X,Y,pch=16,col=2,cex.axis=1.5,cex.lab=1.5, xlim=c(0,1.05*max(X)),ylim=c(0,1.05*max(Y)) ) Regards/Cordialement Benoit Boulinguiez -Message d'origine- De : [EMAIL PROTECTED]

Re: [R] correlation

2008-10-17 Thread Jim Lemon
kdebusk wrote: What test do I use to determine if there is a correlation between a discrete variable and a continuous variable? For example - I have water quality ratings for streams (excellent, good, fair, poor) and a corresponding nitrogen concentration for each rating. I want to know if the

Re: [R] Saving results of Kruskal Walis test

2008-10-17 Thread Himanshu Ardawatia
Thank you Phil, Bernardo and Jorge for all your help. All your suggested options work very well ! Regards Himanshu \\ On Fri, Oct 17, 2008 at 5:01 AM, Bernardo Rangel Tura [EMAIL PROTECTED]wrote: Em Qui, 2008-10-16 às 22:31 +0200, Himanshu Ardawatia escreveu: Hello, I am running

Re: [R] R plot

2008-10-17 Thread Ted Harding
On 17-Oct-08 09:01:08, Benoit Boulinguiez wrote: Hi, Personally I always use xlim and ylim with the plot or points function like that: plot( X,Y,pch=16,col=2,cex.axis=1.5,cex.lab=1.5, xlim=c(0,1.05*max(X)),ylim=c(0,1.05*max(Y)) ) Regards/Cordialement Benoit Boulinguiez I

[R] A covariate correlated with other explanatory variables

2008-10-17 Thread Christoph Scherber
Dear all, I have here a difficult problem: We are currently analysing data from a biodiversity experiment, where the following models are compared using AICc: a) y ~ plant.diversity b) y ~ plant.biomass c) y ~ plant.diversity + plant.biomass The problem now is that plant.diversity and

[R] A question about union

2008-10-17 Thread Leon Yee
Dear all, I have a question about union. union handles two vectors' elements to get their union, but I have many vectors and I want to get the union of all of them. So I wrote a loop: all -c(); for(var in ls(pattern=xyz)) # all of the vectors with pattern of xyz { all - union(all,

Re: [R] A question about union

2008-10-17 Thread Yihui Xie
You need to get() their elements instead of merely using variable names. Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University

Re: [R] R plot

2008-10-17 Thread Wacek Kusnierczyk
it might be that for some purposes non-resizing graphs are useful; perhaps a graphical parameter that would allow the user to specify whether the plot is to be automatically resized or not would be useful, e.g., plot(..., resizable=T) and then points(...) would cause the plot to adapt the

Re: [R] A question about union

2008-10-17 Thread Peter Dalgaard
Leon Yee wrote: Dear all, I have a question about union. union handles two vectors' elements to get their union, but I have many vectors and I want to get the union of all of them. So I wrote a loop: all -c(); for(var in ls(pattern=xyz)) # all of the vectors with pattern of xyz {

Re: [R] A question about union

2008-10-17 Thread Leon Yee
Cool! It works! Thank you very much! Leon Yihui Xie wrote: You need to get() their elements instead of merely using variable names. Regards, Yihui -- Yihui Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School

Re: [R] bivariate uniform density estimation

2008-10-17 Thread Duncan Murdoch
Lavan wrote: Dear R users, I have two uniform random variables and I need to estimate the joint density. I like to know whether there is any package which estimates bivariate uniform densities. There's a package called copula which might do what you want. Duncan Murdoch

Re: [R] Grouped Histogram (colored)

2008-10-17 Thread x0rr0x
first of all: thank you for your replies! hadley wrote: On Thu, Oct 16, 2008 at 11:42 AM, x0rr0x [EMAIL PROTECTED] wrote: Hi all, I'm trying to create a histogram which shows the frequency of variables within a certain timeframe. I've been using SPSS before, but I didn't quite like

Re: [R] A question about union

2008-10-17 Thread Wacek Kusnierczyk
... but it seems to me a better solution to have the vectors you need in a list, and then iterate over the list, rather than have to look the vectors up by name: vectors = list(v1, v2, 1:10, ...) u = NULL for (v in vectors) u = union(u, v) when you use get, you start to explicitly play with

Re: [R] A question about union

2008-10-17 Thread Leon Yee
But the problem is that I have MANY vectors, whose names are of some specific pattern. It is not good for us to write a very long expression. vectors - list(ls(pattern=xyz)) didn't get what I want. Leon Wacek Kusnierczyk wrote: ... but it seems to me a better solution to have the vectors

Re: [R] Suppressing error messages in a for loop

2008-10-17 Thread Helen Greatrex
try() worked perfectly. Thanks! Helen jim holtman wrote: ?try On Thu, Oct 16, 2008 at 4:46 PM, hgreatrex [EMAIL PROTECTED] wrote: Hi, Is there any way that I can supress error messages so that they don't stop for loops running? I'm using the gstat package and have created a

Re: [R] R plot

2008-10-17 Thread hadley wickham
On Fri, Oct 17, 2008 at 4:31 AM, Ted Harding [EMAIL PROTECTED] wrote: On 17-Oct-08 09:01:08, Benoit Boulinguiez wrote: Hi, Personally I always use xlim and ylim with the plot or points function like that: plot( X,Y,pch=16,col=2,cex.axis=1.5,cex.lab=1.5,

Re: [R] A question about union

2008-10-17 Thread Wacek Kusnierczyk
Leon Yee wrote: But the problem is that I have MANY vectors, whose names are of some specific pattern. It is not good for us to write a very long expression. vectors - list(ls(pattern=xyz)) didn't get what I want. then you could mix the two approaches: vectors = lapply(ls(pattern=xyz), get)

[R] Text (eg. summary) to text file, Howto?

2008-10-17 Thread Martin Privat
Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script goes something like this: ... lmMax -

Re: [R] Text (eg. summary) to text file, Howto?

2008-10-17 Thread Peter Dalgaard
Martin Privat wrote: Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script goes something like

Re: [R] Text (eg. summary) to text file, Howto?

2008-10-17 Thread jim holtman
?capture.output ?sink On Fri, Oct 17, 2008 at 8:16 AM, Martin Privat [EMAIL PROTECTED] wrote: Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a

[R] Use of .First() in Mac OS X gui

2008-10-17 Thread Jonsen, Ian
Hi, I am having problems using .First() with the Mac OS X gui version of R 2.7.2 (under OS X 10.5.5); .First is ignored on startup. .First() does work in the command-line version of R under Mac OS X but my specific task requires the gui version. I can find no reference to this issue in the Mac OS

Re: [R] R plot

2008-10-17 Thread Ryan
Use lattice or ggplot __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] wrireframe

2008-10-17 Thread Chibisi Chima-Okereke
Dear all, Does anyone know how to overlay a 3d line on a wireframe plot? I would also like to be able to keep the legend that you get when using the option: drape = TRUE when using the option: shade = TRUE. In addition, I would like to know how to keep the axes while getting rid of the box, I

Re: [R] package Utils Sweave Example Error

2008-10-17 Thread Thompson, David (MNR)
(Question/suggestion inline below) -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: October 16, 2008 02:17 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] package Utils Sweave Example Error On 10/16/2008 12:19 PM, Felipe Carrillo wrote: This is

Re: [R] Use of .First() in Mac OS X gui

2008-10-17 Thread Prof Brian Ripley
On Fri, 17 Oct 2008, Jonsen, Ian wrote: Hi, I am having problems using .First() with the Mac OS X gui version of R 2.7.2 (under OS X 10.5.5); .First is ignored on startup. .First() does work in the command-line version of R under Mac OS X but my specific task requires the gui version. I can

[R] use of empty space in split graph device

2008-10-17 Thread Benoit Boulinguiez
Hi all, I divide the graphical device into 4 ---mfrow=c(2,2)--- to plot 3 boxplots graph. Thus I get an empty space for the fourth graph. I d'like to place a legend in this space. legend() creates a legend in the last graph (the 3rd) I'd like a legend in the empty space. How may I do it?

Re: [R] package Utils Sweave Example Error

2008-10-17 Thread Duncan Murdoch
On 10/17/2008 9:24 AM, Thompson, David (MNR) wrote: (Question/suggestion inline below) -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: October 16, 2008 02:17 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] package Utils Sweave Example Error On

Re: [R] Rpart display

2008-10-17 Thread Terry Therneau
fit - rpart( Are you asking about print(fit), summary(fit), or plot(fit)? Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Rpart display

2008-10-17 Thread Sharma, Dhruv
Plot fit. When I plot fit and I have node splits on lengthy conditions (like State= 1, or State =2 etc is too long and looks ugly). -Original Message- From: Terry Therneau [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2008 10:07 AM To: r-help@r-project.org Cc: Sharma, Dhruv

Re: [R] Use of .First() in Mac OS X gui

2008-10-17 Thread Jonsen, Ian
I am aware .First is a function, that should have been apparent from by my use of .First(). I expect .First to be loaded from .RData as it indeed does exist (as I had confirmed before I posted to R-help). If, after starting R.app, I type .First() the function executes as expected, however I wish

[R] Using key.opts in Ecdf/labcurve (Hmisc package)

2008-10-17 Thread Richard . Cotton
I'm presumably missing something very obvious, but how does one use the key.opts argument in labcurve (via Ecdf)? In this example, I want the key to be big and have a blue background, but it isn't and doesn't. ch - rnorm(1000, 200, 40) sex - factor(sample(c('female','male'), 1000, TRUE))

Re: [R] package Utils Sweave Example Error

2008-10-17 Thread Prof Brian Ripley
The default for this has been changed for R 2.8.0. The fix is also available in 2.7.x: (2.8.0:) o The default for 'stylepath' in Sweave's (default) RweaveLatex driver is now FALSE rather than TRUE if SWEAVE_STYLEPATH_DEFAULT is unset : see ?RweaveLatex. To support

[R] how to list variables enclosed in an environment

2008-10-17 Thread Mark Kimpel
I'm having trouble with a Bioconductor package, an variable expected in an environment does not seem to be there. As part of my investigation of the problem (most likely on my end) I'd like to list the variables contained in an environment. If you have an environment loaded, lets call it pkgEnv',

Re: [R] how to list variables enclosed in an environment

2008-10-17 Thread Mark Kimpel
Never mind, I got the brilliant idea to ls(pkgEnv) and of course it worked. Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129

Re: [R] Loop avoidance in simulating a vector

2008-10-17 Thread Greg Snow
Or you can do it in one line (rnorm is vectorized): DV - rnorm( sum(n), rep(mu, each=n), rep(sigma, each=n) ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] How to save/load RWeka models into/from a file?

2008-10-17 Thread Paulo Cortez
Achim Zeileis wrote: On Thu, 16 Oct 2008, Paulo Cortez wrote: Hi, I want to save a RWeka model into a file, in order to retrive it latter with a load function. See this example: library(RWeka) NB - make_Weka_classifier(weka/classifiers/bayes/NaiveBayes) model-NB(formula,data=data,...) #

Re: [R] padding bug in lattice/levelplot

2008-10-17 Thread Paul Boutros
Thanks for the rapid response Deepayan -- that's what I was looking for. Thanks also for your ongoing support of lattice, it's very much appreciated! Paul Quoting Deepayan Sarkar [EMAIL PROTECTED]: On 10/16/08, Paul Boutros [EMAIL PROTECTED] wrote: Hello, I have encountered some

[R] Package

2008-10-17 Thread Feldman, Ruben
Hi, I was trying to plot the logistic regression from a regression logreg I just ran. I downloaded the car package from the R website and went to Packages - install package from local zip file I checked in my library file and the package is there. I restarted R. I then ran the command:

Re: [R] Using key.opts in Ecdf/labcurve (Hmisc package)

2008-10-17 Thread Frank E Harrell Jr
[EMAIL PROTECTED] wrote: I'm presumably missing something very obvious, but how does one use the key.opts argument in labcurve (via Ecdf)? In this example, I want the key to be big and have a blue background, but it isn't and doesn't. ch - rnorm(1000, 200, 40) sex -

Re: [R] Package

2008-10-17 Thread Jorge Ivan Velez
Dear Ruben, One reason might be that when you restarted R you didn't load again the car package. Try loading it again after you restart R. library(car) ?reg.line reg.line(logreg,col=palette()[2], lwd=2, lty=1) HTH, Jorge On Fri, Oct 17, 2008 at 11:18 AM, Feldman, Ruben [EMAIL PROTECTED]wrote:

Re: [R] A question about union

2008-10-17 Thread Greg Snow
And once you have all your variables of interest in a list, you can avoid the explicit loop by using the Reduce function (which works for cases where you have a function that takes 2 arguments and you want to apply it recursively to more than 2): tmp - list( a=1:10, b=5:15, c=20 ) Reduce(

[R] SVG and user interaction

2008-10-17 Thread Sean Davis
Is there a way to make SVG files containing links (for use in a browser) using any of the R graphics packages or devices? Thanks, Sean __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] use of empty space in split graph device

2008-10-17 Thread Greg Snow
The plot.new function will start a new plot in the next frame, but not plot anything. By default the coordinates go from 0 to 1 in both the x and y directions. Try: par(mfrow=c(2,2)) boxplot(rnorm(100)) boxplot(runif(100)) boxplot(rexp(100, 1/3)) plot.new() legend( 0,1, pch=1:3,

Re: [R] SVG and user interaction

2008-10-17 Thread Greg Snow
There is a package called RSVGTipsDevice who's description mentions hyperlinks. That sounds like a promising place to start. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 -Original Message- From: [EMAIL PROTECTED]

[R] Beginner's question: number formatting

2008-10-17 Thread Michal Figurski
Hello R-helpers, I have a problem with formatting a single number to show leading zeros. For example, I want 2 displayed as 002. My numbers have 1 to 3 digits and I would like them all to display 3 digits for printing. I know I could use paste in a loop with several ifs, but I was wondering

Re: [R] Beginner's question: number formatting

2008-10-17 Thread jim holtman
?sprintf x - c(1,10,11,100) sprintf(%03d, x) [1] 001 010 011 100 On Fri, Oct 17, 2008 at 1:55 PM, Michal Figurski [EMAIL PROTECTED] wrote: Hello R-helpers, I have a problem with formatting a single number to show leading zeros. For example, I want 2 displayed as 002. My numbers have 1

Re: [R] SVG and user interaction

2008-10-17 Thread Sean Davis
On Fri, Oct 17, 2008 at 1:28 PM, Greg Snow [EMAIL PROTECTED] wrote: There is a package called RSVGTipsDevice who's description mentions hyperlinks. That sounds like a promising place to start. Thanks, Greg. That looks pretty close. Sean -Original Message- From: [EMAIL PROTECTED]

Re: [R] Beginner's question: number formatting

2008-10-17 Thread Prof Brian Ripley
sprintf(%03d, 2) formatC(2, width=3, flag=0) both give [1] 002 On Fri, 17 Oct 2008, Michal Figurski wrote: Hello R-helpers, I have a problem with formatting a single number to show leading zeros. For example, I want 2 displayed as 002. I hope you meant that you want 2, not 2, so

Re: [R] Text (eg. summary) to text file, Howto?

2008-10-17 Thread Tom Backer Johnsen
Peter Dalgaard wrote: Martin Privat wrote: Simple question... I would like to dump some summries of lm()'s to small seperate text files. I have looked at: print(), but it don't support output to file cat(), but it claims that 'sum1' is a list write, but that just uses cat()... The script

Re: [R] intermediate linkage clustering

2008-10-17 Thread T.D.Rudolph
Can anyone shed any light on this topic for us? I would like to attempt agglomerative clustering with a contiguity constraint (a.k.a. intermediate linkage clustering), as described by Legendre Legendre (1998, page 697) Is there any code kicking around for this type of analysis specifically?

[R] Function question

2008-10-17 Thread dennis11
Hi, Let's say very simply there is a function: f - function (x) x^2 which is evaluated with : f(2) Now, I want to do the reverse so I want to now x for f(x) = 4 So, is there a way in R to solve x for some function f(x)=a? I hope I explained it clear. cheers, Dennis -- View this message

[R] Plotting 2D Logistic regression

2008-10-17 Thread Feldman, Ruben
Hi, My data has time series for different variables and I want to predict ctw with the value of each other variable at that point in the series. I have run a logistic regression: logreg - glm(ctw ~ age + OFICO + ... + CCombLTV, data=mydata, family=binomial(logit)) And I am trying to get a plot of

Re: [R] Function question

2008-10-17 Thread Dimitris Rizopoulos
try uniroot(), e.g., f - function (x) x^2 uniroot(function(x, a) f(x) - a, c(0, 10), a = 4) I hope it helps. Best, Dimitris dennis11 wrote: Hi, Let's say very simply there is a function: f - function (x) x^2 which is evaluated with : f(2) Now, I want to do the reverse so I want to now

Re: [R] Grouped Histogram (colored)

2008-10-17 Thread x0rr0x
here are two graphs from spss which may help illustrate my needs ;-) http://pics.foruni.de/getimg/balken_time_one_censored.jpg http://pics.foruni.de/getimg/one_time_sample0_censored.jpg thanks a lot for your time and energy! Regards Greg Snow-2 wrote: I don't understand what you want,

Re: [R] function help

2008-10-17 Thread Dimitris Rizopoulos
take a look at ?mapply(); for instance, you can use something like this (untested): dat - Sample(...) mapply(Power, dat$Gmean, dat$Gsd, MoreArgs = list(alfa = 0.05, m1 = 57, s1 = 33, n1 = 200, n2 = 100)) I hope it helps. Best, Dimitris Alex99 wrote: Hi everyone, I have dataset which I

[R] Simple Gantt like chart for numbers rather dates

2008-10-17 Thread Graham Smith
I would like to produce a chart that looks like a Gantt chart (or shingle plot), but instead of tasks you have variable names and instead of start and finish dates you have an upper and lower numeric value. If that makes sense, is there an obvious way of doing this. Thanks, Graham

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-17 Thread jim holtman
?segments segments will draw the lines for you, You can also use 'rect' for rectangles. So the functions are there to draw it, you just have to decide how you want it to look. On Fri, Oct 17, 2008 at 3:22 PM, Graham Smith [EMAIL PROTECTED] wrote: I would like to produce a chart that looks

[R] find bayesian information criterion for all variable combinations

2008-10-17 Thread eric lee
Hi, I have data for one dependent variable and multiple independent variables y = b0 + b1*x1 + b2*x2 + ... I want to a list of all models that have some subset of the independents (just x1 x2, and not x3, etc.) and their corresponding BIC values. Is there a pre-existing function that does this?

Re: [R] function help

2008-10-17 Thread Jorge Ivan Velez
Dear Alex, Try this: # Data name=read.table(textConnection( X8 X9 X10 X102 X110 X177 X283 X284 X286 X292 X297 X306 X308 X314 0 1 000100000000 0 0 001000000010 0 1 0000000

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-17 Thread Gabor Grothendieck
You could consider modifying the code for gantt.chart in plotrix. On Fri, Oct 17, 2008 at 3:22 PM, Graham Smith [EMAIL PROTECTED] wrote: I would like to produce a chart that looks like a Gantt chart (or shingle plot), but instead of tasks you have variable names and instead of start and finish

[R] ggplot2 scale relation free

2008-10-17 Thread stephen sefick
I don't know if there is a way to use the scale relation free argument in ggplot2 like in lattice. I have a feeling that there is not, but I would like to make a plea for this feature. It would be nice to be able to plot Total Inorganic Nitrogen Total Phosphorus and the ratio of the two- the

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-17 Thread Graham Smith
You could consider modifying the code for gantt.chart in plotrix. Not sure that I have the skills, but I was tempted when I found plotrix earlier today, to see if it could be modified someway. Thanks, Graham __ R-help@r-project.org mailing list

Re: [R] Simple Gantt like chart for numbers rather dates

2008-10-17 Thread Graham Smith
Thanks, I will have a look at this. Graham 2008/10/17 jim holtman [EMAIL PROTECTED]: ?segments segments will draw the lines for you, You can also use 'rect' for rectangles. So the functions are there to draw it, you just have to decide how you want it to look. On Fri, Oct 17, 2008 at

[R] Announcement: 2009 ASA Computing/Graphics Student Paper Competition

2008-10-17 Thread J.R. Lockwood
Statistical Computing and Statistical Graphics Sections American Statistical Association Student Paper Competition 2009 The Statistical Computing and Statistical Graphics Sections of the ASA are co-sponsoring a student paper competition on the topics of Statistical Computing and Statistical

Re: [R] find bayesian information criterion for all variabl e combinations

2008-10-17 Thread Ben Bolker
eric lee ericlee100 at gmail.com writes: Hi, I have data for one dependent variable and multiple independent variables y = b0 + b1*x1 + b2*x2 + ... I want to a list of all models that have some subset of the independents (just x1 x2, and not x3, etc.) and their corresponding BIC

[R] using ifelse with surprising results

2008-10-17 Thread Steve_Friedman
Thanks for the gracious assistance in advance I'm working on a non-metric scaling problem and am calculating the distance for input to isoMDS Here is the code library(MASS) vegdata - tapply(Percent, list(PRIMARY_VE, MASTERID), sum) x.mat - matrix(x, nrow=40, ncol=2750, byrow=TRUE, dimnames =

Re: [R] using ifelse with surprising results

2008-10-17 Thread Christos Hatzis
Try the following instead: vegdata.dd[is.na(vegdata.dd)] - 0.01 -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, October 17, 2008 4:50 PM To: [EMAIL PROTECTED] Subject: [R] using ifelse with surprising

Re: [R] Plotting 2D Logistic regression

2008-10-17 Thread Ted Harding
On 17-Oct-08 17:59:55, Feldman, Ruben wrote: Hi, My data has time series for different variables and I want to predict ctw with the value of each other variable at that point in the series. I have run a logistic regression: logreg - glm(ctw ~ age + OFICO + ... + CCombLTV, data=mydata,

Re: [R] ggplot2 scale relation free

2008-10-17 Thread hadley wickham
Oh ok, then that will be definitely in there for the next version (which I'm aiming to release early November) Hadley On Fri, Oct 17, 2008 at 3:24 PM, stephen sefick [EMAIL PROTECTED] wrote: no, no, I want to facet on a variable and then have the plots stacked on top of each other with

Re: [R] using ifelse with surprising results

2008-10-17 Thread hadley wickham
On Fri, Oct 17, 2008 at 3:50 PM, [EMAIL PROTECTED] wrote: Thanks for the gracious assistance in advance I'm working on a non-metric scaling problem and am calculating the distance for input to isoMDS Here is the code library(MASS) vegdata - tapply(Percent, list(PRIMARY_VE, MASTERID),

Re: [R] lattice panel question

2008-10-17 Thread Ferry
Dear Deepayan, Haris, and Baptiste, Thank you !!! Ferry On Tue, Oct 14, 2008 at 10:06 AM, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 10/13/08, Ferry [EMAIL PROTECTED] wrote: Dear R users, How to change lattice panel label/text from the automatically generated label (based on the

Re: [R] ggplot2 scale relation free

2008-10-17 Thread Felipe Carrillo
I'm with Stephen on that one, ggplot2 is one of the greatest graphics package i've ever used. Hadley, you are the man, thanks for providing this great package to the R community. By the way, your website is also nice and very informative. Felipe D. Carrillo Supervisory Fishery Biologist

[R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
hi, here's what i have: \lstset{ basicstyle=\ttfamily, keywordstyle=\bfseries, showstringspaces=false, columns = fullflexible, mathescape = true, language=R } \begin{lstlisting} lst$val-val \end{lstlisting} ./software.tex:16:Extra }, or forgotten \endgroup. lst$ the culprit here is

[R] R script from Python

2008-10-17 Thread Tomislav Puđa
Hi, I'm trying to execute R-script from Python. I'm using R 2.7.2, Python 2.5 and WinXP. I don't won't to use Python/R interface because of nature of project. Python code : import subprocess command = 'c:\\Program Files\\R\\R-2.7.2\\bin\\Rterm.exe --vanilla -q d:\\test\\run\\geneBank.r

Re: [R] function help

2008-10-17 Thread Jorge Ivan Velez
Dear Alex, Just a _minor_ change in the function powers: # powers # n is the number of samples # DATA is the ORIGINAL data set powers=function(n,m2,n2,s2,DATA){ outp=Sample(DATA,n) # DATA was 'name' before, which doesn't make sense mymeans=outp$Gmean mysds=outp$Gsd

Re: [R] draw a 5cm x 3cm rectangle

2008-10-17 Thread Thomas Steiner
Thanks Erik, grid.lines() gives me exactly what I wanted. Have a nice weekend! Thomas library(grid) pdf(rect.pdf, paper=a4r) grid.lines(x=c(1,1,3),c(1,2,2),default.units=cm) grid.lines(x=c(1,1,3)+1,c(1,2,2)+0.5,default.units=cm,gp=gpar(col=blue)) dev.off()

Re: [R] Grouped Histogram (colored)

2008-10-17 Thread Greg Snow
Is this more what you want? g1 - rnorm(100, rep( c(50,100,150), c(25,50,25)), 10 ) g2 - rnorm(135, rep( c(55,95,145), c(30,75,30)), 11 ) g3 - rnorm(90, rep( c(45, 105, 150), c(30,40,20)), 9 ) tmp - c(g1,g2,g3) br - hist(tmp, plot=FALSE)$breaks mydata - list(g1,g2,g3) h - t(sapply( mydata,

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread Greg Snow
The $ is special in TeX/LaTeX as a shortcut for beginning/ending inline math mode, so if you want an actual $ then you need to escape it so that the TeX/LaTeX file has \$ in it. This means that in your R code that generates the file you may need \\$ or in some cases $. Hope this helps,

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
Thanks, but unfortunately \begin{lstlisting} \\$ \end{lstlisting} and \begin{lstlisting} $ \end{lstlisting} still generate the same error. On Fri, Oct 17, 2008 at 9:38 PM, Greg Snow [EMAIL PROTECTED] wrote: The $ is special in TeX/LaTeX as a shortcut for beginning/ending inline math

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread Gabor Grothendieck
Greg was referring to what to write in R character literals in order to generate a single \ in the output from R which in turn would be fed into latex or Sweave and then latex. Google this: special characters in latex On Fri, Oct 17, 2008 at 11:23 PM, erwann rogard [EMAIL PROTECTED] wrote:

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread erwann rogard
Thanks for clarifying. Yes, \$ works in latex, but not *within* the lstlisting environment. On Fri, Oct 17, 2008 at 11:32 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Greg was referring to what to write in R character literals in order to generate a single \ in the output from R which in

Re: [R] Categorial Response Questions

2008-10-17 Thread andyer weng
Hi All, I have a data set containing : pclass: A factor giving the class of the passenger: one of 1st, 2nd, 3rd. age The age of the passenger in years. sex Passenger's gender: female or male age.group Passengers age group, one of 0‐9 , 10‐19, 20‐29, 30‐39, 40‐49, 50‐59, 60‐69, 70‐79 survived

[R] Fwd: Categorial Response Questions

2008-10-17 Thread andyer weng
Sorry Guys, i press the wrong button to send out the uncompleted message. let me do it again. I have a data set containing : pclass: A factor giving the class of the passenger: one of 1st, 2nd, 3rd. age: The age of the passenger in years. sex: Passenger's gender: female or male

[R] Error in solvet: apparently singular matrix

2008-10-17 Thread Gad Abraham
Hi, Again I'm doing logistic regression using lrm from Harrell's Design package, but on wide matrices (28 observations, 1891 variables) so L2 penalisation is used. I get the following error, although I've tried different penalties and different tolerances. The X matrix is scaled and centred.

Re: [R] R-code in Latex --- $ sign causes error

2008-10-17 Thread Henrik Bengtsson
Check out the 'fancyvrb' latex package - that is quite flexible and I wouldn't be surprised if it can help you. Make sure to read the docs (fancyvrb.pdf). /H On Fri, Oct 17, 2008 at 8:37 PM, erwann rogard [EMAIL PROTECTED] wrote: Thanks for clarifying. Yes, \$ works in latex, but not *within*

[R] Fwd: Categorial Response Questions

2008-10-17 Thread andyer weng
further more, my purpose for below questions is to assessthe effect of class, age and sex on the survival. Cheers. -- Forwarded message -- From: andyer weng [EMAIL PROTECTED] Date: 2008/10/18 Subject: Fwd: Categorial Response Questions To: r-help@r-project.org Sorry Guys, i

Re: [R] R script from Python

2008-10-17 Thread Simon Knapp
'Rterm --help' shows the usage as: Rterm [options] [ infile] [outfile] [EnvVars] just in case you didn't understand what the angle brackets meant: the term [ infile] means read input from 'infile', and the term [ outfile] means write output to 'outfile'. Though your code works at the command

Re: [R] R script from Python

2008-10-17 Thread Prof Brian Ripley
This is a python not an R problem. Use of redirection is handled by a shell, not by the executable (usually: it could depend on the compiler). The Windows system and popen commands (and hence R's system()) does not use a shell: POSIX OSes do. It will be cleaner to use Rscript to run

[R] JGR not launch for non-root user

2008-10-17 Thread wing
Hi there, I am a newbie to R and just installed R 2.7.2 and JGR. As root, JGR launch successfully both in R or by a launcher (a script in shell), but it not works for non-root user. What's the cause of this issue? sudo update-java-alternatives -s java-6-sun sudo R CMD javareconf sudo R

[R] Fwd: Categorial Response Questions

2008-10-17 Thread andyer weng
hi all, me again. i try to type the following coding for my question below, but it comes up a error messgae. please advise whether the way i was trying to do will solve my question stated in the previous email. If so , please advise what is wrong with my coding. (p.s. all the data are stored in