Re: [R] ANCOVA for linear regressions without intercept

2011-04-01 Thread Yusuke Fukuda
Thanks Bert. I have read ?formula again and again, and I'm still struggling; lm(body_length ~ head_length-1) This removes intercept from each individual regression (for male, female, unknown). When they are taken together, lm(body_length ~ sex*head_length) This shows differences in slopes

[R] principal components

2011-04-01 Thread nuncio m
HI all, I am trying to compute the EOF of a matrix using prcomp but unable to get the expansion co-efficients. is it possible using prcomp or are there any other methods thanks nuncio -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma

Re: [R] Simple lattice question

2011-04-01 Thread Rubén Roa
-Mensaje original- De: Peter Ehlers [mailto:ehl...@ucalgary.ca] Enviado el: jueves, 31 de marzo de 2011 18:09 Para: Rubén Roa CC: r-help@r-project.org Asunto: Re: [R] Simple lattice question On 2011-03-31 06:58, Rubén Roa wrote: Thanks Peters! Just a few minor glitches now:

Re: [R] Assign Names of columns in data.frame dinamically

2011-04-01 Thread Andreas Borg
Hi Marcos, I'd be glad to help, but your example is not usable for anyone but yourself - I don't have the files that your code reads and I don't have any idea what the resulting data frames look like. Please provide examples of the data and the result. Andreas Marcos Amaris Gonzalez

[R] TV VECM (formerly: VECM with UNRESTRICTED TREND)

2011-04-01 Thread Pfaff, Bernhard Dr.
Dear Renoir, are you referring to: http://econ.la.psu.edu/~hbierens/TVCOINT.PDF ? If so, no, but you could up this framework fairly easily and hereby employ the functions of urca. But this should already be evident from the package's manual. Best, Bernhard -Ursprüngliche

[R] Using a variable in a covariance structure and as a predictor - is this OK?

2011-04-01 Thread Chris Mcowen
Dear list, I have the model below which i am using to account for spatial autocorrelation: exponential -corExp(form = ~ Longitude + Latitude) explanation_mod_all - gls(Lower_PD~Area+Elevation+Temperature+Preceipitation+Agriculture+Urban+Human.footprint+Population, correlation = exponential)

[R] [R-pkgs] pROC 1.4.3: compare two ROC curves in R

2011-04-01 Thread Xavier Robin
Dear R users, pROC is a package to compare, visualize, and smooth receiver operating characteristic (ROC) curves. The package provides the following features: * Partial or full area under the curve (AUC) computation * Comparison of two ROC curves (curves and AUC) * Calculating and plotting

Re: [R] How to update R?

2011-04-01 Thread Kenn Konstabel
On Thu, Mar 31, 2011 at 9:04 PM, Shi, Tao shida...@yahoo.com wrote: This question has been asked by many people already.  The easiest way is: 1) install the new version 2) copy all or the libraries that you installed later from the library folder of older version to the new version 3)

[R] MySql Versus R

2011-04-01 Thread Henri Mone
Dear R Users, I use for my data crunching a combination of MySQL and GNU R. I have to handle huge/ middle seized data which is stored in a MySql database, R executes a SQL command to fetch the data and does the plotting with the build in R plotting functions. The (low level) calculations like

Re: [R] MySql Versus R

2011-04-01 Thread Allan Kamau
On Fri, Apr 1, 2011 at 1:46 PM, Henri Mone henrim...@gmail.com wrote: Dear R Users, I use for my data crunching a combination of MySQL and GNU R. I have to handle huge/ middle seized data which is stored in a MySql database, R executes a SQL command to fetch the data and does the plotting

[R] programming: telling a function where to look for the entered variables

2011-04-01 Thread E Hofstadler
Hi there, Could someone help me with the following programming problem..? I have written a function that works for my intended purpose, but it is quite closely tied to a particular dataframe and the names of the variables in this dataframe. However, I'd like to use the same function for

Re: [R] MySql Versus R

2011-04-01 Thread Prof Brian Ripley
On Fri, 1 Apr 2011, Henri Mone wrote: Dear R Users, I use for my data crunching a combination of MySQL and GNU R. I have to handle huge/ middle seized data which is stored in a MySql database, R executes a SQL command to fetch the data and does the plotting with the build in R plotting

Re: [R] MySql Versus R

2011-04-01 Thread Gabor Grothendieck
On Fri, Apr 1, 2011 at 6:46 AM, Henri Mone henrim...@gmail.com wrote: Dear R Users, I use for my data crunching a combination of MySQL and GNU R. I have to handle huge/ middle seized data which is stored in a MySql database, R executes a SQL command to fetch the data and does the plotting

Re: [R] MySql Versus R

2011-04-01 Thread Barry Rowlingson
On Fri, Apr 1, 2011 at 11:46 AM, Henri Mone henrim...@gmail.com wrote: Dear R Users, I use for my data crunching a combination of MySQL and GNU R. I have to handle huge/ middle seized data which is stored in a MySql database, R executes a SQL command to fetch the data and does the plotting

Re: [R] programming: telling a function where to look for the entered variables

2011-04-01 Thread Nick Sabbe
See the warning in ?subset. Passing the column name of lvar is not the same as passing the 'contextual column' (as I coin it in these circumstances). You can solve it by indeed using [] instead. For my own comfort, here is the relevant line from your original function: Data.tmp - subset(Fulldf,

Re: [R] Cox Proportional Hazards model with a time-varying covariate

2011-04-01 Thread Terry Therneau
The R results I'm getting are similar to the SAS results but not very close. For example, my coefficient for TRT is .2913 in R but SAS gives .3450. I'd like to be able to run the R Code with method = exact to make it as same as the AS example but I can't seem to get it to work You need to

Re: [R] lattice: wireframe eats up points; how to make points on wireframe visible?

2011-04-01 Thread Deepayan Sarkar
On Thu, Mar 31, 2011 at 3:26 AM, Marius Hofert m_hof...@web.de wrote: Dear Deepayan, thanks for answering. It's never too late to be useful. I see your point in the minimal example. I checked the z-axis limits in my original problem for the point to be inside and it wasn't there. I can't

Re: [R] programming: telling a function where to look for the entered variables

2011-04-01 Thread E Hofstadler
Thanks Nick and Juan for your replies. Nick, thanks for pointing out the warning in subset(). I'm not sure though I understand the example you provided -- because despite using subset() rather than bracket notation, the original function (myfunct) does what is expected of it. The problem I have

Re: [R] programming: telling a function where to look for the entered variables

2011-04-01 Thread Nick Sabbe
This should be a version that does what you want. Because you named the variable lvarname, I assumed you were already passing lvar instead of trying to pass lvar (without the quotes), which is in no way a 'name'. myfunct.better - function(subgroup, lvarname, xvarname, yvarname, dataframe) {

Re: [R] Linear Model with curve fitting parameter?

2011-04-01 Thread stephen sefick
Setting Z=Q-A would be the incorrect dimensions. I could Z=Q/A. Is fitting a nls model the same as fitting an ols? These data are hydraulic data from ~47 sites. To access predictive ability I am removing one site fitting a new model and then accessing the fit with a myriad of model assessment

Re: [R] Simple lattice question

2011-04-01 Thread Peter Ehlers
Ruben, One more thing you might try is to add a 'size' component to the lines list. The default is size=5, but since you have enought space in the plot, try size=8 or 9; the line types will show up more clearly: lines=list(pch=1:4, lty=1:4, type='b', size=8), Peter Ehlers

[R] useR! 2011 abstract deadline extended by 2 days

2011-04-01 Thread David Firth
useR! 2011 Conference, University of Warwick, Coventry, UK 16-18 August, 2011 (International R user conference; see http://www.r-project.org/conferences.html for the history.) The abstract submission period for this year's useR! conference, which was due to end today, is *extended* by 2

[R] Syntax coloring in R console

2011-04-01 Thread January Weiner
Dear all, I am a happy user of R console, but I would like to see syntax coloring. I use R 2.12 in Ubuntu Linux. I have found the packages xterm256 and highlight, but I was not able to figure out how to use it to highlight the syntax in console output. Also, I tried several GUI interfaces, but

Re: [R] lattice xscale.components: different ticks on top/bottom axis

2011-04-01 Thread Deepayan Sarkar
On Fri, Mar 11, 2011 at 12:28 AM, boris.vasil...@forces.gc.ca wrote: Good afternoon, I am trying to create a plot where the bottom and top axes have the same scale but different tick marks.  I tried user-defined xscale.component function but it does not produce desired results.  Can anybody

Re: [R] programming: telling a function where to look for the entered variables

2011-04-01 Thread E Hofstadler
2011/4/1 Nick Sabbe nick.sa...@ugent.be: This should be a version that does what you want. Indeed it does, thank you very much! Because you named the variable lvarname, I assumed you were already passing lvar instead of trying to pass lvar (without the quotes), which is in no way a 'name'.

[R] Information theoretic approach in GLS

2011-04-01 Thread Tímea Vincze
Dear R-Users, Am I right if I say that comparisons among gls models with differing fixed effects, but same correlation stuctures, fitted by REML is not meaningful? I need to use ML fit to get comparable AIC, BIC values? And the same is applied to likelihood ratio statistics? I don't really know

[R] guidelines for using the R logo

2011-04-01 Thread Johannes Hain
Hello, I am writing an R-guide which is addressed especially for students of German Universities (http://www.rrzn.uni-hannover.de/buch.html?no_cache=1titel=statistik_r). For the title page, I want to use the R logo. I found a similar question in the R mailing list about the same

Re: [R] Syntax coloring in R console

2011-04-01 Thread Steve_Friedman
RStudio is a new interface. I just started using it and find it very good. You might want to check it out. It does have Ubuntu capabilities, but you have be sure that your graphic drivers are the same as is specified in the RStudio system. Hope this helps Steve Friedman Ph. D. Ecologist /

Re: [R] Syntax coloring in R console

2011-04-01 Thread Liviu Andronic
Hello On Fri, Apr 1, 2011 at 12:32 PM, January Weiner january.wei...@mpiib-berlin.mpg.de wrote: I have found the packages xterm256 and highlight, but I was not able to figure out how to use it to highlight the syntax in console output. I've been in this position before, without finding a

Re: [R] lattice (panel.3dscatter): how to make plot symbol thicker?

2011-04-01 Thread Deepayan Sarkar
On Fri, Mar 11, 2011 at 12:29 PM, Marius Hofert m_hof...@web.de wrote: Dear Deepayan, many thanks for answering. Another thing I am wondering is the following: I know you can have (3d-like) crosses in the wireframe plot. But are there any other 3d-like plot symbols? Of course one can use

[R] controlling the labels width of a barplot

2011-04-01 Thread Samuel Le
Dear all, I am trying the barplot command but some of the labels are disappearing as there is not enough place on the graph to put them all. Here is an example of code that doesn't show all the labels: barplot(sort(runif(9,0,0.2),decreasing=TRUE),xlim=c(0,20),width=2,names.arg=c(first

Re: [R] controlling the labels width of a barplot

2011-04-01 Thread Henrique Dallazuanna
Try the cex.names argument in barplot function. On Fri, Apr 1, 2011 at 10:34 AM, Samuel Le samuel...@srlglobal.com wrote: Dear all, I am trying the barplot command but some of the labels are disappearing as there is not enough place on the graph to put them all. Here is an example of

Re: [R] XYPlot Conditioning Variable in Specific, Non-Alphanumeric Order. -- Resending with corrected .txt file

2011-04-01 Thread Deepayan Sarkar
On Sat, Mar 19, 2011 at 2:53 AM, Guy Jett gj...@itsi.com wrote: Due to an error on my part, I have renamed the previously attached file from  T_5-04b_LTC-SE-SO-Compared.csv to  T_5-04b_LTC-SE-SO-Compared.txt. It remains a comma-delimited file so the extension can be changed and used per the

Re: [R] lattice histogram function and groups

2011-04-01 Thread Deepayan Sarkar
On Sat, Mar 19, 2011 at 6:11 AM, Evans, David G (DFG) david.ev...@alaska.gov wrote: Hi, From the following code (tweaked from another user): variable-sample(rep(1:2,100)) individual-rep(1:3, length(variable)) group-rep(LETTERS[1:2],length(variable)/2)

[R] Large number of Y and X variables

2011-04-01 Thread Rosario Garcia Gil
Hello I have two issues 1. I have a linear model with several thousands of Y and X variables, so if I do not want to write them down one by one in the lm(Y ~ X) model how should I go about it. 2. Also, if I suspect that some of the Y variables could not be independent, what function should I

Re: [R] Syntax coloring in R console

2011-04-01 Thread January Weiner
Recently RStudio was introduced [1] and, although beta, it received quasi-unanimous acclaim from the community, so you risk finding it useful too. Dear Liviu, RStudio might be a fine program, but it does not feature syntax highlighting, which is the only thing I am missing from R Console (it

[R] converting affybatch object to matrix

2011-04-01 Thread Landes, Ezekiel
I have an Affybatch object called batch : batch AffyBatch object size of arrays=1050x1050 features (196 kb) cdf=HuGene-1_0-st-v1 (32321 affyids) number of samples=384 number of genes=32321 annotation=hugene10stv1 notes= Is there a way of converting a portion of this data into a matrix? More

[R] read.table question #only need to change column names

2011-04-01 Thread hongsheng wu
Hi all, I have a huge data set. All I want to do is to change the column names of the it. So if I use read.table, I can read the data in and change colnames and then write back, such as, t - read.table(a.txt, header = T, sep = \t) colnames(t) colnames(t) - c() # new column names

Re: [R] Syntax coloring in R console

2011-04-01 Thread ONKELINX, Thierry
Dear January, Have a look at Eclipse with the STAT-ET plugin http://www.walware.de/goto/statet Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg

[R] Rexcel path problem

2011-04-01 Thread Jorge Nieves
Hi, I am running a test to call an R script with in excel using VBA. My VBA code is shown bellow. The middle section of this mail also includes the content of my Rscript. The bottom part shows the error message form the R console. It seems that Excel is opening the R console without any

Re: [R] Rexcel path problem

2011-04-01 Thread Richard M. Heiberger
Jorge, This looks like an R on Windows problem, it is unrelated to VBA. You have the statement (source('X:\Trading\Energy\JorgeSpace\TMPholder\cpixe\home models\toto.R')) which is invalid R. You need to use either forward slashes or double-back-slashes in R commands. See the R for Windows

Re: [R] Syntax coloring in R console

2011-04-01 Thread Liviu Andronic
On Fri, Apr 1, 2011 at 3:48 PM, January Weiner january.wei...@mpiib-berlin.mpg.de wrote: RStudio might be a fine program, but it does not feature syntax highlighting, which is the only thing I am missing from R Console (it only colors the commands typed). The idea is that you shouldn't use the

Re: [R] Rexcel path problem

2011-04-01 Thread Berend Hasselman
On 01-04-2011, at 16:12, Jorge Nieves wrote: Hi, I am running a test to call an R script with in excel using VBA. My VBA code is shown bellow. The middle section of this mail also includes the content of my Rscript. The bottom part shows the error message form the R console. It

Re: [R] Colour makes my life; but not my bwplot (panel.violin)

2011-04-01 Thread Deepayan Sarkar
On Fri, Mar 25, 2011 at 3:59 PM, JP jeanpaul.ebe...@inhibox.com wrote: Hi there David, Many thanks for your time and reply I created a small test set, and ran your proposed solution... and this is what I get http://i.imgur.com/vlsSQ.png This is not what I want - I want separate grp_1 and

Re: [R] Rexcel path problem

2011-04-01 Thread Jeff Newmiller
Use / instead of \ in the path. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with

Re: [R] Rexcel path problem

2011-04-01 Thread Felipe Carrillo
Jorge: You can run save your scripts in the same folder where your wokbook is and run it like this: Sub Scatter() Call rinterface.StartRServer 'Put the dataframe into R Call rinterface.PutDataframe(scatter, DownRightFrom(Range(RData!A1)), WithRowNames:=False) Call

Re: [R] choosing best 'match' for given factor

2011-04-01 Thread Murali.Menon
Interesting variety of solutions! Thanks very much. Murali -Original Message- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: 31 March 2011 18:26 To: Menon Murali Cc: r-help@r-project.org Subject: Re: [R] choosing best 'match' for given factor Try this: bestMatch -

Re: [R] bwplot [lattice]: how to get different y-axis scales for each row?

2011-04-01 Thread Deepayan Sarkar
On Sun, Mar 27, 2011 at 8:50 PM, Marius Hofert m_hof...@web.de wrote: Dear expeRts, I partially managed to obtain what I wanted by using latticeExtra. However, the following questions remain: 1) why do not all x-axis labels appear? [compare bw and bw2] You have unnecessarily asked for

Re: [R] Plotting symbols and colors based upon data values

2011-04-01 Thread David Winsemius
Thanks to Deepayan for sending me the code for the correct approach using subscripts. On Mar 13, 2011, at 9:46 PM, David Winsemius wrote: On Mar 13, 2011, at 8:51 PM, Mark Linderman wrote: David, thank you for your quick reply. I spent a few minutes getting your command to work with

Re: [R] read.table question #only need to change column names

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 10:00 AM, hongsheng wu wrote: Hi all, I have a huge data set. All I want to do is to change the column names of the it. So if I use read.table, I can read the data in and change colnames and then write back, such as, t - read.table(a.txt, header = T, sep = \t)

Re: [R] Syntax coloring in R console

2011-04-01 Thread Joshua Wiley
Dear January, Have you looked at Emacs + ESS? http://ess.r-project.org/ It highlights in the text editor and the actual R process besides coming with a rich set of features and a mailing list filled with helpful Emacs R users. I've tried several different interfaces and ended up being

[R] a statistical problem - more statistical strategy for making quality control

2011-04-01 Thread Mao Jianfeng
Dear R-listers, I would like to have your helps on make a good strategy of quality control by several quality control variables. This means I need a good strategy to choose cutoff for each quality control variables, or make cutoff for all such quality control variables in one time. For quality

Re: [R] Syntax coloring in R console

2011-04-01 Thread Alexander Engelhardt
Am 01.04.2011 17:02, schrieb Joshua Wiley: Dear January, Have you looked at Emacs + ESS? http://ess.r-project.org/ It highlights in the text editor and the actual R process besides coming with a rich set of features and a mailing list filled with helpful Emacs R users. I've tried several

Re: [R] Connect observed values by a smooth curve, is there any method to get coordinate value of arbitrary point on the curve?

2011-04-01 Thread Zhipeng Wang
Dear Prof. Murdoch and Dr. Winsemius, Thank you very much for your suggestion. They were big help. One of my friends told me another approach by using smooth.spline. Here is the code: x - c(1,2,3,4,5,6) y - c(1,4,9,16,25,36) sp - smooth.spline(x,y) x - seq(1, 6, length=100) pred - predict(sp, x)

[R] regression line on boxplots

2011-04-01 Thread Yan Jiao
Dear R users, I'm trying to add a regression line on my boxplots (something like:boxplot(c(1:3),c(4:6),c(5:8))) But I can't see it. Please help !!! It's not a April fool's joke!!! Yan [[alternative HTML version deleted]] __

[R] Simple AR(2)

2011-04-01 Thread Fabio Ciotola
Hello list, we are beginners in R and we are trying to fit the following time series: * x - c(1.89, 2.46, 3.23, 3.95, 4.56, 5.07, 5.62, 6.16, 6.26, 6.56, 6.98, 7.36, 7.53, 7.84, 8.09)* The reason for choosing the present time series is that the we have previously calculated analytically the

Re: [R] Cox Proportional Hazards model with a time-varying covariate

2011-04-01 Thread Paul Miller
Hi Terry and Kevin,   Thanks for your replies to my post. And thanks particularly to Terry for pointing out my confusion about the exact partial likelihood vs. the exact marginal likelihood. I'm learning and so am likely to be confused about such things from time to time.   I had thought

Re: [R] Syntax coloring in R console

2011-04-01 Thread January Weiner
Dear Liviu, thanks for the programming tip! However, I do all my editing in vim, which has had syntax highlighting for quite a while, as well as auto-completion and a number of other goodies. But while I do most of my programing in vim, I do most of my scientific studies simply using the R

Re: [R] regression line on boxplots

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 11:24 AM, Yan Jiao wrote: boxplot(c(1:3),c(4:6),c(5:8)) df - structure(list(grp = c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3), val = c(1L, 2L, 3L, 4L, 5L, 6L, 5L, 6L, 7L, 8L)), .Names = c(grp, val), row.names = c(NA, -10L), class = data.frame) boxplot(val~grp,data=df)

Re: [R] regression line on boxplots

2011-04-01 Thread Bernd Weiss
Am 01.04.2011 11:24, schrieb Yan Jiao: Dear R users, I'm trying to add a regression line on my boxplots (something like:boxplot(c(1:3),c(4:6),c(5:8))) But I can't see it. Please help !!! It's not a April fool's joke!!! Your sample data does not make any sense (at least to me). I would do it

Re: [R] Syntax coloring in R console

2011-04-01 Thread Bert Gunter
Please move this thread off r-help. It's about Rstudio, not R. -- Bert On Fri, Apr 1, 2011 at 8:05 AM, January Weiner january.wei...@mpiib-berlin.mpg.de wrote: Dear Liviu, thanks for the programming tip! However, I do all my editing in vim, which has had syntax highlighting for quite a

Re: [R] Syntax coloring in R console

2011-04-01 Thread Liviu Andronic
On Fri, Apr 1, 2011 at 5:05 PM, January Weiner january.wei...@mpiib-berlin.mpg.de wrote: Dear Liviu, thanks for the programming tip! However, I do all my editing in vim, which has had syntax highlighting for quite a while, as well as auto-completion and a number of other goodies. But while I

Re: [R] ANCOVA for linear regressions without intercept

2011-04-01 Thread Peter Ehlers
See inline. On 2011-03-31 22:22, Yusuke Fukuda wrote: Thanks Bert. I have read ?formula again and again, and I'm still struggling; lm(body_length ~ head_length-1) This removes intercept from each individual regression (for male, female, unknown). When they are taken together,

Re: [R] Linear Model with curve fitting parameter?

2011-04-01 Thread Peter Ehlers
On 2011-04-01 05:44, stephen sefick wrote: Setting Z=Q-A would be the incorrect dimensions. I could Z=Q/A. Is fitting a nls model the same as fitting an ols? These data are hydraulic data from ~47 sites. To access predictive ability I am removing one site fitting a new model and then

[R] R/Finance 2011 Conference Agenda

2011-04-01 Thread Jeff Ryan
R community: We're excited to post a preliminary agenda for the upcoming 3rd conference on R and Applied Finance, to be held in Chicago on April 29th and 30th. In addition to keynotes from John Bollinger, Mebane Faber, Stefano Iacus and Louis Kates, we are excited to have 31 additional talks

[R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread Marius Hofert
Dear expeRts, I know I can't paste expressions in the normal way, but I just couldn't figure out how to get the following (I want to paste a character vector to an expression vector) right with bquote() or substitute. vec1 - c(a, expression(tilde(b)), c) vec2 - c(1, 2, 3) main -

Re: [R] regular expression

2011-04-01 Thread array chip
Great. thank you Bernd! Learned a new thing here. John From: Bernd Weiss bernd.we...@uni-koeln.de Cc: r-help@r-project.org Sent: Thu, March 31, 2011 6:19:25 PM Subject: Re: [R] regular expression Am 31.03.2011 21:06, schrieb array chip: Ok then this code

Re: [R] regular expression

2011-04-01 Thread Henrique Dallazuanna
Try this also: grep(arg, arg.symptom, value = TRUE, invert = TRUE) character(0) grep(arg, liver.symptom, value = TRUE, invert = TRUE) [1] liver.symptom On Fri, Apr 1, 2011 at 1:33 PM, array chip arrayprof...@yahoo.com wrote: Great. thank you Bernd! Learned a new thing here. John

[R] Fisher's test

2011-04-01 Thread Jim Silverton
I have a matrix with 2 columns and I want to do fishers exact test for these with the totals for each row being 100 say. The data has the form: 23 12 32 21 12 2 and these represents the tables: 23 12 77 88 32 21 78 79 12 2 88 98 How do I use apply to speed up aclculation of the

[R] mean in the boxplot

2011-04-01 Thread Yan Jiao
Dear R users, How to show mean in the boxplot instead of median ? Many thanks Yan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 12:32 PM, Marius Hofert wrote: Dear expeRts, I know I can't paste expressions in the normal way, but I just couldn't figure out how to get the following (I want to paste a character vector to an expression vector) right with bquote() or substitute. vec1 - c(a,

Re: [R] mean in the boxplot

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 1:20 PM, Yan Jiao wrote: Dear R users, How to show mean in the boxplot instead of median ? Read ... help(boxplot) Use boxplot to create a set of values, substitute th emean for the groups then pass the mangled set of values to bxp(). -- David Winsemius, MD West

Re: [R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread Marius Hofert
Dear David, thanks for your reply. The paste() meant to paste the vectors vec1 and vec2 together, so main should be a vector of length 3 of the form a 1, b 2, c 3 # with b being tilde(b) However, with c() it is a vector of length 6: expression(a, tilde(b), c, 1, 2, 3) Do you know a solution for

Re: [R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 1:56 PM, Marius Hofert wrote: Dear David, thanks for your reply. The paste() meant to paste the vectors vec1 and vec2 together, so main should be a vector of length 3 of the form a 1, b 2, c 3 # with b being tilde(b) However, with c() it is a vector of length 6:

Re: [R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 2:34 PM, David Winsemius wrote: On Apr 1, 2011, at 1:56 PM, Marius Hofert wrote: Dear David, thanks for your reply. The paste() meant to paste the vectors vec1 and vec2 together, so main should be a vector of length 3 of the form a 1, b 2, c 3 # with b being tilde(b)

Re: [R] How to paste a vector of expressions and a character vector?

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 2:34 PM, David Winsemius wrote: On Apr 1, 2011, at 1:56 PM, Marius Hofert wrote: Dear David, thanks for your reply. The paste() meant to paste the vectors vec1 and vec2 together, so main should be a vector of length 3 of the form a 1, b 2, c 3 # with b being tilde(b)

[R] filled contour plot with contour lines

2011-04-01 Thread Steve_Friedman
I'm stumped, can anyone find my error in this sequence. for(j in 1:(varsize[4]-1)) temp - get.var.ncdf(nc=input, varid=p_foraging,c(1,1,j),c(varsize[1],varsize[2],1)) filled.contour(x, y, temp, color = terrain.colors, plot.title = title(main = paste(Everglades Wood

Re: [R] Linear Model with curve fitting parameter?

2011-04-01 Thread Steven McKinney
-Original Message- From: stephen sefick [mailto:ssef...@gmail.com] Sent: April-01-11 5:44 AM To: Steven McKinney Cc: R help Subject: Re: [R] Linear Model with curve fitting parameter? Setting Z=Q-A would be the incorrect dimensions. I could Z=Q/A. I suspect this is confusion

Re: [R] Fisher's test

2011-04-01 Thread Peter Ehlers
On 2011-04-01 10:19, Jim Silverton wrote: I have a matrix with 2 columns and I want to do fishers exact test for these with the totals for each row being 100 say. The data has the form: 23 12 32 21 12 2 and these represents the tables: 23 12 77 88 32 21 78 79 12 2 88 98 How do I

Re: [R] lattice xscale.components: different ticks on top/bottom axis

2011-04-01 Thread Boris.Vasiliev
On Fri, Mar 11, 2011 at 12:28 AM, boris.vasil...@forces.gc.ca wrote: Good afternoon, I am trying to create a plot where the bottom and top axes have the same scale but different tick marks.  I tried user-defined xscale.component function but it does not produce desired results.  

Re: [R] mean in the boxplot

2011-04-01 Thread Peter Ehlers
On 2011-04-01 10:28, David Winsemius wrote: On Apr 1, 2011, at 1:20 PM, Yan Jiao wrote: Dear R users, How to show mean in the boxplot instead of median ? Read ... help(boxplot) Use boxplot to create a set of values, substitute th emean for the groups then pass the mangled set of values to

Re: [R] XYPlot Conditioning Variable in Specific, Non-Alphanumeric Order. -- Resending with corrected .txt file

2011-04-01 Thread Guy Jett
Thank you very much Deepayan. This does exactly what I needed! Cheers, Guy Jett gj...@itsi.com -Original Message- From: Deepayan Sarkar [mailto:deepayan.sar...@gmail.com] Sent: Friday, April 01, 2011 6:51 AM To: Guy Jett Cc: r-help@R-project.org Subject: Re: [R] XYPlot Conditioning

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Peter Ehlers
Aren't you missing a set of parentheses? I can't run your code since it's not reproducible, but to my aging eyes it seems that you need a set of '{}' around the contents of your loop: for(j in 1:(varsize[4]-1)) { loop stuff } Peter Ehlers On 2011-04-01 11:48, steve_fried...@nps.gov wrote:

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Steve_Friedman
Hi Peter, Thanks for taking the time to consider the problem. I realize the procedure is not reproducible. I use a 4 dimensional netCDF file (4.2 GB) in size to pull data into this process. Nobody in their right mind should work with such things. It's a spatial temporal database with 10 years of

[R] function in argument

2011-04-01 Thread array chip
Hi, I tried to pass the function dist() as an argument, but got an error message. However, almost the same code with mean() as the function to be passed, it works ok. foo-function (x, xfun = dist) { xfun(x) } foo(matrix(1:100,nrow=5)) Error in foo(matrix(1:100, nrow = 5)) : could not

[R] hc2Newick is different than th hclust dendrogram

2011-04-01 Thread Jose Hleap Lozano
Hi R helpers... I am having troubles because of the discrepancy between the dendrogram plotted from hclust and what is wrote in the hc2Newick file. I've got a matrix C: hc - hclust(dist(C)) plot(hc) with the: write(hc2Newick(hc),file='test.newick') both things draw completely

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Steve_Friedman
Hi Peter, Thanks for taking the time to consider the problem. I realize the procedure is not reproducible. I use a 4 dimensional netCDF file (4.2 GB) in size to pull data into this process. Nobody in their right mind should work with such things. It's a spatial temporal database with 10 years of

[R] qcc.overdispersion-test

2011-04-01 Thread sahin
Hi all, I have made an overdispersion test for a data set and get the following result Overdispersion test Obs.Var/Theor.Var Statistic p-value poisson data 16.24267 47444.85 0 after deleting the outliers from the data set I get the following result Overdispersion test

Re: [R] filled contour plot with contour lines

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 5:38 PM, steve_fried...@nps.gov wrote: Hi Peter, Thanks for taking the time to consider the problem. I realize the procedure is not reproducible. I use a 4 dimensional netCDF file (4.2 GB) in size to pull data into this process. Nobody in their right mind should work

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Clint Bowman
Steve, I use filled.contour but have a semicolon, ;, between the two axis calls. Do you need one after axis(1, seq(45 , 58, by = 1)) ? Clint -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu

Re: [R] function in argument

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 5:56 PM, array chip wrote: Hi, I tried to pass the function dist() as an argument, but got an error message. However, almost the same code with mean() as the function to be passed, it works ok. foo-function (x, xfun = dist) { xfun(x) } foo(matrix(1:100,nrow=5))

Re: [R] function in argument

2011-04-01 Thread array chip
OK, I figured it out, need to add stats::: before dist foo-function (x, xfun = stats:::dist) { xfun(x) } John To: r-help@r-project.org Sent: Fri, April 1, 2011 2:56:06 PM Subject: [R] function in argument Hi, I tried to pass the function dist() as an

Re: [R] function in argument

2011-04-01 Thread Henrique Dallazuanna
Or: foo-function (x, xfun = dist) { match.fun(xfun)(x) } On Fri, Apr 1, 2011 at 7:06 PM, array chip arrayprof...@yahoo.com wrote: OK, I figured it out, need to add stats::: before dist foo-function (x,    xfun = stats:::dist) { xfun(x) } John

[R] Lattice wireframe or cloud plot with different colours by a group

2011-04-01 Thread Pam Allen
I have a question about wireframe 3-D plots and how to apply colors. I have a large dataset of river flow (m^3/s) over time, and I have coded these flows based on their height. I would like to produce a wireframe plot that colors the graph based on the flow code, i.e. I would like high flows to

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Peter Ehlers
Steve, I was just about to send off another suggestion which began with ... Try the following or wait for David W. to chime in. But I see that he's already done that. Anyway, in case it's still of some use: First I would check that you don't have a variable 'T' in your workspace. (Never use

[R] package MICE, squeeze function, calling several variables at once

2011-04-01 Thread Rita Carreira
Hello everyone!I have a data set with missing observations that I am trying to impute. I am using MICE and I would like the imputed values to all be positive. I have two types of variables: prices (P1 to P136) and quantities (Q1 to Q136) and I also want the range of these two types to be

Re: [R] filled contour plot with contour lines

2011-04-01 Thread skfgla...@gmail.com
Hi Peter and everyone else who has offered suggestions. I am now at home and will try your suggestions this evening. The initial effort with the stripped down verion I have used earlier did access the file correctly so I have no reason to think it is not formatted correctly. That however

Re: [R] Lattice wireframe or cloud plot with different colours by a group

2011-04-01 Thread David Winsemius
On Apr 1, 2011, at 6:21 PM, Pam Allen wrote: I have a question about wireframe 3-D plots and how to apply colors. I have a large dataset of river flow (m^3/s) over time, and I have coded these flows based on their height. I would like to produce a wireframe plot that colors the graph

[R] Putting a loop in a function

2011-04-01 Thread Ben Hunter
I'm stuck here. The following code works great if I just use it on the command line in a 'for' loop. Once I try to define it as a function as seen below, I get bad results. I'm trying to return a vector of column indices based on a short string that is contained in a selection (length of about 70)

Re: [R] Putting a loop in a function

2011-04-01 Thread Joshua Wiley
Hi Ben, I am having some trouble figuring out what it is exactly you want. A workable example would be nice and then (even if just manually) typed out what you would like it to return based on a given input. I almost think you just want grep(). grep(test, c(test, not, test2, not), value =

  1   2   >