Re: [R] Efficiency of C Compiler in R CMD SHLIB

2010-04-16 Thread Prof Brian Ripley
Since the context is missing in this message, from others this is about 32-bit Windows. On Thu, 15 Apr 2010, yehengxin wrote: Thanks for your response. I found the folder to modify the compiler for C source codes. C++ 6.0 is an old C programming environment (1994~1998) but it is efficient.

Re: [R] Regression using R

2010-04-16 Thread Dieter Menne
Samuel Bravo wrote: I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Students are often looking at the wrong place. It's not intuitive that quadratic,

Re: [R] Replace / with - in date

2010-04-16 Thread arnaud Gaboury
Why don't you try something like : Xd$x=as.date(xd$x,format=%y/%m/%d). -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Christian Raschke Sent: Thursday, April 15, 2010 8:28 PM To: r-help@r-project.org Subject: Re: [R]

Re: [R] Does sink stand for anything?

2010-04-16 Thread Barry Rowlingson
On Fri, Apr 16, 2010 at 1:49 AM, Sharpie ch...@sharpsteen.net wrote: Sink captures R output and directs it elsewhere- common places are a file or device such as /dev/null Personally it always connected with the concept of a sink in a mathematical system as something that removes constituants

Re: [R] glmer with non integer weights

2010-04-16 Thread Kay Cichini
thanks thierry, i considered this transformations already, but variance is not stabilized and/or normality is neither achieved. i guess i'll have to look out for non-parametrics? best regards, kay -- View this message in context:

[R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
Dear group, Here is my data.frame : df - structure(list(DESCRIPTION = c(PRM HGH GD ALU, PRM HGH GD ALU, PRIMARY NICKEL, PRIMARY NICKEL, PRIMARY NICKEL, PRIMARY NICKEL, STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD

Re: [R] glmer with non integer weights

2010-04-16 Thread Kay Cichini
thank you thomas for the helpful hint! yours, kay -- View this message in context: http://n4.nabble.com/glmer-with-non-integer-weights-tp1837179p1965827.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Error in library(gplots) : there is no package called 'gplots'

2010-04-16 Thread Vava
Thanks for your suggestion Tal. Unfortunately, still no luck with me ... still get the usual error message: Error in library(gplots) : there is no package called 'gplots' , whatever I try to install. This is a mystery to me with respect to why /how. I am really stuck with that problem. Best,

Re: [R] Error in library(gplots) : there is no package called 'gplots'

2010-04-16 Thread james
Hi Vava, What version of R are you using? I'm not sure but I think that R will refuse to install a package in this way if the version of gplots is incompatiable with the version of R you're using. You can check the depends of packages on CRAN. Regards, James Vava wrote: Thanks for your

[R] Return a variable name

2010-04-16 Thread soeren . vogel
Hello, how can I return the name of a variable, say a$b, from a function? fun - function(x){ return(substitute(x)); } a - data.frame(b=1:10); fun(a$b) ... returns a$b, but this is a type language, thus I can't use it as a character string, can I? How? Thanks for help, Sören

[R] merge

2010-04-16 Thread n.via...@libero.it
I have a problem with the merge function: I need to merge the data.frames that you will find as arrachmente...I try all the possible combinationsbut none seems to work properly Does anyone knows how to do it?? thanks __ R-help@r-project.org

[R] error at R CMD check

2010-04-16 Thread carol white
Hi, I generated an R package but at running R CMD check, I got the following error message for the first data file: *** installing help indices Building/Updating help pages for package 'jamda' Formats: text html latex example f1 texthtmllatex example

[R] problem with the version of R

2010-04-16 Thread arindam fadikar
Dear users, I am using R in UBUNTU , but the version is 9.1. How can I upgrade it to R 10.1? -- Arindam Fadikar M.Stat Indian Statistical Institute. New Delhi, India [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Bootstrapping a repeated measures ANOVA

2010-04-16 Thread Fischer, Felix
Hello everyone, i have a question regarding the sampling process in boot(). I try to bootstrap F-values for a repeated measures ANOVA to get a confidence interval of F-values. Unfortunately, while the aov works fine, it fails in the boot()-function. I think the problem might be that the

Re: [R] [SPAM] Re: Error in library(gplots) : there is no package called 'gplots'

2010-04-16 Thread Martin Valere
Dear James, i have tried to install the package RODBC1-3.1 with R version 2.9.0 and 2.10.1 (using Opensuse 11.1, 64bits). I have tried install.packages locally (package downloaded and stored locally on the computer) or directly from Internet (using different mirrors !). Same results each

Re: [R] error at R CMD check

2010-04-16 Thread Duncan Murdoch
carol white wrote: Hi, I generated an R package but at running R CMD check, I got the following error message for the first data file: *** installing help indices Building/Updating help pages for package 'jamda' Formats: text html latex example f1 text

Re: [R] R CMD REMOVE etc. query

2010-04-16 Thread Gabor Grothendieck
Assuming its the last package that you loaded detach() without arguments will detach it. On Thu, Apr 15, 2010 at 1:45 PM, Prof. John C Nash nas...@uottawa.ca wrote: Brian Ripley pointed out that the library() documentation (third screen, however) says that library() and require() check current

Re: [R] data frame manipulation

2010-04-16 Thread Ista Zahn
Hi, I'm not sure I understand what you want exactly. My best guess is that you want something like op=ddply(DF, c(DESCRIPTION), summarise, POSITION= sum(QUANITY),DATE=max(CREATED.DATE), CLOSING.PRICE = CLOSING.PRICE[CREATED.DATE == max(CREATED.DATE)]) op - unique(op) Does that do it? -Ista On

[R] Counting number of values by row (text, not numbers)

2010-04-16 Thread Laura Ferrero-Miliani
Hi everyone! I am very new to R and I am having some difficulties. My data set looks something like this: ABCD E cat monkey cat dogcat cat __

Re: [R] Return a variable name

2010-04-16 Thread Ista Zahn
Hi Sören Somehow this feels dirty, but you can do fun - function(x){ result - capture.output(print(substitute(x))) return(result); } -Ista On Fri, Apr 16, 2010 at 5:26 AM, soeren.vo...@eawag.ch wrote: Hello, how can I return the name of a variable, say a$b, from a function? fun -

Re: [R] problem with the version of R

2010-04-16 Thread Ista Zahn
Hi Arindam, Follow the instructions at http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu/ -Ista On Fri, Apr 16, 2010 at 5:54 AM, arindam fadikar arindam.fadi...@gmail.comwrote: Dear users, I am using R in UBUNTU , but the version is 9.1. How can I upgrade it to R 10.1? -- Arindam Fadikar

[R] Fwd: Counting number of values by row (text, not numbers)

2010-04-16 Thread Laura Ferrero-Miliani
Hi everyone! I am very new to R and I am having some difficulties. My data set looks something like this: subjectA                B                C    D               E 1 cat             monkey       cat dog            cat 2 cat

Re: [R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
When I pass your command line, here is what I get : op=ddply(df,c(DESCRIPTION),summarise,POSITION=sum(QUANITY),DATE=max(CREAT ED.DATE),SETTLEMENT=CLOSING.PRICE[CREATED.DATE=max(CREATED.DATE)]) op DESCRIPTION POSITION DATE SETTLEMENT 1 PRIMARY NICKEL0 2010-03-10 NA 2 PRM

Re: [R] Return a variable name

2010-04-16 Thread Duncan Murdoch
On 16/04/2010 5:26 AM, soeren.vo...@eawag.ch wrote: Hello, how can I return the name of a variable, say a$b, from a function? Use deparse(substitute(x)), not just substitute(x). By the way, to be picky, a$b is not the name of a variable. It is an expression that extracts the b element of

Re: [R] Fwd: Counting number of values by row (text, not numbers)

2010-04-16 Thread Ista Zahn
Hi Laura, Usually this kind of thing is easier if you put your data into a long format. I would use something like Dat - read.table(textConnection(subject A B C D E 1 cat monkey cat dog cat 2 cat cat cat cat dog), header=TRUE) library(reshape) m.Dat - melt(Dat, id=subject) xtabs(~subject+value,

Re: [R] data frame manipulation

2010-04-16 Thread Ista Zahn
It works for me... DF - + structure(list(DESCRIPTION = c(PRM HGH GD ALU, PRM HGH GD ALU, + PRIMARY NICKEL, PRIMARY NICKEL, PRIMARY NICKEL, PRIMARY NICKEL, + STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , + STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , STANDARD LEAD , + SPCL

Re: [R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
Excellent!! You saved me hours and hours of turning around and around. TY so much. From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Friday, April 16, 2010 1:37 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] data frame manipulation It works for me... DF - +

[R] Help on rKward

2010-04-16 Thread Ronaldo Reis Junior
Hi, I'm testing rKward and it's become a great GUI for R on linux, mainly for new linux users. I'm not a new linux user and I use Emacs for my own R's script. But I always try new GUIs or IDEs for to recommend to my students. The most dificult for new R and Linux users is: I have installed R

[R] merge

2010-04-16 Thread n.via...@libero.it
I have a problem with the merge command. I have to merge two dataframe that looks like the following example: CODPROD N1 N3 N4 23 3 55 4 24 5 6736 25

[R] Weights in binomial glm

2010-04-16 Thread Jan van der Laan
I have some questions about the use of weights in binomial glm as I am not getting the results I would expect. In my case the weights I have can be seen as 'replicate weights'; one respondent i in my dataset corresponds to w[i] persons in the population. From the documentation of the glm method, I

[R] Odp: merge

2010-04-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.04.2010 14:00:09: I have a problem with the merge command. I have to merge two dataframe that looks like the following example: CODPROD N1 N3 N4 23 3 55 4 24

Re: [R] merge

2010-04-16 Thread Gabor Grothendieck
Try this: library(plyr) rbind.fill(DF1, DF2) On Fri, Apr 16, 2010 at 8:00 AM, n.via...@libero.it n.via...@libero.it wrote: I have a problem with the merge command. I have to merge two dataframe that looks like the following example: CODPROD       N1           N3           N4 23              

Re: [R] hugene10stv1cdf

2010-04-16 Thread James MacDonald
Hi Christoph, Christoph Knapp wrote: Hi all, I'm just tried to start analysing some micro-array chips. And R was asking for this package. When I tried to install it it says that: Using R version 2.10.1, biocinstall version 2.5.10. Installing Bioconductor version 2.5 packages: [1]

Re: [R] Exporting an rgl graph

2010-04-16 Thread Michael Friendly
l...@stat.uiowa.edu wrote: The current issue of JCGS (Vol 18 No 1, http://pubs.amstat.org/toc/jcgs/19/1) has an editorial on including animations, 3D visualizations, and movies in on-line PDF files supporting JCGS articles. The online supplements to the editorial include examples. The 3D

[R] problem with FUN in Hmisc::summarize

2010-04-16 Thread arnaud chozo
Hi all, I'd like to use the Hmisc::summarize function, but it uses a function (FUN) of a single vector argument to create the statistical summaries. Consider an easy case: I'd like to compute the correlation between two variables in my dataframe, grouped according to other variables in the same

Re: [R] Weights in binomial glm

2010-04-16 Thread ONKELINX, Thierry
Jan, It looks like you did not understand the line For a binomial GLM prior weights are used to give the number of trials when the response is the proportion of successes. Weights must be a number of trials (hence integer). Not a proportion of a population. Here is an example that clarifies the

[R] how to use the neural networks package for time series prediction

2010-04-16 Thread david sabine
Hello all , Does any one know how to use the neural networks package for time series prediction ? Have you a similar example in R language ? thanks in advance David [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] data.frame and ddply

2010-04-16 Thread arnaud Gaboury
Dear group, Here is my df : futures - structure(list(CONTRAT = c(WHEAT May/10 , WHEAT May/10 , WHEAT May/10 , WHEAT May/10 , COTTON NO.2 May/10 , COTTON NO.2 May/10 , COTTON NO.2 May/10 , PLATINUM Jul/10 , SUGAR NO.11 May/10 , SUGAR NO.11 May/10 , SUGAR NO.11 May/10 , SUGAR NO.11 May/10

Re: [R] data.frame and ddply

2010-04-16 Thread Felipe Carrillo
You can do something like this after the output from opfut opfut - data.frame(opfut$CONTRAT,opfut$POSITION,opfut$SETTLEMENT) names(opfut) - c('CONTRAT','POSITION','SETTLEMENT') opfut   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish Wildlife Service California,

[R] vector matching

2010-04-16 Thread Michael Nestrud
Hello all, I have searched the archives for a similar problem to no avail. I could use your help. I have a bunch of vectors organized into two matrices, x and y. These vectors (as rows) consist of combinations of elements such that order does not matter. I want to create a third matrix from

Re: [R] how can I plot the histogram like this using R?

2010-04-16 Thread bbslover
Thanks for your reply, I just want to get the figure like y1.jpg using the data from y1.txt. Through the figure I want to obtain the split point like y1.jpg, and consider 2.5 as the plit point. This figure is drawn by other people, I just want to draw it using R, but I can not, so I hope,

[R] R loop.

2010-04-16 Thread mhalsham
Hi every one I’m new to R and I cant figure our how to use the loop to do the following task, any help would be very kind of every one. I have a file called (table3.txt) that contains over 1000 row and over 40 columns. So for example first row would look like that Deafness, EYA4, DIAPH1,

[R] Image RGB calculation

2010-04-16 Thread ole_roessler
Dear all, I need to read an image (mostly jpg) and split the channel of this image to an colour channel calculation like this: sqrt(R²+G²+B²) Do you have an idea what package I need to use for it, and is it possible? Thanky a lot Ole -- View this message in context:

Re: [R] Problems getting symbols() to show table data

2010-04-16 Thread Guy Green
Thanks. I don't think I would ever have worked that twist out. It is perfect. Guy -- View this message in context: http://n4.nabble.com/Problems-getting-symbols-to-show-table-data-tp1839676p1989384.html Sent from the R help mailing list archive at Nabble.com.

[R] generating a SpatialLinesDataFrame (rgdal)

2010-04-16 Thread Simon Goodman
Could somebody give me a pointer on how to generate a SpatialLinesDataFrame from a dataframe, that contains lat,long coordinates as separate variables. At the moment the data looks like this: lat long [1] 53. 1. where as the SpatialLinesDataFrame consists of

[R] Removing empty (or very underpopulated) sub-populations

2010-04-16 Thread Kamil Sijko
Hi, I'm trying to develop a function that will simplify the most common analyses in my area of interest (social sciences) by computing all required statistics at one run (for exaple in case of a factor and numeric variable: 1) normality test, then in case variable are normal 2) ANOVA 3) with

[R] format() method

2010-04-16 Thread kafkaz
Hello, I use format() function to get number of the week, like this: format(tmp,'%U') Recently, I have spotted something bizarre. For example, I have such object: (index(tmp$x.delta['2009'][1:16])) [1] 2009-01-02 CET 2009-01-09 CET 2009-01-16 CET 2009-01-23 CET [5] 2009-01-30 CET

[R] xyplot ontop a contourplot (package: lattice)

2010-04-16 Thread Jay
Hello, I have a contourplot plot that shows the data I want. However, I would like to point a certain amount of points from this plot via a xyplot(). Example: x - seq(pi/4, 5 * pi, length.out = 100) y - seq(pi/4, 5 * pi, length.out = 100) r - as.vector(sqrt(outer(x^2, y^2, +))) grid -

Re: [R] problem with FUN in Hmisc::summarize

2010-04-16 Thread Ista Zahn
Hi Arnaud, I'm not sure how do to this with Hmis::summarize, but it's pretty easy with plyr::ddply: D - read.table(textConnection(V1 V2 V3 A 1-1 A 1 1 A-1-1 B 1 1 B 1 1), header=TRUE) closeAllConnections() corr.V2.V3 = function(x) { out = cor(x$V2,

Re: [R] Weights in binomial glm

2010-04-16 Thread Jan van der Laan
Thierry, Thank you for your answer. From the documentation it looks like it is valid to assume that the weights can be used for replicate weights. Continuing your example: dataset$Success2 - dataset$Success Aggregated2 - cast(Person+Success ~ ., data = dataset, value = Success2, fun =list(mean,

Re: [R] data.frame and ddply

2010-04-16 Thread arnaud Gaboury
I found a way using the subset command : opfut=subset(ddply(futures, c(CONTRAT,SETTLEMENT), summarise, POSITION= sum(QUANTITY)),select=c(CONTRAT,POSITION,SETTLEMENT)) opfut CONTRAT POSITION SETTLEMENT 1 SUGAR NO.11 May/10 516.5400 2 COTTON NO.2

[R] multiple variables pointing to single dataframe?

2010-04-16 Thread Alex Bryant
Hi, I have a need to have 2 variables point to the same dataframe (d1), I don't want to simply copy the dataframe ( d2-d1 ) as my understanding is that this will create a second dataframe. Any suggestions on best practice here? Thank You, // // Alex Bryant //

[R] Blocking and Nested ANOVA Design. Am I using the aov() function correctly?

2010-04-16 Thread Eleftheria Dalmaris
Dear list members, I am new member and fairly new into R world! I hope what I have is not beyond the purpose of this list. I did first search for similar experimental designs without success. I want to perform an ANOVA analysis using the aov() function. I am not 100% sure that I have it right.

Re: [R] Image RGB calculation

2010-04-16 Thread Tobias Verbeke
Hi Ole, ole_roessler wrote: I need to read an image (mostly jpg) and split the channel of this image to an colour channel calculation like this: sqrt(R²+G²+B²) Do you have an idea what package I need to use for it, and is it possible? For general image processing capabilities within R, I

[R] Yet Testing rKward

2010-04-16 Thread Ronaldo Reis Junior
Hi, I continue testing rKward. I dont know how to save the results from a script execution without use copy and paste or using a rkward output system. Now I try to understand how adapt my script do use the rKward output system. Example: I have this script: -- ## Carregar a

Re: [R] Weights in binomial glm

2010-04-16 Thread ONKELINX, Thierry
Jan, You misread the documentation of ?glm. Note that glm works with different kinds of families. So the first statement about weights is rather general: it holds for most of the families. It explicitly tells you that is not the case with the binomial family. From the documentation: For a

Re: [R] vector matching

2010-04-16 Thread Henrique Dallazuanna
If I understand: unique(t(apply(rbind(x, y), 1, sort))) On Fri, Apr 16, 2010 at 11:05 AM, Michael Nestrud m...@ataraxis.org wrote: Hello all, I have searched the archives for a similar problem to no avail.  I could use  your help. I have a bunch of vectors organized into two matrices, x

[R] score counts in an aggregate function

2010-04-16 Thread KDT
Dear R-Users, I have a big data set mydata with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2

Re: [R] GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?

2010-04-16 Thread Simon Wood
Both versions of this should have worked, but you are right that the first version didn't when used with `gamm', I've fixed this for mgcv 1.6-2 (`mgcv:gam' was ok). Thanks for this. best, Simon On Wednesday 14 April 2010 09:03, JANSEN, Ivy wrote: Hi, I was reading the book on Mixed Effects

Re: [R] format() method

2010-04-16 Thread Don MacQueen
Were you expecting 01, and is that why you are puzzled? See ?strftime and the explanation of the %U format. It depends on where the first Sunday of the year happens to fall. -Don At 5:28 AM -0800 4/16/10, kafkaz wrote: Hello, I use format() function to get number of the week, like this:

Re: [R] problem with FUN in Hmisc::summarize

2010-04-16 Thread hadley wickham
corr.V2.V3 = function(x) {  out = cor(x$V2, x$V3)  names(out) = CORR  return(out) } A litte more concisely: corr.V2.V3 = function(x) { c(CORR = cor(x$V2, x$V3)) } -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/

[R] score counts in an aggregate function

2010-04-16 Thread Kadengye Trevor
Dear r-list, I have a big data set mydata with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2

Re: [R] how can I plot the histogram like this using R?

2010-04-16 Thread Gustaf Rydevik
On Fri, Apr 16, 2010 at 10:13 AM, bbslover dlu...@yeah.net wrote:  Thanks for your reply, I just want to get the figure like y1.jpg using the data from y1.txt.  Through the figure  I want to obtain the split point like y1.jpg, and consider 2.5 as the plit point.  This figure is drawn by other

[R] run R script from Excel VBA

2010-04-16 Thread KZ
I wrote a R script say called computeCovarMatrix.R and i want to call and run this piece from Excel visual basic. does anyone know how to do that? thanks, KZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] score counts in an aggregate function

2010-04-16 Thread Ista Zahn
Hi Trever, You can do it like this: count - function(x) { length(na.omit(x)) } counts - data.frame(aggregate(mydata[,4:5],by=list(mydata$userid),FUN=count)) -Ista On Fri, Apr 16, 2010 at 10:35 AM, KDT dkaden...@gmail.com wrote: Dear R-Users, I have a big data set mydata with repeated

[R] Outlier detection from trayectory data

2010-04-16 Thread Usuario R
Hi all, I am trying to analyze data coming from trajectories of moving objects. It can be take as a two dimension time serie. The only method I've found is this: http://figment.cse.usf.edu/~sfefilat/data/papers/TuAT10.41.pdf Anyone know if this method is already implemented in R of if there is

Re: [R] format() method

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 9:28 AM, kafkaz wrote: Hello, I use format() function to get number of the week, like this: format(tmp,'%U') Recently, I have spotted something bizarre. For example, I have such object: (index(tmp$x.delta['2009'][1:16])) [1] 2009-01-02 CET 2009-01-09 CET 2009-01-16

[R] piecewise nls?

2010-04-16 Thread Derek Ogle
I am looking into fitting a so-called double von Bertalanffy function to fish length-at-age data. Attempting to simplify the situation, the model looks like this ... Y ~ f(X; a,b,c) if x Z Y ~ g(X; a,d,e) if x = Z where * f and g are non-linear functions (the traditional single von

Re: [R] run R script from Excel VBA

2010-04-16 Thread Erich Neuwirth
Have a look at rcom.univie.ac.at. We have an Excel addin which will allow you to do that. Disclaimer: I am the author of the addin. On 4/16/2010 4:57 PM, KZ wrote: I wrote a R script say called computeCovarMatrix.R and i want to call and run this piece from Excel visual basic. does anyone

Re: [R] Bootstrapping a repeated measures ANOVA

2010-04-16 Thread Charles C. Berry
On Fri, 16 Apr 2010, Fischer, Felix wrote: Hello everyone, i have a question regarding the sampling process in boot(). PLEASE ... provide commented, minimal, self-contained, reproducible code. Which means something a correspondent could actually run. But before that, a careful reading of

[R] return of a function

2010-04-16 Thread Gustave Lefou
Dear R users, I have a function which takes as arguments big arrays, say : w, x , y and z. My function changes these arrays and I want them as result/output. I have tried to write return(w,x,y,z), and thus to replace the previous w, x, y and z. It does not seem to work. What can I do ? Thank

Re: [R] return of a function

2010-04-16 Thread jim holtman
You can return a single object from a function. If you want multiple values, use a list: f - function(x,y,z){ return(list(x=x, y=y, z=z)) } value - f(x,y,z) # now copy the values x - value$x y - value$y z - value$z On Fri, Apr 16, 2010 at 12:02 PM, Gustave Lefou

Re: [R] return of a function

2010-04-16 Thread Bert Gunter
Below Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gustave Lefou Sent: Friday, April 16, 2010 9:03 AM To: r-help@r-project.org Subject: [R] return of a function Dear R users, I

Re: [R] return of a function

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 12:02 PM, Gustave Lefou wrote: Dear R users, I have a function which takes as arguments big arrays, say : w, x , y and z. My function changes these arrays and I want them as result/output. I have tried to write return(w,x,y,z), and thus to replace the previous w,

Re: [R] Exporting an rgl graph

2010-04-16 Thread Greg Snow
The easiest approach may be to just install R onto a USB drive (flash/thumb/...) then when you go to your coworkers computer just run R from the USB drive and show the rgl plot. I think there is also a tool to create an animation from rgl, it is not interactive, but you could e-mail a movie

Re: [R] Weights in binomial glm

2010-04-16 Thread Thomas Lumley
Jan, Thierry is correct in saying that you are misusing glm(), but there is also a numerical problem. You are misusing glm() because your model specification claims to have Binomial(n,p) observations with w in the vicinity of 100, where there is a single common p but the observed binomial

Re: [R] Bootstrapping a repeated measures ANOVA

2010-04-16 Thread Fischer, Felix
Thank you for your answer. Sorry for the missing example. In fact, i think, i solved the issue by some data-manipulations in the function. I splitted the data (one set for each measuring time), selected the cases at random, and then combined the two measuring times again. Results look

Re: [R] Poblems wih EBImage

2010-04-16 Thread Gregoire Pau
Hello, EBImage is a Bioconductor package: please post on the Bioconductor mailing list. EBImage requires the libraries ImageMagick and GTK+ to be installed. Did you follow the instructions of the installation manual ? http://www.bioconductor.org/packages/release/bioc/html/EBImage.html It

Re: [R] TeachingDemos install bumps out with 'Out of memory!'

2010-04-16 Thread Greg Snow
I have no idea what is happening here (not an ubunto or linux expert), but it seems unlikely that the particular package is the main problem, rather that is the package you happen to be on when the problem manifests. TeachingDemos does not have any compiled code (all straight R code) and does

[R] PCA scores

2010-04-16 Thread phoebe kong
Hi all, I have a difficulty to calculate the PCA scores. The PCA scores I calculated doesn't match with the scores generated by R, mypca-princomp(mymatrix, cor=T) myscore-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) Does anybody know how the mypca$scores were calculated? Is my formula not

[R] VERY SIMPLE QUESTION

2010-04-16 Thread Kathie
Dear R users, I am looking for more efficient way to compute the followings -- a - matrix(c(1,1,1,1,2,2,2,2),4,2) b - matrix(c(1,2,3,4),4,1) Eventually, I want to get this matrix, `c`. c -

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Henrique Dallazuanna
Try this: sweep(a, 1, b, '/') On Fri, Apr 16, 2010 at 2:30 PM, Kathie kathryn.lord2...@gmail.com wrote: Dear R users, I am looking for more efficient way to compute the followings -- a -

Re: [R] PCA scores

2010-04-16 Thread Gavin Simpson
On Fri, 2010-04-16 at 10:23 -0700, phoebe kong wrote: Hi all, I have a difficulty to calculate the PCA scores. The PCA scores I calculated doesn't match with the scores generated by R, mypca-princomp(mymatrix, cor=T) myscore-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) Does

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Christian Raschke
Since b is only one column, just make it a vector. a - matrix(c(1,1,1,1,2,2,2,2),4,2) b - c(1,2,3,4) then result - a/b result [,1] [,2] [1,] 1.000 2.000 [2,] 0.500 1.000 [3,] 0.333 0.667 [4,] 0.250 0.500 should be what you want. It is also

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Kathie
thanks a lot. good day. Kathie On Fri, Apr 16, 2010 at 1:43 PM, Henrique Dallazuanna [via R] ml-node+2013302-929204043-67...@n4.nabble.comml-node%2b2013302-929204043-67...@n4.nabble.com wrote: Try this: sweep(a, 1, b, '/') On Fri, Apr 16, 2010 at 2:30 PM, Kathie [hidden

[R] read xml

2010-04-16 Thread Alex Campos
Hi I am trying to read selected fields from a xml file with R using xml package. So far I have learned the basics of this package by going through the manual, examples, tutorial, and so on (www.omegahat.org/RSXML) . The problem is that I am getting stuck when it comes down to more complex

[R] How to get rid of extra areas on spatial data map

2010-04-16 Thread Changyou Sun
Hello All, I am using sp and maps libraries to have a map for some fire data. The region covered is Mississippi State in the US. Then I would like to add a layer of ecoregion on the top (omenrik layer from nationalatlas.gov). The problem is that the ecoregion layer is larger than the state

[R] call R script from Excel VBA/macro

2010-04-16 Thread KZ
i wrote a R script say called computeCovarMatrix.R and i want to call and run this piece from Excel visual basic. does anyone know how to do that? thanks, KZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] run R script from Excel VBA

2010-04-16 Thread Guy Green
See RExcel, http://rcom.univie.ac.at/ http://rcom.univie.ac.at/ and especially the video demo http://rcom.univie.ac.at/RExcelDemo/ http://rcom.univie.ac.at/RExcelDemo/ Guy -- View this message in context: http://n4.nabble.com/run-R-script-from-Excel-VBA-tp2009478p2011942.html Sent from the

Re: [R] Image RGB calculation

2010-04-16 Thread ole_roessler
Thanks a lot, i will try this out! Ole -- View this message in context: http://n4.nabble.com/Image-RGB-calculation-tp1989864p2013203.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Efficiency of C Compiler in R CMD SHLIB

2010-04-16 Thread yehengxin
Thank you very much for your kind explanation. I did find my DLL compiled using either VC++ 6.0 or Intel Compiler (almost equally fast) is significanlty faster than that compiled using gcc (55 seconds vs. 78 seconds), the default compiler in R. I did not choose debug mode when using gcc so I

Re: [R] Efficiency of C Compiler in R CMD SHLIB

2010-04-16 Thread yehengxin
I wonder how to further improve the optimization level of gcc. I thought O-3 has already been the best. -- View this message in context: http://n4.nabble.com/Efficiency-of-C-Compiler-in-R-CMD-SHLIB-tp1934429p2008994.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] R loop.

2010-04-16 Thread Thomas Stewart
I'm not sure I completely understand your question, but I think the solution to your problem is the reshape function in the reshape package. Here is a silly example of how it would work: V-matrix(rbinom(15,4,.5),nrow=3) X-data.frame(A=c(A,B,C),V=V) X A V.1 V.2 V.3 V.4 V.5 1 A 1 2 3

[R] Is it ok to apply the z.test this way?

2010-04-16 Thread Atte Tenkanen
Dear R-users, I want to check if certain values are from random distribution, that includes values between 0-1. So, it is not really normal even though shapiro.test says it is highly normal... Can I do something like this and think that the values given are right. z.test is from package

Re: [R] R loop.

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 11:52 AM, Thomas Stewart wrote: I'm not sure I completely understand your question, but I think the solution to your problem is the reshape function in the reshape package. Except there is no reshape function in the reshape package. Your code works because the reshape

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 12:11 PM, Atte Tenkanen wrote: Dear R-users, I want to check if certain values are from random distribution, that includes values between 0-1. So, it is not really normal even though shapiro.test says it is highly normal... Can I do something like this and think that

Re: [R] problem with FUN in Hmisc::summarize

2010-04-16 Thread Frank E Harrell Jr
arnaud chozo wrote: Hi all, I'd like to use the Hmisc::summarize function, but it uses a function (FUN) of a single vector argument to create the statistical summaries. Consider an easy case: I'd like to compute the correlation between two variables in my dataframe, grouped according to other

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Greg Snow
Several points: 1. The Shapiro test does not tell you that something is normal or highly normal, only that you don't have enough evidence to disprove that the data came from a normal population (powered for a certain type of deviation from normality). 2. The z.test function is intended to be

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Christos Argyropoulos
So .. are you trying to figure out whether your data hasa substantial number of outliers that call into question the adequacy of the normal distro fro your data? If this is the case, note that you cannot individually check the values (as you are doing) without taking into account of the

[R] [R-pkgs] formatR: farewell to ugly R code

2010-04-16 Thread Yihui Xie
This is an announcement of the release of an R package 'formatR', which can help us format our R code to make it more human-readable. If you have ugly (I mean unformatted) R code like this:  # rotation of the word Animation # in a loop; change the angle and color # step by step for (i in 1:360) {

  1   2   >