[R] accessing elements located after $ symbol

2010-10-05 Thread Lorenzo Cattarino
Hi R-users I am having troubles accessing elements after the $ symbol. Reproducible example: test - data.frame (first=1:10, second=11:20, third=21:30) test$first #this works fine but when I try interest - first test$interest # does not seem to work Could you tell me why that

[R] binary tree construction in R

2010-10-05 Thread kateg
Hi all, I'm very new to R and I'm trying to construct a threaded binary tree using recursive functions. I'm very confused was wondering if anyone had any R sample code they would share. I've come across a lot of C++ code(nothing in R) and this is not helping. best, MK -- View this

[R] R-help

2010-10-05 Thread Lemarian WallaceIII
Im trying to simulate the rolling of a pair of dice   this is my function: #function to simulate tosses of a pair of dice #from the simulation, the program returns the empirical probability of #observing a double count - 0 for(j in 1:sim){#begin loop die1 - sample(1:6,1) print(die1) die2 -

[R] Tukey HSD Test als Post Hoc Test nach einem GLM inkl. Anova

2010-10-05 Thread Lena Neuenkamp
Hallo, zur Analyse von Daten zum Artenreichtum von Pflanzen, habe ich ein Glm (glm) und anschlieÃend eine Anova (anova) durchgeführt. Nun möchte ich für die signifikanten Einflussfaktoren einen Post Hoc Tukey Test durchführen, um zu ermitteln in wie weit die einzelnen

[R] Petit traité de programmation orienté obje t sous R

2010-10-05 Thread Christophe Genolini
Bonjour (English below) J'ai le plaisir de vous annoncer la naissance de : Petit traité de programmation orienté objet sous R, aux éditions De Boeck. J'y raconte comment faire de la programmation orienté objet S4, mais aussi comment construire un package. Le style est volontairement léger,

Re: [R] accessing elements located after $ symbol

2010-10-05 Thread Joshua Wiley
Dear Lorenzo, This is the trade off that comes with convenience. The `$` operator passes its argument directly as I understand it. This is what lets you pass unquoted names that not variables. The way around it is to use the `[` extraction operator. Look at these examples: test[interest] #or

Re: [R] R-help

2010-10-05 Thread Joshua Wiley
On Mon, Oct 4, 2010 at 9:13 PM, Lemarian WallaceIII tott...@yahoo.com wrote: Im trying to simulate the rolling of a pair of dice this is my function: #function to simulate tosses of a pair of dice #from the simulation, the program returns the empirical probability of #observing a double

Re: [R] Tukey HSD Test als Post Hoc Test nach einem GLM inkl. Anova

2010-10-05 Thread Peter Dalgaard
Please, the language of the mailing list is English. A majority of readers do not understand what you are talking about. The Tukey test was designed for comparing means in equal replication ANOVA. Some folklore suggests that it may work reasonably for not-too-unequal replication cases, but I

Re: [R] R-help

2010-10-05 Thread Jeffrey Spies
As Joshua said, in your example sim isn't be declared anywhere (neither in the environment nor as an argument in a function), but you might try something more R-ish: prop.doubles - function(sim){ sum(sample(1:6, sim,replace=T)==sample(1:6,sim,replace=T))/sim } prop.doubles(1000) Cheers,

Re: [R] Tukey HSD Test als Post Hoc Test nach einem GLM inkl. Anova

2010-10-05 Thread Spencer Graves
install.packages('sos') # if you do not already have it library(sos) TH - ???TukeyHSD #found 27 matches; retrieving 2 pages TH # The print method displays the results in a table in a web browser This suggests you might also be interested in multcompView. Unfortunately, I failed to

[R] Sampling from data set

2010-10-05 Thread Jumlong Vongprasert
Dear all. I have data with 2 variable x,y size 1. I want to sampling from this data with size 100. How I can do it. THANK. -- Jumlong Vongprasert Institute of Research and Development Ubon Ratchathani Rajabhat University Ubon Ratchathani THAILAND 34000 [[alternative HTML version

Re: [R] Sampling from data set

2010-10-05 Thread Jeffrey Spies
We'll probably need much more info, but this should get you started: nameOfDataSet[sample(1:1, 100),] You can replace the 1 with dim(nameOfDataSet)[1] to make it more dynamic. Jeff. On Tue, Oct 5, 2010 at 3:07 AM, Jumlong Vongprasert jumlong.u...@gmail.com wrote: Dear all. I have

Re: [R] Fixed variance structure for lme

2010-10-05 Thread Viechtbauer Wolfgang (STAT)
If the sampling variances are known up to a proportionality constant, then you can use: weights = varFixed(~ vi) where vi is the vector of the 50 sampling variances (corresponding to the 50 values of the dependent variable). You may have to create the vi vector by repeating the 5 sampling

Re: [R] forecasting from a linear regression

2010-10-05 Thread Tal Galili
Hello Brima, I might be missing something, but how is that theoretically done ? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |

Re: [R] Sampling from data set

2010-10-05 Thread Jeffrey Spies
If poproh.3 was your dataset as a data.frame (an object with row and column dimensions), you need a comma following the row selection (sample(...)) to indicate that you want to select those rows and all columns: newsample -poprho.3[sample(1:1,100),] # note the last comma in the brackets

Re: [R] read columns of quoted numbers as factors

2010-10-05 Thread Bernardo Rangel Tura
On Mon, 2010-10-04 at 09:39 -0700, james hirschorn wrote: Suppose I have a data file (possibly with a huge number of columns), where the columns with factors are coded as 1, 2, 3, etc ... The default behavior of read.table is to convert these columns to integer vectors. Is there a way

[R] how to insert R plot/image/graphs to Sql server 2005?

2010-10-05 Thread vikrant
-- View this message in context: http://r.789695.n4.nabble.com/how-to-insert-R-plot-image-graphs-to-Sql-server-2005-tp2955667p2955667.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Intel i7 utilization

2010-10-05 Thread Costas
Hello, Is there a way to force through R the amount of the cpu's cores (or the cpu's utilization level) used under Windows 7 or Linux? Thanks, Costas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] SVM functions

2010-10-05 Thread Neeti
Hi ! Right now I am learning to use svm functions available in R and trying to use these function with given example. I was stuck with svmlight function which is available in klaR package. Any help would be appreciated regarding this function. 1. I am unable to use svmlight( ) which is

Re: [R] Intel i7 utilization

2010-10-05 Thread Feng Li
I guess you want a multi-threaded R. The cheapest way is to recompile R from the source and link it with an multi-threaded BLAS. See R-admin for details. See also Dirk's recent survey on this topic http://dirk.eddelbuettel.com/papers/gcbd.pdf I managed to do this under my linux box with Intel

Re: [R] read columns of quoted numbers as factors

2010-10-05 Thread peter dalgaard
On Oct 4, 2010, at 18:39 , james hirschorn wrote: Suppose I have a data file (possibly with a huge number of columns), where the columns with factors are coded as 1, 2, 3, etc ... The default behavior of read.table is to convert these columns to integer vectors. Is there a way to

[R] Please help me simplify my manipulation and printing of function calls

2010-10-05 Thread Paul Sherliker
Background: I use R for a fair-sized graphics program, intended for naïve users. This works, but a less-naïve user wants it to generate code producing the graphs that he can then modify (but which will not contain my numerous manipulations and attempts to discern what the user wants).

[R] Extract summary stats to table

2010-10-05 Thread Chris Mcowen
Dear List, I am looking to run a host of models (60) with three methods - lmer,glm and lrm. Is there a way to output the key stats into a table that i can copy to excel? I.e for lmer i would want AIC,BIC etc for lrm i would want Brier score, r2, c-value etc At present i am running the

[R] Odp: Extract summary stats to table

2010-10-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.10.2010 13:46:49: Dear List, I am looking to run a host of models (60) with three methods - lmer,glm and lrm. Is there a way to output the key stats into a table that i can copy to excel? I.e for lmer i would want AIC,BIC etc for

Re: [R] Splitting a DF into rows according to a column

2010-10-05 Thread Johannes Graumann
Stupid Joh wants to give you a big hug! Thanks! Why rank works but order not, I have still to figure out, though ... Joh On Monday 04 October 2010 17:30:32 peter dalgaard wrote: On Oct 4, 2010, at 16:57 , Johannes Graumann wrote: Hi, I'm turning my wheels on this and keep coming around

Re: [R] accessing elements located after $ symbol

2010-10-05 Thread Ben Bolker
Joshua Wiley jwiley.psych at gmail.com writes: [snip] Look at these examples: test[interest] #or test[, interest] # but test[first] test[,first] Notice that for `[`, the name of the column _must_ be quoted, or be an object itself. or test[[first]] ; you probably do not want

Re: [R] Intel i7 utilization

2010-10-05 Thread Richardson, Patrick
Costas, Take a look at this post that I found to be very helpful. The walkthrough is very easy to follow. http://psyccomputing.blogspot.com/2010/04/compiling-64-bit-r-2101-with-mkl-in.html I'm not sure if the i7 is supported however you can always replace export FFLAGS=-march=core2 -O3 export

[R] Make a loop more efficient

2010-10-05 Thread Alaios
Hello everyone I need some advice if the following might be easier implemented. There are n matrixes each matrix needs to calculate one value for the rest n-1 matrixes (but not for itself). I implemented this one by two nested loops for (i in c(1:length(CRX))) { for (j in

Re: [R] Make a loop more efficient

2010-10-05 Thread David Winsemius
On Oct 5, 2010, at 8:41 AM, Alaios wrote: Hello everyone I need some advice if the following might be easier implemented. There are n matrixes each matrix needs to calculate one value for the rest n-1 matrixes (but not for itself). I implemented this one by two nested loops for (i in

[R] R doesn't want to update packages (Windows 7)

2010-10-05 Thread Dimitri Liakhovitski
Hello! I've just installed R 2.11.1 on my new home PC. Just the base R. My PC has Windows 7. R was installed in C / Program Files (x86) / R - R-2.11.1 Then - through the menue - I went to Update packages, chose the mirror and R detected the few packages that needed to be updated. After I clicked

[R] New version

2010-10-05 Thread ogbos okike
Hello, The R version on my system is R version 2.8.1 (2008-12-22). I have previously installed all the desired packages for my work - and they have been working fine. However, somebody played with my system and removed almost all the stuff. I am installing the packages again. But I am finding

Re: [R] R doesn't want to update packages (Windows 7)

2010-10-05 Thread Duncan Murdoch
On 05/10/2010 8:58 AM, Dimitri Liakhovitski wrote: Hello! I've just installed R 2.11.1 on my new home PC. Just the base R. My PC has Windows 7. R was installed in C / Program Files (x86) / R - R-2.11.1 Then - through the menue - I went to Update packages, chose the mirror and R detected the

Re: [R] New version

2010-10-05 Thread Eik Vettorazzi
this is FAQ 2.8 http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f hth Am 05.10.2010 15:00, schrieb ogbos okike: Hello, The R version on my system is R version 2.8.1 (2008-12-22). I have previously installed all the desired packages for my work -

Re: [R] New version

2010-10-05 Thread Duncan Murdoch
On 05/10/2010 9:00 AM, ogbos okike wrote: Hello, The R version on my system is R version 2.8.1 (2008-12-22). I have previously installed all the desired packages for my work - and they have been working fine. However, somebody played with my system and removed almost all the stuff. I am

[R] subject: Log likelihood above 0

2010-10-05 Thread Daniel Haugstvedt
Hi - In an effort to learn some basic arima modeling in R i went through the tutorial found at http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm One of the examples gave me a log likelihood of 77. Now I am simply wondering if this is the expected behavior? Looking in my text book

[R] party with mob - parameter estimates not significant in terminal nodes

2010-10-05 Thread tudor
Dear useRs: I successfully model-based partitioned several datasets through the use of mob from the party package (thanks Achim et al. once again !!!). At times, however, the partitioning leads to terminal nodes in which the parameter estimates of the model are not significant (although the

[R] Multinomial GLMMs in R

2010-10-05 Thread JBDurand
Hello, I would like to estimate the parameters of multinomial GLMMs by maximum likelihood. Or at least, I would like to compute the likelihood of a given set of parameters. In the case of multinomial GLMs (i.e. with discrete nominal response variable), I would use a command like

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-05 Thread Eric Lecoutre
Hi, You can have a look at RODBC and its function sqlSave. HTH, Eric 2010/10/3 johannes rara johannesr...@gmail.com Hi, R contains many good datasets which would be valuable in other platforms as well. My intention is to use R datasets on SQL Server as a sample tables. Is there a

[R] Extract summary stats to table

2010-10-05 Thread Chris Mcowen
Dear List, I am looking to run a host of models (60) with three methods - lmer,glm and lrm. Is there a way to output the key stats into a table that i can copy to excel? I.e for lmer i would want AIC,BIC etc for lrm i would want Brier score, r2, c-value etc At present i am running the

[R] sweave output

2010-10-05 Thread Rubin, Norman
I'm just starting to use sweave with latex and have a beginner question I expect this has been asked before - but I cannot seem to find the answer An input like: echo=false= X - 1:3 X @ Generates [1] 1 2 3 Is there a way to suppress the [1] ? I know I can write each term out using this the

Re: [R] Combinations

2010-10-05 Thread Trying To learn again
Hi all, Reading more I have find a partial solution on a part of the proble in some part of the code it should appea something like: # NC: All the potential combinations 3^15 if NC[price(i,j)==1 price(i,j)==2] extract this column then save all the columns that contain this pre-requisite.

[R] Introducing lags in my GAM

2010-10-05 Thread Oscar Saenz de Miera
To whom it may concern, This is Oscar Saenz. I am working on my thesis and wanted to ask for your help. I am using R to estimate a Generalized Additive Model where the concentration of a specific pollutant is explained by a series of variables. I need to introduce a lag of the regressand in my

Re: [R] read columns of quoted numbers as factors

2010-10-05 Thread Mike Marchywka
From: pda...@gmail.com Date: Tue, 5 Oct 2010 13:25:52 +0200 To: j_hirsch...@yahoo.com CC: r-help@r-project.org Subject: Re: [R] read columns of quoted numbers as factors On Oct 4, 2010, at 18:39 , james hirschorn wrote: Suppose I have a data

Re: [R] subject: Log likelihood above 0

2010-10-05 Thread Ravi Varadhan
Likelihood is a function of the parameters, conditioned upon the data. It is not the same as a probability density function. Terms or factors which do not involve parameters can be omitted from the likelihood function. For continuous random variables, the density function can be in (0, Inf).

Re: [R] party with mob - parameter estimates not significant in terminal nodes

2010-10-05 Thread Achim Zeileis
Tudor: I successfully model-based partitioned several datasets through the use of mob from the party package (thanks Achim et al. once again !!!). At times, however, the partitioning leads to terminal nodes in which the parameter estimates of the model are not significant (although the split

Re: [R] subject: Log likelihood above 0

2010-10-05 Thread peter dalgaard
On Oct 5, 2010, at 15:36 , Ravi Varadhan wrote: Likelihood is a function of the parameters, conditioned upon the data. It is not the same as a probability density function. Terms or factors which do not involve parameters can be omitted from the likelihood function. For continuous

Re: [R] sweave output

2010-10-05 Thread Duncan Murdoch
On 05/10/2010 7:58 AM, Rubin, Norman wrote: I'm just starting to use sweave with latex and have a beginner question I expect this has been asked before - but I cannot seem to find the answer An input like: echo=false= X- 1:3 X @ Generates [1] 1 2 3 Is there a way to suppress the [1] ?

[R] R editor in ubuntu!

2010-10-05 Thread Mehdi Zarrei
Hello R-Users! I am looking for an editor to be able to execute commands into R in Linux ubuntu. Is there any suggestion? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] R editor in ubuntu!

2010-10-05 Thread Jonas Josefsson
I can recommend RKWard which is more than an editor but is great. There is also an option to patch gedit to send commands, but it was to much of a hassle to set up to be of interest to me at least. Jonas 2010-10-05 15:52, Mehdi Zarrei skrev: Hello R-Users! I am looking for an editor to be

Re: [R] R editor in ubuntu!

2010-10-05 Thread Dirk Eddelbuettel
On Tue, Oct 05, 2010 at 06:52:53AM -0700, Mehdi Zarrei wrote: I am looking for an editor to be able to execute commands into R in Linux ubuntu. Is there any suggestion? 1. See R FAQ, Section 6 at http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs and do 'apt-get install emacs23

Re: [R] subject: Log likelihood above 0

2010-10-05 Thread Ravi Varadhan
Yes, of course! So, the complete answer is: the log-likelihood can be in (-Inf, Inf), regardless of whether the random variable is continuous or discrete or mixed. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of

Re: [R] R editor in ubuntu!

2010-10-05 Thread Kjetil Halvorsen
emacs23+ess is great BUT there is a very large problem which is driving me away from it: (on ubuntu) since version 23, emacs has a very problematic bug, which I have reported as: bug#6193: emacs 23 in ubuntu 10.04 gnu linux: black lines overwrite text! but the emacs devs does'nt seem to respond.

[R] Barplot coloring problem

2010-10-05 Thread Mauluda Akhtar
 Hi I'm a new user of R. I've a table like the following.   bp_30049913 bp_30049953 bp_30049969 bp_30050044 bp_30048773 [1,]  31  48  30  14  23 [2,]  20  28  44  22  45 [3,]  49  17  29  

Re: [R] Barplot coloring problem

2010-10-05 Thread Henrique Dallazuanna
Try this: barplot(matrix(sample(5*4, 20), ncol = 5), col = rep(1:5, each = 4), beside = TRUE) On Tue, Oct 5, 2010 at 11:10 AM, Mauluda Akhtar maulud...@yahoo.com wrote: Hi I'm a new user of R. I've a table like the following. bp_30049913 bp_30049953 bp_30049969 bp_30050044

Re: [R] Introducing lags in my GAM

2010-10-05 Thread Simon Wood
I think that the problem is probably that y and lag(y,k=1) just get coerced back to numeric (i.e. their time-series attributes ar lost). So your model formula is equivalent to y~ + y, which is probably not what you wanted. If y is in time order, I would do something like bellver$y.1 -

Re: [R] R editor in ubuntu!

2010-10-05 Thread Laurent Gatto
Dear Kjetil, On 5 October 2010 15:12, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: emacs23+ess is great BUT there is a very large problem which is driving me away from it: (on ubuntu) since version 23, emacs has a very problematic bug, which I have reported as: bug#6193:

Re: [R] R doesn't want to update packages (Windows 7)

2010-10-05 Thread Dimitri Liakhovitski
Thnaks a lot, Duncan! Running R as administrator solved the problem! Dimitri On Tue, Oct 5, 2010 at 9:07 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote:  On 05/10/2010 8:58 AM, Dimitri Liakhovitski wrote: Hello! I've just installed R 2.11.1 on my new home PC. Just the base R. My PC has

Re: [R] R editor in ubuntu!

2010-10-05 Thread Kjetil Halvorsen
see below. On Tue, Oct 5, 2010 at 10:25 AM, Laurent Gatto laurent.ga...@gmail.com wrote: Dear Kjetil, On 5 October 2010 15:12, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: emacs23+ess is great BUT there is a very large problem which is driving me away from it: (on ubuntu)

[R] Linear Integration

2010-10-05 Thread Alaios
Hello I would like to calculate a weighted line integral. The integral is calculated by the cells that this lines trasverses (the small cells belong to matrix (m*n) that represent the value that a specific area has. I need to calculate the weights by finding out how much the line touches or

Re: [R] adding a legend to the plot (but outside of it)

2010-10-05 Thread Dimitri Liakhovitski
Thanks a lot, Thomas. May I ask 2 questions: 1. Is there a way to fill the legend rectangles with color (currently, they just contain a colored cross)? 2. Currently, my graph grabs the colors automatically (as I loop through var, it grabs col=all.colors[which(names(my.data) %in% var)]. I am

[R] is there a way to avoid traveling grid?

2010-10-05 Thread Dimitri Liakhovitski
Hello! If you run the whole code below, it'll produce a stacked diagram. And it looks good - because the tick-marks are aligned with the grid. However, if I stretch the graph window, grid becomes misaligned with the tickmarks. Or, rather, it seems aligned for the first and the last tick mark, but

Re: [R] R editor in ubuntu!

2010-10-05 Thread Christopher W Ryan
As an alternative to emacs-ess, you could try gedit with the R plugin. --Chris Ryan I am looking for an editor to be able to execute commands into R in Linux ubuntu. Is there any suggestion? [[alternative HTML version deleted]] __

Re: [R] R editor in ubuntu!

2010-10-05 Thread Laurent Gatto
On 5 October 2010 15:29, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: see below. On Tue, Oct 5, 2010 at 10:25 AM, Laurent Gatto laurent.ga...@gmail.com wrote: Dear Kjetil, On 5 October 2010 15:12, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: emacs23+ess is

Re: [R] R editor in ubuntu!

2010-10-05 Thread peter dalgaard
On Oct 5, 2010, at 16:29 , Kjetil Halvorsen wrote: see below. On Tue, Oct 5, 2010 at 10:25 AM, Laurent Gatto laurent.ga...@gmail.com wrote: Dear Kjetil, On 5 October 2010 15:12, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: emacs23+ess is great BUT there is a very large

Re: [R] adding a legend to the plot (but outside of it)

2010-10-05 Thread Thomas Stewart
Dimitri- Regarding question 1, it is the pch argument that controls the legend symbol. In my configuration, pch=15 gives a colored, filled-in box. To see the possible pch symbols, run the following code: plot(0,0,xlim=c(0,9), ylim=c(0,9),type=n, axes=F,xlab=,ylab=) for(i in 0:9){ for(j in

Re: [R] is there a way to avoid traveling grid?

2010-10-05 Thread Barry Rowlingson
On Tue, Oct 5, 2010 at 3:37 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: my.data$date I wouldn't use grid - it suggests you try abline, so something like: abline(v=my.data$date,lty=2) - to put vertical lines at your data points. For the horizontal grid lines, we can just

[R] nonlinear curve fit of an implicit function

2010-10-05 Thread Schmitt, H. (Heike)
Hello, I want to perform a nonlinear curve fit in order to obtain parameter estimates from experimentally determined data (y in dependence of x), but with an implicit function, thus, a function of which I cannot isolate y on the left-hand side of the equation. As far as I understand, the

Re: [R] adding a legend to the plot (but outside of it)

2010-10-05 Thread Dimitri Liakhovitski
THanks a lot, Thomas - I am 100% clear on the legend symbol now, very helpful. With legend colors - I just tried to have more colors in all.colors than there are variables to plot on the graph. Did it on purpose - so that there are always more colors to pick from. But if I do names(my.data) -

Re: [R] is there a way to avoid traveling grid?

2010-10-05 Thread Dimitri Liakhovitski
Barry - thanks a lot, it's great. Now, the gridlines stick to the tick marks! Just wondering why the product of grid does not. D. On Tue, Oct 5, 2010 at 11:07 AM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Tue, Oct 5, 2010 at 3:37 PM, Dimitri Liakhovitski

Re: [R] R-help

2010-10-05 Thread Dennis Murphy
Hi: This problem is a useful lesson in the power of vectorizing calculations in R. A remanufacturing of your function: dubloop - function(nsim) { count - 0 for(j in 1:nsim){ #begin loop die1 - sample(1:6,1) die2 - sample(1:6,1) if(die1 ==

Re: [R] is there a way to avoid traveling grid?

2010-10-05 Thread ONKELINX, Thierry
Dear Dimitri, Ggplot2 solves your problem with the gridlines and requires much less code. You only need to reshape your data somewhat. library(ggplot2) #changing the dataset my.data2 - my.data my.data2$x - my.data$x + my.data$a my.data2$z - my.data$y + my.data$z Molten2 - melt(my.data2, id.vars

Re: [R] Extract summary stats to table

2010-10-05 Thread Greg Snow
Write a function that does your analysis and returns the values of interest in a vector. Then run the function multiple times using replicate or sapply and the results will be put into a matrix for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

[R] reshape not using as id vars what it is supposed to be using?

2010-10-05 Thread Dimitri Liakhovitski
Hellow! I am replicating the example givien in Reshaping Data with the reshape Package (http://www.jstatsoft.org/v21/i12 - see download link on the right), p. 2-3. library(reshape) data(smiths) str(smiths) The text says: If you specify only one of measured and identifier variables, melt assumes

Re: [R] R-help

2010-10-05 Thread Mike Marchywka
Date: Tue, 5 Oct 2010 08:18:10 -0700 From: djmu...@gmail.com To: tott...@yahoo.com CC: r-help@r-project.org Subject: Re: [R] R-help Hi: This problem is a useful lesson in the power of vectorizing calculations in R. A remanufacturing of

[R] loess and NA

2010-10-05 Thread Filoche
Hi everyone. I'm trying to do a loess with missing value on independant variable. doc = c(2.27904, 2.59536, 7.44696, NA, 6.24264, 4.58400, 5.79192, 5.39502, 7.41216, 4.09440, 4.22868, 4.24620, 5.43804, 1.95528); distance = c(26.5,56.5, 90.3, 123.0, 147.5, 176.0, 215.7, 229.3, 252.0, 325.3,

Re: [R] Make a loop more efficient

2010-10-05 Thread Filoche
Hi there. One more thing you could try is to avoid evaluation of length(CRX) every loop. Assign the length to a variable before the loop. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Make-a-loop-more-efficient-tp2955912p2956274.html Sent from the R help

[R] Ordering Duplicates for Selection

2010-10-05 Thread C C
Hi all, I've found a lot of helpful info regarding identifying and deleting duplicates but I'd like to do something a little different - I'd like to identify the duplicate values but instead of deletion, label them with a value. I am working with historical data regarding school courses:

Re: [R] R editor in ubuntu!

2010-10-05 Thread Liviu Andronic
On Tue, Oct 5, 2010 at 5:43 PM, Christopher W Ryan cr...@binghamton.edu wrote: As an alternative to emacs-ess, you could try gedit with the R plugin. Another alternative is to use Geany [1]. It would save you the trouble of learning Emacs, and I find it better designed for code editing than

Re: [R] R doesn't want to update packages (Windows 7)

2010-10-05 Thread Prof Brian Ripley
See http://cran.r-project.org/bin/windows/base/rw-FAQ.html#Does-R-run-under-Windows-Vista_003f which does cover this. Most likely you need to 'Run as Administrator'. There's lot of other useful information in that FAQ that you would do to familiarize yourself with. On Tue, 5 Oct 2010,

Re: [R] nonlinear curve fit of an implicit function

2010-10-05 Thread Ravi Varadhan
You can solve this as a (nonlinearly) constrained optimization problem: Given: x, y.obs; both in R^n Minimize the objective function: sum( (y - y.obs)^2 ) where `y' is such that it satisfies the constraints: (A+B+C)*log((B+C+y)/C)-A*log((B-y)/B)=(B+C)*D*x Do you have other constraints on

Re: [R] R editor in ubuntu!

2010-10-05 Thread Liviu Andronic
On Tue, Oct 5, 2010 at 4:52 PM, Mehdi Zarrei gagzar...@yahoo.com wrote: I am looking for an editor to be able to execute commands into R in Linux ubuntu. Is there any suggestion? There is a wiki page on the subject [1]. Everyone: Please contribute your favorite editor to that list. Regards

[R] r-help@r-project.org

2010-10-05 Thread wenyue sun
*Dear All, * ** *I want to install tar.gz in R on a Windows operating system. I know that R in Win accepts packages in zip file for installation. Therefore, I**tried to decompress the tar.gz file and create a zip file using 7zip but the installation of the resulting zip files didn't work. Can

[R] instal tar.gz package on windows, help

2010-10-05 Thread wenyue sun
*Dear All, * ** *I want to install a tar.gz package in R on a windows operating system. Since R in Windows accepts only packages in zip file for installation, I tried to decompress the tar.gz file and create a zip file using 7 zip for a subsequent installation, yet this didn't work. Can anyone

Re: [R] is there a way to avoid traveling grid?

2010-10-05 Thread Dimitri Liakhovitski
Thierry, your ggplot solution really looks great and very parsimonious! May I ask a couple of questions? 1. Is there a way to make the grid appear on top of the colored areas instead of under them - like I did in the plot solution? 2. In your code line Molten2$variable - factor(Molten2$variable,

Re: [R] R editor in ubuntu!

2010-10-05 Thread Erik Iverson
Another alternative is to use Geany [1]. It would save you the trouble of learning Emacs, /s/save/deprive /s/trouble/thrill :) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] r-help@r-project.org

2010-10-05 Thread Erik Iverson
1) Please use an informative subject line 2) The answer may depend on the package, and can be easy to difficult. Which package are you trying to install? wenyue sun wrote: *Dear All, * ** *I want to install tar.gz in R on a Windows operating system. I know that R in Win accepts packages

Re: [R] Ordering Duplicates for Selection

2010-10-05 Thread jim holtman
Here is a way of putting Order on your data: x V1 V2 V3 V4 V5 1 1 12345678 Soc101 34 02-04-2003 2 2 12345678 Soc101 62 31-11-2004 3 3 12345678 Psy104 63 03-05-2003 4 4 23456789 Soc101 73 02-04-2003 5 5 23456789 Psy104 76 25-02-2004 x$order - ave(x$V1, x$V2, x$V3,

[R] Question about assigning values in a matrix, conditional on column first row; how to do the loop.

2010-10-05 Thread Paula Fergnani Salvia
Hello, I’m new at programming and I will greatly appreciate if you can help me with this. I have a very large matrix (hundreds of rows and columns), with the first raw filled with different numbers (between 0 and 1). The rest of the matrix is filled with values 0, 1, 2. What I need is to

Re: [R] r-help@r-project.org

2010-10-05 Thread Uwe Ligges
On 05.10.2010 17:51, Erik Iverson wrote: 1) Please use an informative subject line 2) The answer may depend on the package, and can be easy to difficult. Which package are you trying to install? In any case, the answer is in the manual R Installation and Administration. Uwe Ligges

Re: [R] R-help

2010-10-05 Thread Greg Snow
I would do it like this: library(TeachingDemos) tmp - dice(1, 2) with(tmp, c(sum(Red==Green),mean(Red==Green)) ) plot(head(tmp,28)) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] nonlinear curve fit of an implicit function

2010-10-05 Thread Ravi Varadhan
Note that we now have a constrained optimization problem in (n + 3) variables: y, A, B, and C; but we also have `n' constraints among these n+3 variables. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric

Re: [R] SVM functions

2010-10-05 Thread Uwe Ligges
Probably you do not have svmlight installed on your machine. Uwe Ligges On 05.10.2010 12:42, Neeti wrote: Hi ! Right now I am learning to use svm functions available in R and trying to use these function with given example. I was stuck with svmlight function which is available in klaR

Re: [R] Question about assigning values in a matrix, conditional on column first row; how to do the loop.

2010-10-05 Thread jim holtman
try this: matr [,1] [,2] [1,] 0.1 0.5 [2,] 1.0 1.0 [3,] 0.0 2.0 [4,] 2.0 2.0 result - apply(matr[-1,], 1, function(.row){ + ifelse(.row == 2, matr[1,], -999) + }) # data back together rbind(matr[1,], t(result)) [,1] [,2] [1,]0.10.5 [2,] -999.0 -999.0 [3,]

Re: [R] reshape not using as id vars what it is supposed to be using?

2010-10-05 Thread Ista Zahn
Hi Dimitri, The argument names may have changed. Notice that melt.data.frame(smiths, measured = c(age, weight, height)) gives a message saying Using subject as id variables. This is because measured variables need to be specified as measure.vars (or an abbreviation of that: even m will work

Re: [R] Error during scp transfer

2010-10-05 Thread Uwe Ligges
We really cannot help to solve your ssh problems. Uwe Ligges On 04.10.2010 18:06, wesley mathew wrote: Dear all I am implement one grid computing system using GridR package. I am working on windows platform. I did all the configuration according to the GridR tutorial. But it has some

Re: [R] SVM functions

2010-10-05 Thread Neeti
It would be nice if you suggest me the steps to check whether svmlight is present in my system or not? -- View this message in context: http://r.789695.n4.nabble.com/SVM-functions-tp2955768p2956384.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Read file

2010-10-05 Thread Nilza BARROS
Dear Gabor and Jim You both gave me amazing solutions. I will use. Thanks! Nilza On Tue, Oct 5, 2010 at 2:11 AM, Gabor Grothendieck ggrothendi...@gmail.comwrote: On Sat, Oct 2, 2010 at 11:31 PM, Nilza BARROS nilzabar...@gmail.com wrote: Dear R-users, I would like to know how could I read

Re: [R] SVM functions

2010-10-05 Thread Uwe Ligges
On 05.10.2010 18:19, Neeti wrote: It would be nice if you suggest me the steps to check whether svmlight is present in my system or not? If you have not installed it, it is probably not present yet. How to check it: Well, that depends on your OS that is unstated so far. Asking a search

[R] estimate intrinsic dimension

2010-10-05 Thread Jack Siegrist
Does anyone know of any packages or have any loose code for estimating the intrinsic dimension of a data set? Thanks for any leads, Jack -- View this message in context: http://r.789695.n4.nabble.com/estimate-intrinsic-dimension-tp2956401p2956401.html Sent from the R help mailing list

Re: [R] R doesn't want to update packages (Windows 7)

2010-10-05 Thread Henrik Bengtsson
Just to clarify to the OP (and please correct me if I'm wrong), having to run as admin should only be needed when you have to *update* (update.packages()) the so called recommend packages (comes with R) that sits under 'Program Files'. If you don't run as admin and try to *install*

  1   2   >