Re: [R] can't find and install reshape2??

2010-10-12 Thread chris howden
Hi Guys, Thanks for your suggestions and sorry for the delay in replying, I've been having one of those weeks. I feel a little silly not trying the package name input as a character string, I should have know that. However I have tried your suggestions and neither worked. The code and error

Re: [R] can't find and install reshape2??

2010-10-12 Thread chris howden
Just wanted to say that I've gone onto the CRAN website and downloaded it directly from there. So its no longer a problem for me. But it may be one for other people, it is kinda weird I couldn't see it on the list of packages on 4 mirrors!! Thanks for your help though. -Original

[R] merging and working with BIG data sets. Is sqldf the best way??

2010-10-12 Thread Chris Howden
Hi everyone, I’m working with some very big datasets (each dataset has 11 million rows and 2 columns). My first step is to merge all my individual data sets together (I have about 20) I’m using the following command from sqldf data1 - sqldf(select A.*, B.* from A inner join B

Re: [R] merging and working with BIG data sets. Is sqldf the best way??

2010-10-12 Thread Jeff Newmiller
Chris Howden wrote: Hi everyone, I’m working with some very big datasets (each dataset has 11 million rows and 2 columns). My first step is to merge all my individual data sets together (I have about 20) I’m using the following command from sqldf data1 - sqldf(select A.*, B.*

Re: [R] Extracting data subset for plot

2010-10-12 Thread Gavin Simpson
On Tue, 2010-10-12 at 11:44 +0800, elaine kuo wrote: Dear list, I want to make a plot based on the following information, using the command plot. variable A for x axis : temperature (range: -20 degrees to 40 degree) variable B for y axis : altitude (range: 50 m to 2500 m ) Use the

Re: [R] can't find and install reshape2??

2010-10-12 Thread Uwe Ligges
My guess is you are using an outdated R version for which the rather new reshape2 package has not been compiled. Uwe Ligges On 12.10.2010 08:23, chris howden wrote: Just wanted to say that I've gone onto the CRAN website and downloaded it directly from there. So its no longer a problem for

Re: [R] Help with STL function to decompose

2010-10-12 Thread Dennis Murphy
Hi: Try str(u.ts) class(u.ts) That should give you more information about the type of object being input to stl. I tried the following, which worked on my system: u - rnorm(100) u.ts - ts(u, start = c(2001, 1), frequency = 12) u.stl - stl(u.ts, 'per') plot(u.stl) sessionInfo() R version

[R] clustered data in wilcox_test

2010-10-12 Thread Devin M. Caughey
Dear all, I have R code of the following form: wilcox_test(categoricalResponse ~ binaryTreatment | matchedCluster) The data consist of 11 matched pairs of clusters, each of which contains a variable number of units on which the response variable is measured. Treatment, however, was assigned

[R] Rpart query

2010-10-12 Thread jagdeesh_mn
Hi, Being a novice this is my first usage of R. I am trying to use rpart for building a decision tree in R. And I have the following dataframe Outlook TempHumidityWindy Class Sunny 75 70 Yes Play Sunny 80 90 Yes Don't Play Sunny 85 85

[R] GLM Gamma Regression error message in R

2010-10-12 Thread Stratos Laskarides
Dear Madam/Sir This may be quite a long shot... By way of intro, I am a masters student in actuarial science at the University of Cape Town, and I am doing a project in R on some healthcare cost data. During my coding in R I encountered an error message, which I then googled, but I am still

[R] fast rowCumsums wanted for calculating the cdf

2010-10-12 Thread Gregor
Dear all, I am struggling with a (currently) cost-intensive problem: calculating the (non-normalized) cumulative distribution function, given the (non-normalized) probabilities. something like: probs - t(matrix(rep(1:100),nrow=10)) # matrix with row-wise probabilites F - t(apply(probs, 1,

Re: [R] filled.contour: colour key decoupled from main plot?

2010-10-12 Thread Panos Hadjinicolaou
I have solved it by modifying the filled.contour function: added another parameter (e.g. key.levels) in the argument list (and accordingly in the function statements used to plot the legend) to decouple the colour key colour bars length from the main plot. key.levels is a vector with equally

Re: [R] Rpart query

2010-10-12 Thread Joel
Dont know if it will work but you can try ctree from the party package require(party) bla - ctree(Class ~ Outlook + Temp + Humidity + Windy, data=dataframe) plot(bla) //Joel -- View this message in context: http://r.789695.n4.nabble.com/Rpart-query-tp2991198p2991417.html Sent from the R help

Re: [R] can't find and install reshape2??

2010-10-12 Thread Bernardo Rangel Tura
On Mon, 2010-10-04 at 10:27 +0930, Chris Howden wrote: Hi everyone, Im trying to install reshape2. But when I click on install package its not coming up!?!?! Im getting reshape, but no reshape2? Ive also tried download.packages(reshape2, destdir=c:\\)

Re: [R] Rpart query

2010-10-12 Thread Joel
My guess is that you have two few observations is your dataset for rpart to determin a safe dissision. -- View this message in context: http://r.789695.n4.nabble.com/Rpart-query-tp2991198p2991461.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Rpart query

2010-10-12 Thread Joel
Or now Im pretty sure of it as when I took your dataset and used the magic way of ctrl-c ctrl-v to make some more observations I get a decision tree. -- View this message in context: http://r.789695.n4.nabble.com/Rpart-query-tp2991198p2991469.html Sent from the R help mailing list archive at

[R] Read from a website

2010-10-12 Thread Santosh Srinivas
Something similar to this was discussed recently, but I'm unable to find the thread. I want to read from a site where I need to enter the date into a form before I am presented with the CSV link. E.g. like reading ticker data from yahoo (but assuming you HAVE to enter the dates and click on

[R] Factors in an regression using lm()

2010-10-12 Thread Gabriel Bergin
Hi, I am trying to do a multiple regression on the dataset Hdma, available in the Ecdat package. The data looks like this: str(Hdma) 'data.frame': 2381 obs. of 13 variables: $ dir: num 0.221 0.265 0.372 0.32 0.36 ... $ hir: num 0.221 0.265 0.248 0.25 0.35 ... $ lvr

Re: [R] Rpart query

2010-10-12 Thread Achim Zeileis
On Mon, 11 Oct 2010, jagdeesh_mn wrote: Hi, Being a novice this is my first usage of R. I am trying to use rpart for building a decision tree in R. And I have the following dataframe Outlook TempHumidityWindy Class Sunny 75 70 Yes Play Sunny 80 90

[R] GEE with user-specified link function

2010-10-12 Thread Kun Liu
Hello, I would like to try to fit a GEE with user-specified link function. I read through a couple of thread on the list, for example http://tolstoy.newcastle.edu.au/R/help/04/12/9768.html#start and http://tolstoy.newcastle.edu.au/R/help/06/04/25298.html. I noticed that they are all 6 or

Re: [R] Factors in an regression using lm()

2010-10-12 Thread ONKELINX, Thierry
The problem is not in the covariates but in the respons variable. lm() can only handle numerical variables. Deny is a factor, hence you get an error. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] Factors in an regression using lm()

2010-10-12 Thread Ivan Calandra
Hi, Your response (dependent) variable, which has to be on the left side of the '~' in the formula, should be numeric. In your example deny is a factor; first problem The explaining variables, on the right side of the '~', should be factors. Here, hir, dir, css and mcs are numeric; second

[R] Bootstrapping Krippendorff's alpha coefficient

2010-10-12 Thread Łukasz Ręcławowicz
Hi, I don't know how to sample such data, it can't be done by row sampling as default method on matrix in boot. Function takes matrix and returns single coefficient. #There is a macro but I want use R :) http://www.comm.ohio-state.edu/ahayes/SPSS%20programs/kalphav2_1.SPS library(concord)

Re: [R] Factors in an regression using lm()

2010-10-12 Thread Ivan Calandra
Oops, my bad. I rarely do regression, so I forgot that in your case the explaining variables do not have to be factors. The rest stands. Ivan Le 10/12/2010 11:56, Ivan Calandra a écrit : Hi, Your response (dependent) variable, which has to be on the left side of the '~' in the formula,

Re: [R] Memory limit problem

2010-10-12 Thread Rubén Roa
Hi, Probably Windows cann't allocate enough contiguous free space. Try this: Find boot.ini (usually at the root c:\) Without changing anything else, add this line at the end of the script: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=Microsoft Windows XP Professional 3GB /3GB /noexecute=optin

Re: [R] nnet support

2010-10-12 Thread Raji
A book/online link with an example for all the parameters that are used in nnet would help in understanding the package better. -- View this message in context: http://r.789695.n4.nabble.com/nnet-support-tp840467p2991572.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] GEE with user-specified link function

2010-10-12 Thread Søren Højsgaard
For geepack there are no facilities for user defined link functions. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] P#229; vegne af Kun Liu [victo...@hotmail.co.uk] Sendt: 12. oktober 2010 11:50 Til: r-help@r-project.org

[R] help in nnet

2010-10-12 Thread Raji
Hi R_helpers, i am learning neural networks and trying out using the nnet package in R. R has other packages like AMORE,Qrnn,nnet and monmlp. Can you suggest which package is the most used ? -- View this message in context: http://r.789695.n4.nabble.com/help-in-nnet-tp2991615p2991615.html Sent

[R] R Profiling

2010-10-12 Thread Lorenzo Isella
Dear All, I need to do some very basic R profiling, something along the lines of: run this whole script five times and return the average completion time. I do not want (at this stage) delve into the details of the percentage of the time spent in which function and doing what. Which tools

[R] non-numerical values as input using nnet

2010-10-12 Thread Raji
Hi R-helpers , am trying out nnet package in R. Does nnet package work only for numerical values as inputs? Can somebody give an insight on how categorical values as inputs are handled using nnet in r with an example? Thanks in advance for your help. -- View this message in context:

Re: [R] Nonlinear Regression Parameter Shared Across Multiple Data Sets

2010-10-12 Thread Keith Jewell
Jared Blashka evilamaran...@gmail.com wrote in message news:aanlktinffmudugqnkudvr=fmf0wrrtsbjxjexuki_...@mail.gmail.com... I'm working with 3 different data sets and applying this non-linear regression formula to each of them. nls(Y ~ (upper)/(1+10^(X-LOGEC50)), data=std_no_outliers,

Re: [R] non-numerical values as input using nnet

2010-10-12 Thread Łukasz Ręcławowicz
Response can be (?multinom) factor (?as.factor), while predictors (don't know, but i think not) can be turned into numbers via varius distance measures. -- Miłego dnia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] delta AIC for models with 2 variables using MuMIn

2010-10-12 Thread elaine kuo
Dear List, I want to ask a AIC question based on package library(MuMIn) The relative importance of 16 explanatory variables are assessed using delta AIC in a generalized linear model. Please kindly advise if it is possible to show models with any two only certain variables. Thank you.

Re: [R] nnet support

2010-10-12 Thread Uwe Ligges
On 12.10.2010 12:24, Raji wrote: A book/online link with an example for all the parameters that are used in nnet would help in understanding the package better. What about starting with the references given in the nnet help, both written by the author of the package? Ripley, B. D. (1996)

Re: [R] help in nnet

2010-10-12 Thread Uwe Ligges
On 12.10.2010 12:53, Raji wrote: Hi R_helpers, i am learning neural networks and trying out using the nnet package in R. R has other packages like AMORE,Qrnn,nnet and monmlp. Can you suggest which package is the most used ? The real question is which one is more appropriate for the tasks

Re: [R] running R script on linux server

2010-10-12 Thread Uwe Ligges
On 12.10.2010 00:55, Lorenzo Cattarino wrote: Hi R-users, I have a problem running my R code on a Linux cluster. What I did was write a .pbs file to instruct the cluster on what to do and how: #!/bin/sh #PBS -m ae #PBS -M uqlca...@uq.edu.au #PBS -A uq-CSER #PBS -N job1_lollo #PBS

Re: [R] non-numerical values as input using nnet

2010-10-12 Thread Raji
Thanks Łukasz.My dataset has 5 columns in which first 3 are numerical , the 4th is a name and 5th is a number(sales).I am trying to use nnet to predict the sales based on the other 4 parameters.The nnet takes each name value as an input. How does nnet take the name value as? -- View this message

Re: [R] random number; was: Question

2010-10-12 Thread Uwe Ligges
If this is about (pseudo) random number generation (yes, please use a sensible subject line). See ?set.seed, ?runif, ?rnorm to get started. Uwe Ligges On 11.10.2010 19:32, Margaretta 2014 wrote: Hello. I would be very grateful if you could help me in using R. I need R commands of pseudo

Re: [R] nnet support

2010-10-12 Thread Raji
The references have enough information about the package. But, understanding each parameter of nnet would be easier if there is an example for its usage.For example , how to give contrasts, an example with linear outputs etc. -- View this message in context:

Re: [R] Rpart query

2010-10-12 Thread jagdeesh_mn
@Above, Thanks. That certainly helps. I understand that the rpart splits only in binary. Is there any support in R to make the split have more than 2 nodes? Cheers, Jagdeesh -- View this message in context: http://r.789695.n4.nabble.com/Rpart-query-tp2991198p2991643.html Sent from the R help

Re: [R] Rpart query

2010-10-12 Thread jagdeesh_mn
Here is the complete dataset: Outlook TempHumidityWindy Class Sunny 2 2 Yes Play Sunny 2 1 Yes Don't Play Sunny 3 1 No Don't Play Sunny 2 1 No Don't Play Sunny 1 2 No Play Overcast

Re: [R] help in nnet

2010-10-12 Thread Raji
Sorry.The neural networks would be used for classification, regression mostly with both numerical and non-numerical inputs. -- View this message in context: http://r.789695.n4.nabble.com/help-using-neural-networks-in-R-tp2991615p2991701.html Sent from the R help mailing list archive at

Re: [R] merging and working with big data sets

2010-10-12 Thread Jay Emerson
I can't speak for ff and filehash, but bigmemory's data structure doesn't allow clever merges (for actually good reasons). However, it is still probably less painful (and faster) than other options, though we don't implement it: we leave it to the user because details may vary depending on the

Re: [R] R Profiling

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 7:04 AM, Lorenzo Isella wrote: Dear All, I need to do some very basic R profiling, something along the lines of: run this whole script five times and return the average completion time. I do not want (at this stage) delve into the details of the percentage of the time

Re: [R] R Profiling

2010-10-12 Thread jim holtman
You can use 'system.time' to determine the elapsed and CPU time used. Here is an example of repeating a script 10 times: replicate(10, system.time({ + for (i in 1:1) x runif(1) + })) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] user.self 0.09 0.06 0.07 0.06 0.08 0.07

[R] graphics layout

2010-10-12 Thread Murali.Menon
Folks, I'm battling the layout() functionality in graphics, and getting a bit mixed up. I'd like to create subscreens like so: _ _ | | | |1|2| |_| | | | | |3|4| |_|_| |

Re: [R] delta AIC for models with 2 variables using MuMIn

2010-10-12 Thread Gavin Simpson
On Tue, 2010-10-12 at 19:37 +0800, elaine kuo wrote: Dear List, I want to ask a AIC question based on package library(MuMIn) The relative importance of 16 explanatory variables are assessed using delta AIC in a generalized linear model. Please kindly advise if it is possible to show

Re: [R] graphics layout

2010-10-12 Thread Eik Vettorazzi
Hi Murali try nf - layout(matrix(c(1:5,6,5,7,5,8), ncol=2, byrow=TRUE), heights=c(1,1,rep(1/3,3)),respect=TRUE) layout.show(nf) hth. Am 12.10.2010 14:19, schrieb murali.me...@avivainvestors.com: Folks, I'm battling the layout() functionality in graphics, and getting a bit mixed up. I'd

Re: [R] graphics layout

2010-10-12 Thread Murali.Menon
Hiya, Thanks for this. It's the height parameters that baffle me. Why are they 1, 1, 1/3, 1/3, 1/3? Which subscreens do these heights correspond to? I did it like this: nf - layout(cbind(c(1,1,1,3,3,3,5,5,5),c(2,2,2,4,4,4,6,7,8))) mainly because I'm not clear about how the heights work.

Re: [R] GLM Gamma Regression error message in R

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 3:51 AM, Stratos Laskarides wrote: Dear Madam/Sir This may be quite a long shot... By way of intro, I am a masters student in actuarial science at the University of Cape Town, and I am doing a project in R on some healthcare cost data. During my coding in R I

Re: [R] graphics layout

2010-10-12 Thread Ben Bolker
Murali.Menon at avivainvestors.com writes: Thanks for this. It's the height parameters that baffle me. Why are they 1, 1, 1/3, 1/3, 1/3? Which subscreens do these heights correspond to? They are relative heights. The top two vertical layers are equal heights, and the bottom three

[R] Linear Regression

2010-10-12 Thread Vittorio Colagrande
Dear R-group, We have begun to use it for teaching Statistics. In this context we have run into a problem with linear regression where we found the results of are confusing. Specifically, considering the data: x=c(4,5,6,3,7,8,10,14,13,15,6,7,8,10,11,4,5,17,12,11) y=c(rep(7,20)) and

Re: [R] Linear Regression

2010-10-12 Thread ONKELINX, Thierry
Dear Vittorio, Notice that anova(regress) gives a warning: ANOVA F-tests on an essentially perfect fit are unreliable Maybe summary(regress) should give a similar warning in case of a perfect fit. Allthough you should notice that the residual standard error displayed by summary() is extremly

[R] Data conversion from class asc to class kasc (Adehabitat)

2010-10-12 Thread Neba Funwi-Gabga
Hello list, I am trying to do an Ecological Niche Factor Analysis using the adehabitat package, but I am facing problems with preparing my covariates for input. The covariates are of class asc and i need to get them to class kasc using the as.kasc function. But when I try to create the list, I get

Re: [R] Linear Regression

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 9:01 AM, Vittorio Colagrande wrote: Dear R-group, We have begun to use it for teaching Statistics. In this context we have run into a problem with linear regression where we found the results of are confusing. Specifically, considering the data:

[R] New R User Group in Toronto

2010-10-12 Thread Guelman, Leo
Dear R users, I'm pleased to announce that the Greater Toronto Area (GTA) user's group is now active on meetup.com, and taking suggestions for the first meeting. If you are on the region, you can sign-up now at the link below http://www.meetup.com/Greater-Toronto-Area-GTA-R-Users-Group This

[R] append rows to Sybase datatable using RJDBC

2010-10-12 Thread Li, Jing Yi
Hi, Does anyone have experience using RJDBC library to write to Sybase datatable? The jdbc driver I am using is jConnect 6.0. I can successfully write into a new datatable, but have problem appending rows to existing one. It either complains Table *** already exists or simply overwrite the

Re: [R] append rows to Sybase datatable using RJDBC

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 9:51 AM, Li, Jing Yi wrote: Hi, Does anyone have experience using RJDBC library to write to Sybase datatable? The jdbc driver I am using is jConnect 6.0. I can successfully write into a new datatable, but have problem appending rows to existing one. It either complains

[R] F cumulative distribution function

2010-10-12 Thread Hsih-Te Yang
Dear Sir or Madam: Dose anyone know the R function which corresponds to fcdf, a F cumulative distribution function of Matlab? http://esra.univ-paris1.fr/matlab5/toolbox/stats/fcdf.html Please guide me how to get this function if it is available. . or code it ab

Re: [R] append rows to Sybase datatable using RJDBC

2010-10-12 Thread Li, Jing Yi
yes. c(T,F) does return [1] TRUE FALSE -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Tuesday, October 12, 2010 10:00 AM To: Li, Jing Yi Cc: r-help@r-project.org Subject: Re: [R] append rows to Sybase datatable using RJDBC On Oct 12, 2010, at 9:51 AM,

Re: [R] F cumulative distribution function

2010-10-12 Thread ONKELINX, Thierry
Have a look at qf() and pf() HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and Forest

Re: [R] F cumulative distribution function

2010-10-12 Thread Ted Harding
On 12-Oct-10 13:49:07, Hsih-Te Yang wrote: Dear Sir or Madam: Dose anyone know the R function which corresponds to fcdf, a F cumulative distribution function of Matlab? http://esra.univ-paris1.fr/matlab5/toolbox/stats/fcdf.html Please guide me how to get this function if it is available.

Re: [R] F cumulative distribution function

2010-10-12 Thread Eik Vettorazzi
Hi, see ?pf Generally in R '(d/p/q/r)distribution' stands for density, cdf, quantiles and random numbers for a given distribution as norm, t, unif, chisq etc hth Am 12.10.2010 15:49, schrieb Hsih-Te Yang: Dear Sir or Madam: Dose anyone know the R function which corresponds to fcdf, a F

[R] repeatability/intraclass with nested levels

2010-10-12 Thread Nevil Amos
I have a spectrophotometric dataset with repeated measures of a value at 200 wavelengths for each of 150 individuals. I would like to use the repeated samples to at each wavelength to look at measurement/observer error, compared to difference between individuals error I have looked at

[R] heatmap

2010-10-12 Thread l.mohammadikhankahdani
Hi All Has anyone used correlation (Pearson or cosine or others) for clustering in heatmaps? If so, could you please tell me how? Thanks Leila __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] repeatability/intraclass with nested levels

2010-10-12 Thread Bert Gunter
This is an example of what is commonly known as functional data analysis, or fda for short. You can search on this term to learn more. R has an fda package that deals with this sort of data -- and very likely others besides: essentially you have a 200-d response vector and so require a

[R] general construction of 'all pairwise comparison' contrast in ANOVA

2010-10-12 Thread Michael Hopkins
Hi R people I am using regsubsets() to fit large numbers of models and collect summary statistics in order to perform a Bayesian analysis of multi-way ANOVA with specific prior information. In general the variables have differing numbers of levels =2. This works well but with variable of

[R] List or matrix of object

2010-10-12 Thread Filoche
Hi everyone. Is it possible in R to create a matrix or a list (vector) or R object. For instance, I have f1 - function(x) sqrt(x%*%x); f2 - function(x) (2x+1); I would like to do something like L - List(); L[1] = f1; L[2] = f2; So, is there a way to create matrix or vector that can contains

Re: [R] can't find and install reshape2??

2010-10-12 Thread Hadley Wickham
My guess is you are using an outdated R version for which the rather new reshape2 package has not been compiled. I wonder if install.packages() could detect this case (e.g. by also checking if the source version is not available), and offer a more informative error message. Hadley --

Re: [R] Is there a regression surface demo?

2010-10-12 Thread Greg Snow
For another approach you might want to look at Predict.Plot and TkPredict from the TeachingDemos package. The code from those could be adapted to do 3d plots. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] compare histograms

2010-10-12 Thread Greg Snow
That depends a lot on what you mean by the histograms being equivalent. You could just plot them and compare visually. It may be easier to compare them if you plot density estimates rather than histograms. Even better would be to do a qqplot comparing the 2 sets of data rather than the

Re: [R] Extracting data subset for plot

2010-10-12 Thread Greg Snow
If you just want to limit the plot, then specify xlim and ylim in the plot call and everything outside of those ranges will be silently ignored in the plotting. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] nnet support

2010-10-12 Thread Greg Snow
The nnet package is a support package (along with MASS and others) for a book. My guess is that book would be the best place to start. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] List or matrix of object

2010-10-12 Thread jim holtman
You probably need to review the Intro to R to understand indexing: f1 - function(x) sqrt(x%*%x); f2 - function(x) (2*x+1); L - list() L[[1]] - f1 L[[2]] - f2 L # contains the objects [[1]] function (x) sqrt(x %*% x) [[2]] function (x) (2 * x + 1) L[[1]](3) # now call the functions in

Re: [R] List or matrix of object

2010-10-12 Thread Greg Snow
It is not clear exactly what you are trying to do, but this works: f1 - function(x) sqrt(x%*%x) f2 - function(x) {2*x+1} L - list(); L[[1]] = f1; L[[2]] = f2; Then you can do something like: L[[2]](5) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [R] List or matrix of object

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 11:17 AM, Filoche wrote: Hi everyone. Is it possible in R to create a matrix or a list (vector) or R object. For instance, I have f1 - function(x) sqrt(x%*%x); f2 - function(x) (2x+1); I would like to do something like L - List(); L[1] = f1; L[2] = f2; You should

[R] R optimization and curve()?

2010-10-12 Thread jcress410
I'm trying to figure out how to plot basic utility maximization results with R, Ideally I'd like to plot the value of u through x1,x2 space, so you can graph income / substitution effects easily... also, it'd be nice if I could put a linear budget constraint on the graph here's an example

[R] (no subject)

2010-10-12 Thread davidius fyske
To Whom It may Concern, I am *very* new to R so no answer can be too explicit or step-by-step. I have to plot make a Normal quantile graph for a data set that looks like this:density5.55.614.885.075.265.555.365.295.585.655.575.535.625.295.445.345.795.15.275.395.425.475.635.345.465.35.755.685.85

Re: [R] List or matrix of object

2010-10-12 Thread Filoche
Hi again everyone. I found I could use a list with l = list() l[[1]] = myObj instead of l[1] = myObj Anyone can explain me why the use of double [] is required? Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/List-or-matrix-of-object-tp2992101p2992121.html

[R] Lattice::bwplot unexpected behaviour when using vector of colors

2010-10-12 Thread Mehrdad Shamsi
Hi, I posted this message on R-devel, but it seems to be more suitable for R-help. So I post it here again. I'm trying to produce colored boxplots using lattice::bwplot function. I need to plot each boxplot in the panel with a specific color. Naturally, I used a vector of colors and expected

[R] need help with nnet

2010-10-12 Thread Changbin Du
HI, Dear R community, My data set has 2409 variables, the last one is response variable. I have used the nnet after feature selection and works. But this time, I am using nnet to fit a model without feature selection. I got the following error information: dim(train) [1] 1827 2409

[R] Displaying a variable as an expression into a plot label, but the variable has brackets

2010-10-12 Thread Jared Blashka
I'm attempting to insert variables as expressions into labels for my plots, but I'm running into the issue that characters in my labels aren't allowed in expressions, notably '[' and ']'. An input string of [^3H]5-CT needs to be displayed as [3H]5-CT with the 3 as superscript. But brackets aren't

Re: [R] Lattice::bwplot unexpected behaviour when using vector of colors

2010-10-12 Thread RICHARD M. HEIBERGER
Please look at the panel.bwplot.intermediate.hh in the HH package. This example is on the ?position help page, also in the HH package. If you don't have HH yet, you can get it with install.packages(HH) library(HH) The full example is require(HH) ## boxplots coded by week tmp -

Re: [R] need help with nnet

2010-10-12 Thread Changbin Du
Thanks, Claudia! On Tue, Oct 12, 2010 at 9:54 AM, Claudia Beleites cbelei...@units.itwrote: I'm not sure how much fun it is to fit 7000 weights with 1800 samples, but you can tell nnet to allow more weights with MaxNWts, see ?nnet On 10/12/2010 06:45 PM, Changbin Du wrote: HI, Dear R

[R] lapply to subsets

2010-10-12 Thread Feng Li
Dear R, I have a silly question concerns with *apply. Say I have a list called A, A - list(a = array(1:20, c(2, 2, 5)), b = array(1:30, c(2, 3, 5))) I wish to calculate the mean of A$a, and A$b w.r.t. their third dimension so I did lapply(A,apply,c(1,2),mean) Now if I still wish to do the

Re: [R] (no subject)

2010-10-12 Thread Greg Snow
This looks like homework and there are enough teachers on this list that we frown on doing others homework for them (sometimes help if it is clear what help is allowed by the teacher). Some hints to get you started: You should read the document An Introduction to R that comes with every R

[R] Stripes in the plot

2010-10-12 Thread Pei-ling
I'm trying to plot the spatial distribution of the precipitation within an area. However, I think some thing wrong with the way to create the matrix for the precipitation data, so it came out lots of stripes. Could somebody help to see what's the problem? Here's the code:

Re: [R] List or matrix of object

2010-10-12 Thread Greg Snow
The difference is the same as the difference between a set with 1 element and a single element from a set. The single [ extracts/replaces/assigns a subset of the list elements, but the piece is still a list (even if it is one element). So when you are assigning using [ you need to give it a

Re: [R] Displaying a variable as an expression into a plot label, but the variable has brackets

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 12:53 PM, Jared Blashka wrote: I'm attempting to insert variables as expressions into labels for my plots, but I'm running into the issue that characters in my labels aren't allowed in expressions, notably '[' and ']'. An input string of [^3H]5-CT needs to be displayed

[R] How do I tell whether two vectors are identical?

2010-10-12 Thread ANJAN PURKAYASTHA
Hi, I have two vectors, each of length 45000. How do I compare the vectors to ascertain if they are identical. Secondly if they are NOT identical, how do I determine the indices of positions at which the vectors differ? Thanks, Anjan -- === anjan purkayastha,

[R] aggregate with cumsum

2010-10-12 Thread Bond, Stephen
Hello everybody, Data is myd - data.frame(id1=rep(c(a,b,c),each=3),id2=rep(1:3,3),val=rnorm(9)) I want to get a cumulative sum over each of id1. trying aggregate does not work myd$pcum - aggregate(myd[,c(val)],list(orig=myd$id1),cumsum) Please suggest a solution. In real the dataframe is huge

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread Bert Gunter
Try preusing an Intro to R for such elementary questions, please. Also the R Help facility. But... ?identical ##(oddly enough...) ?== But beware numerical issues -- see R FAQ 7.31. -- Bert On Tue, Oct 12, 2010 at 10:35 AM, ANJAN PURKAYASTHA anjan.purkayas...@gmail.com wrote: Hi, I have

Re: [R] aggregate with cumsum

2010-10-12 Thread Phil Spector
Stephen - In version R-2.11.1, I get aggregate(myd[,c(val)],list(orig=myd$id1),cumsum) orig x.1 x.2 x.3 1a -0.62754524 -1.16194135 -0.05975811 2b 0.21954618 -0.21355521 -0.62970082 3c -0.30296239 1.44111610 0.30121880 Since myd has several

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread David Winsemius
And ... ?which which(abs(x-y) 0) # or if these are subject to FAQ 7.31, then which( zapsmall( abs(x-y)) 0 ) .. for second part of question. -- David. On Oct 12, 2010, at 1:43 PM, Bert Gunter wrote: Try preusing an Intro to R for such elementary questions, please. Also the R Help

Re: [R] aggregate with cumsum

2010-10-12 Thread Greg Snow
Try ave instead of aggregate. If that does not do it, then look at the plyr package, probably the ddply function in that package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread Łukasz Ręcławowicz
Or just: id-seq(1,45e3,1) compare-data.frame(id,a,b) differences-compare$id[a!=b] -- Miłego dnia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] aggregate with cumsum

2010-10-12 Thread David Winsemius
On Oct 12, 2010, at 1:40 PM, Bond, Stephen wrote: Hello everybody, Data is myd - data.frame(id1=rep(c(a,b,c),each=3),id2=rep(1:3,3),val=rnorm(9)) I want to get a cumulative sum over each of id1. trying aggregate does not work myd$pcum -

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread ANJAN PURKAYASTHA
Thanks all for you help. Anjan 2010/10/12 £ukasz Rêc³awowicz lukasz.reclawow...@gmail.com Or just: id-seq(1,45e3,1) compare-data.frame(id,a,b) differences-compare$id[a!=b] -- Mi³ego dnia __ R-help@r-project.org mailing list

[R] pvclust.plot and au

2010-10-12 Thread michy
Hello is there anyway to just display the au values on pvclust.plot and not the bp values. Thank you, Michy -- Michelle Simon Bioinformatics, MRC Mammalian Genetics Unit, Harwell, Oxon, ox11 0rd, U.K. E-mail: m.si...@har.mrc.ac.uk Telephone: +44 (0)1235 841031 www:

Re: [R] Read from a website

2010-10-12 Thread steven mosher
Hmm, RCurl might have something on this. otherwise pull you can figure out their scheme and just construct the url from scratch. when you finish filling in the form, look at the url they construct. do it a few times and you can just emulate that. I've done that in the past without problems.

  1   2   >