Re: [R] Subsample points for mclust

2009-07-22 Thread Mario Valle
Nothing is better than asking help to find the answer by myself... Page 47 of the technical report (tr504.pdf) deals exactly with the problem of big datasets. Also I found that mclust is too much for my problem, the optimum number of Gaussian suggested is way too high. For example for one

Re: [R] Collinearity in Linear Multiple Regression

2009-07-22 Thread Tim Paysen
Actually, the CI index and VIF are just a start.  It is best to look at what they call a matrix of variance proportions (found in SAS and a few other places...)--which hardly anyone understands (including the SAS folks).  It is a matrix of estimates of what the variences of the regression

[R] how to calculate growth rate of CO2 (ppm) time series

2009-07-22 Thread Yogesh Tiwari
Dear R Users, I have CO2 mixing ratio(ppm) time series data during 1991-2000. I would like to calculate CO2 growth rate /ppm.a-1 (is it derivative dt/dco2 ??) Kindly can any one advise how to calculate above. My data file looks like; time, year, month, day, hour, min, sec, lat, long, height,

[R] margins defined in randomForest and supclust

2009-07-22 Thread Weiwei Shi
Hi there, How to solve the conflicts as to the same object between two packages, for example, like margins in both randomForest and supclust? When both libraries are installed, supclust will complain margins defined in randomForest. I can only solve it by re-starting R, which is very

Re: [R] animated grid graphics

2009-07-22 Thread Paul Hiemstra
Allan Engelhardt wrote: On 21/07/09 14:00, Paul Hiemstra wrote: Hi, Drawing grid graphics always takes long, I would write the images to png's and make the animation. If you use Linux I can suggest some nice tools to do this. Please do suggest! I was thinking about a similar problem.

Re: [R] How do I delete a row from a data frame when varA == TRUE

2009-07-22 Thread Uwe Ligges
Daniel Malter wrote: XYZ=XYZ[XYZ$A==TRUE , ] install.packages(fortunes) library(fortunes) fortune(==TRUE) Uwe Ligges should do. Note that this specific command overwrites your XYZ dataframe. If you want to keep XYZ, you will want to name the newly created frame differently. HTH,

Re: [R] Application logging in R

2009-07-22 Thread SIES 73
Hi Brian, In general, R lacks many utilities for applications. I'd say it's more focused on one-shot analysis, what is logic given its origin in statistics/academics. Few packages deal with these types of application automation. Logging is already addressed in some packages: you should have a

[R] A Flash Mob for R Content on Stack Overflow: Tonite @ 7-9pm PST

2009-07-22 Thread Michael E. Driscoll
R Users - Tomorrow night, we are leading a group of R programmers to a site called Stack Overflow, Stackoverflow is a collaborative question and answer site for programmers, currently lacks much R content. to populate some of the most oft-asked and reluctantly-answered questions about R. The

Re: [R] margins defined in randomForest and supclust

2009-07-22 Thread Uwe Ligges
Weiwei Shi wrote: Hi there, How to solve the conflicts as to the same object between two packages, for example, like margins in both randomForest and supclust? When both libraries are installed, supclust will complain margins defined in randomForest. I can only solve it by re-starting R,

Re: [R] A Flash Mob for R Content on Stack Overflow: Tonite @ 7-9pm PST

2009-07-22 Thread cls59
Michael E. Driscoll wrote: R Users - Tomorrow night, we are leading a group of R programmers to a site called Stack Overflow, Stackoverflow is a collaborative question and answer site for programmers, currently lacks much R content. to populate some of the most oft-asked and

[R] Automatic differentiation in R

2009-07-22 Thread Finlay Scott (Cefas)
Hi I recently gave a presentation about Automatic Differentiation (AD) and R at the Eighth Euro AD Workshop in Oxford (17/07/09). The presentation was intended as a general introduction to R and the desire for a generic AD interface for R. During the presentation I emphasised the need and

[R] je veux me sésinscrir!!!!!!!!!!!help

2009-07-22 Thread mariam farjallah
[[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] Split plot analysis problems

2009-07-22 Thread Jean-Paul Maalouf
Thanks a lot for your answer. My blocks are geographically well-separated, and within each block my four treatments are randomized. Therefore I am choosing the first model. Do you have any idea on how can I verify preliminary assumptions in this model (normality of the residuals and

[R] How to list R object properties save workspace?

2009-07-22 Thread Matej Kovacic
Hi, I am new to R and have a couple of questions. I know how to list all objects (with ls()), but how to list all properties of them? For instance, I found function object.size(), but I would also like to know whether one object is a dataset or just one vector (variable) or even only one value,

[R] Memory errors when using QCA package

2009-07-22 Thread Matthew Gwynne
Hi, I have been using the QCA package, in particular the eqmcc function and I am having some issues when trying to use this to minimise a particular boolean function. The boolean function in question has 16 variables, and I am providing the full truth table for the function (65536 with 256 true

Re: [R] Automatic differentiation in R

2009-07-22 Thread Gabor Grothendieck
R does not currently have AD (except for the Ryacas package which can do true AD for certain simple one line functions, i..e. input the function and output a function representing its derivative); however, for specific problems one can get close using deriv and associated functions or the approach

Re: [R] How do I delete a row from a data frame when varA == TRUE

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 4:02 AM, Uwe Ligges wrote: Daniel Malter wrote: XYZ=XYZ[XYZ$A==TRUE , ] install.packages(fortunes) library(fortunes) fortune(==TRUE) I've also made the repeated unnecessary invocation of which() in this situation. But ... the OP asked for removal rather than

[R] R help - howto suppress chm help and use text/latex help?

2009-07-22 Thread Tsunhin John Wong
Dear R Users, I've installed R with the chm option, but eventually I found I am more used to the normal way of latex help. Is there any argument to suppress chm help by default when starting R? So that I don't have to type something like help(rle,chmhelp=NULL) I know the last resort would be to

Re: [R] animated grid graphics

2009-07-22 Thread Duncan Murdoch
On 22/07/2009 7:49 AM, Jim Lemon wrote: Allan Engelhardt wrote: On 21/07/09 14:00, Paul Hiemstra wrote: Hi, Drawing grid graphics always takes long, I would write the images to png's and make the animation. If you use Linux I can suggest some nice tools to do this. Hi Allan, I often have

Re: [R] How to list R object properties save workspace?

2009-07-22 Thread Liviu Andronic
Hello, On Wed, Jul 22, 2009 at 1:22 PM, Matej Kovacicmatej.kova...@owca.info wrote: I know how to list all objects (with ls()), but how to list all properties of them? For instance, I found function object.size(), but I would also like to know whether one object is a dataset or just one

Re: [R] R help - howto suppress chm help and use text/latex help?

2009-07-22 Thread Duncan Murdoch
On 22/07/2009 7:52 AM, Tsunhin John Wong wrote: Dear R Users, I've installed R with the chm option, but eventually I found I am more used to the normal way of latex help. Is there any argument to suppress chm help by default when starting R? So that I don't have to type something like

Re: [R] How to list R object properties save workspace?

2009-07-22 Thread Duncan Murdoch
On 22/07/2009 7:22 AM, Matej Kovacic wrote: Hi, I am new to R and have a couple of questions. I know how to list all objects (with ls()), but how to list all properties of them? ls.str() gives more info than ls(). str() on a particular one gives more detail. For instance, I found

Re: [R] R extract vertices for polygon

2009-07-22 Thread David Winsemius
On Jul 21, 2009, at 10:18 PM, Angel Marley wrote: Dear R users, I'm trying to extract from a given matrix (GROUP) the coordinates of the vertices of the different groups (i.e. 3, 7, 1 . . .) to plot the polygons to delineate the area in which each group wins and colour it diferentially.

Re: [R] All possible linear models given multiple explaining variables

2009-07-22 Thread hadley wickham
Have a look at the meifly package, which also includes tools for visualising the resulting models. Hadley On Wed, Jul 22, 2009 at 7:28 AM, Thomas A. Groentagr...@gmail.com wrote: Hi, I would like to have a script/function (or write one) that can calculate the linear models for all possible

Re: [R] Memory errors when using QCA package

2009-07-22 Thread Allan Engelhardt
It is a little stupid, but the length of a vector is limited to 2^31-1 entries on any platform. A matrix is stored as a vector, so the product of all dimensions is also limited to 2^31-1. Allan. Matthew Gwynne wrote: Hi, I have been using the QCA package, in particular the eqmcc function

Re: [R] All possible linear models given multiple explaining variables

2009-07-22 Thread Ben Bolker
hadley wrote: Have a look at the meifly package, which also includes tools for visualising the resulting models. Hadley On Wed, Jul 22, 2009 at 7:28 AM, Thomas A. Groentagr...@gmail.com wrote: Hi, I would like to have a script/function (or write one) that can calculate the linear

Re: [R] Rcmdr GUI goes into loop via alt+backspace under Windows OS

2009-07-22 Thread Robert W. Baer, Ph.D.
It just produces the bell sound on my 32-bit windows XP machine runing R 2.9.1 Is this really a standard combination? I know a lot of programs that use ctrl-Z, but I've never come across this shortcut key combination for undo. - Original Message - From: tradenet

[R] How to dynamically generate lm() function arguments?

2009-07-22 Thread Moumita Das
Hi All, How do you dynamically generate the arguments for the lm() function when your items vary for each database. Say in my case for a particular database i have items from i1 to i15 . In the code below there a line like this :-- item_cat_fit-lm(as.numeric(item_item_table$i1) ~

Re: [R] Collinearity in Linear Multiple Regression

2009-07-22 Thread Stephan Kolassa
Hi Alex, I personally have had more success with the (more complicated) collinearity diagnostics proposed by Belsley, Kuh Welsch in their book Regression Diagnostics than with Variance Inflation Factors. See also: Belsley, D. A. A Guide to using the collinearity diagnostics. Computational

[R] contour plot

2009-07-22 Thread axionator
Hi, I want to draw a contour plot of the following function: z = y*x + epsilon, where x ~ N(y, 1) and epsilon ~ N(0, sigma) with sigma fixed (e.g. 1) But didnt manage to feed contour with the right input. Thanks for your help. Armin __

[R] Multi-line comments?

2009-07-22 Thread Mark Knecht
Hi, I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R? I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is there no defined way to get around using a # on each of the 20 lines?

Re: [R] how to change the quantile method in bwplot

2009-07-22 Thread Jun Shen
Thanks to Deepayan's suggestion, I was able to use boxplot.stats to specify type=6 to calculate quantiles by creating my own stats function as follows, my.boxplot.stats-function(y,subscripts,...)boxplot.stats(quantile(y,type=6),...) And then call

[R] time difference

2009-07-22 Thread Erin Hodgess
Dear R People: I am looking at the ctime attribute of two different files. It contains the year, month, day, time of creation and time zone. Is there a way to determine the difference between the ctimes of two files, please? I looked in the chron package and nothing seemed to work. Thanks in

Re: [R] Split plot analysis problems

2009-07-22 Thread Mark Difford
Hi Jean-Paul, ... since R is not able to extract residuals? R can extract the residuals, but they are a hidden in models with an error structure ## str(aov(PH~Community*Mowing*Water + Error(Block))) residuals(aov(PH~Community*Mowing*Water + Error(Block))$Block)

Re: [R] How to dynamically generate lm() function arguments?

2009-07-22 Thread Gabor Grothendieck
Using the built in anscombe data frame we can regress y1 on x2 and x4 like this (place the response first): lm(anscombe[c(y1, x2, x4)]) On Wed, Jul 22, 2009 at 9:50 AM, Moumita Dasdas.moumita.onl...@gmail.com wrote: Hi All, How do you dynamically generate the arguments for the lm() function

Re: [R] Multi-line comments?

2009-07-22 Thread Gabor Grothendieck
Try if (FALSE) { ... } On Wed, Jul 22, 2009 at 10:30 AM, Mark Knechtmarkkne...@gmail.com wrote: Hi,   I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R?   I wanted to comment out 20 lines that I'm moving to a function but didn't

Re: [R] Multi-line comments?

2009-07-22 Thread Paul Hiemstra
Mark Knecht wrote: Hi, I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R? I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is there no defined way to get around using a # on each of

Re: [R] All possible linear models given multiple explaining variables

2009-07-22 Thread Paul Hiemstra
Thomas A. Groen wrote: Hi, I would like to have a script/function (or write one) that can calculate the linear models for all possible combinations of explaining variables. Eventually I would like to end up with a data base (or data frame) giving for each model the R2, R2adj, AIC etc.

Re: [R] Multi-line comments?

2009-07-22 Thread Michael Knudsen
On Wed, Jul 22, 2009 at 4:30 PM, Mark Knechtmarkkne...@gmail.com wrote:   I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is there no defined way to get around using a # on each of the 20 lines? Just like you, I have been longing for that myself.

[R] adding p-value to a correlogram

2009-07-22 Thread Alon Ben-Ari
Hello, I am trying to plot a correlogram and add the correlation coefficient and p-value. This is the code I am using : pairs(d, gap = 0, lower.panel = panel.smooth, upper.panel = function (x,y) { panel.smooth(x,y) par(usr = c(0, 1, 0, 1)) a -

Re: [R] Multi-line comments?

2009-07-22 Thread Barry Rowlingson
On Wed, Jul 22, 2009 at 3:30 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi,   I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R?   I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is

Re: [R] time difference

2009-07-22 Thread David Huffer
On Wednesday, July 22, 2009 10:44 AM, Erin Hodgess wrote: ...I am looking at the ctime attribute of two different files. It contains the year, month, day, time of creation and time zone. Is there a way to determine the difference between the ctimes of two files, please... are

Re: [R] time difference

2009-07-22 Thread Gabor Grothendieck
Try this: file.info(abc.R)$ctime - file.info(aa.R)$ctime Time difference of 228.9912 days On Wed, Jul 22, 2009 at 10:44 AM, Erin Hodgesserinm.hodg...@gmail.com wrote: Dear R People: I am looking at the ctime attribute of two different files.  It contains the year, month, day, time of

Re: [R] Multi-line comments?

2009-07-22 Thread Jonathan Baron
On 07/22/09 07:30, Mark Knecht wrote: Hi, I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R? I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is there no defined way to get

Re: [R] Multi-line comments?

2009-07-22 Thread Erik Iverson
What editor are you all using to write R code? Many will have ways of doing what you want, e.g., comment-region (bound by default to M-; through comment-dwim) in Emacs. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Michael

Re: [R] Multi-line comments?

2009-07-22 Thread Michael Knudsen
On Wed, Jul 22, 2009 at 5:27 PM, Erik Iversoneiver...@nmdp.org wrote: What editor are you all using to write R code?  Many will have ways of doing what you want, e.g., comment-region (bound  by default to M-; through comment-dwim) in Emacs. Cool! I'm using Xcode, and I have just realized

Re: [R] How to replace NAs in a vector of factors?

2009-07-22 Thread Gene Leynes
Thank you so much, I'm humbled by the response from such great authors and scholars. I thought I would share the final version that worked perfectly in my illustrative example, as well as the real one. My main confusion was this part: db1$olditems[db1$olditems==''] [1] Levels: nuts soup I

Re: [R] time difference

2009-07-22 Thread Dirk Eddelbuettel
On 22 July 2009 at 09:44, Erin Hodgess wrote: | I am looking at the ctime attribute of two different files. It | contains the year, month, day, time of creation and time zone. [ Well only if you convert it to POSIXlt... ] | Is there a way to determine the difference between the ctimes of two |

[R] IDE's/Editors for R-- Was: Multi-line comments?

2009-07-22 Thread Bert Gunter
You can find a list of IDE's/R code editors for R here: http://www.sciviews.org/_rgui/projects/Editors.html However, this is somewhat dated, and you may find others not here just by googling on R Editor, R IDE, etc. Bert Gunter Genentech Nonclinical Biostatistics -Original Message-

Re: [R] Rcmdr GUI goes into loop via alt+backspace under Windows OS

2009-07-22 Thread tradenet
Robert, Alt+Backspace is a standard global shortcut key shortcut key for most Windows programs (Word, Excel, Visual Studio, Notepad, Wordpad. It is equivalent to Ctrl+Z It has been around since at least windows 98: http://www.microsoft.com/enable/products/KeyboardSearch_98.aspx I wished

Re: [R] Multi-line comments?

2009-07-22 Thread Mark Knecht
Thanks Gabor and EVERYONE else who answered so quickly. On Wed, Jul 22, 2009 at 7:50 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: Try if (FALSE) { ... } On Wed, Jul 22, 2009 at 10:30 AM, Mark Knechtmarkkne...@gmail.com wrote: Hi,   I looked in the language definition and was

[R] Symmetrically Trimmed Least Squares (STLS) Regression Analysis Help

2009-07-22 Thread Vivek Ayer
Hi all, Just started using R recently. Got OLS and Truncated Regression to work via lm() and truncreg(). But we need to use STLS for our data. Is there a function out there that does this, or can we use a clever workaround using what we already have? Thanks in advance, Vivek Ayer

Re: [R] Collinearity in Linear Multiple Regression

2009-07-22 Thread Stephan Kolassa
Hi Tim, Variance proportions (and condition indices) are exactly the tools described in Belsley, Kuh Welsch, Regression Diagnostics - see my previous post. Good to see I'm not the only one to use them! BKW also describe in detail how to calculate all this using SVD, so you don't need to use

[R] strange behavior of system command

2009-07-22 Thread Erin Hodgess
Dear R People: I'm running from R to a grid computer and getting some unusual results with the system command: e7 - system(globus-job-run x /bin/sh -c 'cd $OSG_APP/engage;chmod 777 oops',intern=TRUE) chmod: changing permissions of `oops': Operation not permitted e7 character(0) I

[R] Long character not truncated by str() after adding comment

2009-07-22 Thread Chris Stubben
If I add a comment to a long character string, I can't get the truncated string to display in the str() output. Anyone know how to get str to compactly display a truncated string and the comment? longch - paste(rep(letters,100), collapse=) str(longch) # truncated comment(longch)-100 ABCs

Re: [R] strange behavior of system command

2009-07-22 Thread Steve Lianoglou
Hi Erin, On Jul 22, 2009, at 2:16 PM, Erin Hodgess wrote: Dear R People: I'm running from R to a grid computer and getting some unusual results with the system command: e7 - system(globus-job-run x /bin/sh -c 'cd $OSG_APP/ engage;chmod 777 oops',intern=TRUE) chmod: changing permissions

Re: [R] Multi-line comments?

2009-07-22 Thread Paul Hiemstra
Erik Iverson schreef: What editor are you all using to write R code? Many will have ways of doing what you want, e.g., comment-region (bound by default to M-; through comment-dwim) in Emacs. I use Kate, the advanced text editor in KDE. Paul -Original Message- From:

[R] Extreme Value Bivariate Point Process Model

2009-07-22 Thread Ron Burns
Dear All- I am looking at the bivariate point process model for extreme values as described in Section 8.3.2 of Coles book. I am stuck at a very low level in being unable to reproduce the initial step of transforming the data to unit Frechet margins. In particular, I am unable to

Re: [R] Split plot analysis problems

2009-07-22 Thread Richard M. Heiberger
Jean-Paul Maalouf wrote: Do you have any idea on how can I verify preliminary assumptions in this model (normality of the residuals and variance homogeneity), since R is not able to extract residuals? Of course, R extracts residuals. Use the proj() function. See ?proj for the example to

Re: [R] Memory errors when using QCA package

2009-07-22 Thread David Winsemius
But: 2^31-1 # is more than the specified problem length [1] 2147483647 2130706560 You may be dealing with a system that is not facile at memory allocation. Windows? On Jul 22, 2009, at 9:16 AM, Allan Engelhardt wrote: It is a little stupid, but the length of a vector is limited to

Re: [R] contour plot

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 10:17 AM, axionator wrote: Hi, I want to draw a contour plot of the following function: z = y*x + epsilon, where x ~ N(y, 1) and epsilon ~ N(0, sigma) with sigma fixed (e.g. 1) But didnt manage to feed contour with the right input. Thanks for your help. Armin The help

[R] What works on windows

2009-07-22 Thread malcolm Crouch
Hi , How can you tell which packages work on windows ? Regards Malcolm [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] What works on windows

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 3:02 PM, malcolm Crouch wrote: Hi , How can you tell which packages work on windows ? This is the place to find listing for automated compiler check results: http://cran.stat.ucla.edu/bin/windows/contrib/checkSummaryWin.html Regards Malcolm David Winsemius, MD

[R] A question on operation on list

2009-07-22 Thread megh
Hi, I have created a list object like that : x = vector(list) for (i in 1:5) x[[i]] = rnorm(2) x Now I want to do two things : 1. for each i, I want to do following matrix calculation : t(x[[i]]) %*% x[[i]] i.e. for each i, I want to get a 2x2 matrix 2. Next I want to get x[[1]] + x[[2]] +

[R] Find multiple elements in a vector

2009-07-22 Thread Michael Knudsen
Hi, Given a vector, say x=sample(0:9,10) x [1] 0 6 3 5 1 9 7 4 8 2 I can find the location of an element by which(x==2) [1] 10 but what if I want to find the location of more than one number? I could do c(which(x==2),which(x==3)) but isn't there something more streamlined? My first guess

Re: [R] A question on operation on list

2009-07-22 Thread Jorge Ivan Velez
Hi megh, Perhaps? # Data x = vector(list) for (i in 1:5) x[[i]] = rnorm(2) # 2x2 matrices res - lapply(x, function(a) a %*% t(a) ) res # Funcion from ?Reduce add - function(x) Reduce(+, x) # Summing up! add(res) See ?lapply and ?Reduce for more information. HTH, Jorge On Wed, Jul 22, 2009

Re: [R] Find multiple elements in a vector

2009-07-22 Thread Chuck Cleland
On 7/22/2009 3:32 PM, Michael Knudsen wrote: Hi, Given a vector, say x=sample(0:9,10) x [1] 0 6 3 5 1 9 7 4 8 2 I can find the location of an element by which(x==2) [1] 10 but what if I want to find the location of more than one number? I could do c(which(x==2),which(x==3))

Re: [R] Find multiple elements in a vector

2009-07-22 Thread Jorge Ivan Velez
Dear Michael, Take a look at ?%in% This is an example: set.seed(123) x - sample(0:9,10) y - c(2,3) which(x %in% y) # [1] 1 3 HTH, Jorge On Wed, Jul 22, 2009 at 3:32 PM, Michael Knudsen wrote: Hi, Given a vector, say x=sample(0:9,10) x [1] 0 6 3 5 1 9 7 4 8 2 I can find the

Re: [R] A question on operation on list

2009-07-22 Thread Tony Plate
Here's one way: set.seed(1) x1 - lapply(1:5, function(i) rnorm(2)) x2 - lapply(x1, function(x) outer(x, x)) Reduce(+, x2, 0) [,1] [,2] [1,] 1.768406 -1.534413 [2,] -1.534413 3.890200 and another way using the abind package: library(abind) dim(abind(along=0, x2)) [1] 5 2

[R] Problem with merge command duplicating values

2009-07-22 Thread Archana Dayalu
Hello, I am attempting to merge 8 different data sets into a grand merge data set; all their variable names are common except for the the gas measured. However, when I did a quick stat summary comparison of merged data with unmerged data, it turned out that R mysteriously duplicated thousands of

Re: [R] A question on operation on list

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 3:18 PM, megh wrote: Hi, I have created a list object like that : x = vector(list) for (i in 1:5) x[[i]] = rnorm(2) x So now you have a list with 5 elements Now I want to do two things : 1. for each i, I want to do following matrix calculation : t(x[[i]]) %*%

Re: [R] Find multiple elements in a vector

2009-07-22 Thread Steve Lianoglou
Hi, On Jul 22, 2009, at 3:39 PM, Jorge Ivan Velez wrote: Dear Michael, Take a look at ?%in% This is an example: set.seed(123) x - sample(0:9,10) y - c(2,3) which(x %in% y) # [1] 1 3 In addition to the above, you can also use the `match` function: match(c(2,3), x) [1] 1 3 The problem is

Re: [R] Find multiple elements in a vector

2009-07-22 Thread Michael Knudsen
On Wed, Jul 22, 2009 at 9:37 PM, Chuck Clelandcclel...@optonline.net wrote:  How about this? which(x %in% c(2,3)) Thanks to you all! I had never thought about using %% in this context. -- Michael Knudsen micknud...@gmail.com http://lifeofknudsen.blogspot.com/

Re: [R] Problem with merge command duplicating values

2009-07-22 Thread John Kane
What package is 'grand.merge' in? --- On Wed, 7/22/09, Archana Dayalu dayalu.arch...@gmail.com wrote: From: Archana Dayalu dayalu.arch...@gmail.com Subject: [R] Problem with merge command duplicating values To: r-help@r-project.org Received: Wednesday, July 22, 2009, 3:44 PM Hello, I am

[R] Multcomp, means and mixed models

2009-07-22 Thread Metconnection
Hi all, I wonder if anyone can help. I'm trying to calculate the means from a mixed model analysis using Multcomp My code is glht(lme(response~treatment, random=~1|patient, data=statdata, na.action = (na.omit)), linfct=mcp(treatment=Means)) It appears that the Means option is not valid for

[R] download.file() help! setting the proxy for user /passw0rd

2009-07-22 Thread ByR1
I would like to download climate data files from PCMDI website using R. I tried this line below and I was not able to get the file mainly due to user name and password requirements. I am looking for help for setting up the user and password within R (or somewhere). I have read the FAQ but

[R] Difficulty Increasing R memory on Windows 32-Bit

2009-07-22 Thread Dan Fleder
I'm having difficulty increasing the memory R can access above 2Gb and wasn't able to resolve this from the R Windows FAQ. For reference, I'm running Windows XP, 32bit, Service Pack 2 on a machine with 4GB RAM. Following the FAQ, I set the --max-mem-size flag to 2800Mb. However, when I start

[R] Merge vectors

2009-07-22 Thread MarcioRibeiro
Hi listers, I would like to merge two vectors as follows... A-c(3,5,7,18,43,85,91,98,100,130,230,487) #data values B-c(10,5,5,10,8,11,2,7,3,11,10) #random numbers (sample) I would like to set the vector of random numbers according to the order set of the vector of data values... The result would

[R] help in buliding a likelihood function...

2009-07-22 Thread resident76
I am hoping someone may be able to help me out here. I need to build up a likelihood function algorithmically based on the data. The likelihood function is almost impossible to generate analytically due to a large number of summations. I just can't figure out how to get the variables into the

Re: [R] Merge vectors

2009-07-22 Thread Steve Lianoglou
Hi, On Jul 22, 2009, at 3:31 PM, MarcioRibeiro wrote: Hi listers, I would like to merge two vectors as follows... A-c(3,5,7,18,43,85,91,98,100,130,230,487) #data values B-c(10,5,5,10,8,11,2,7,3,11,10) #random numbers (sample) I would like to set the vector of random numbers according to the

Re: [R] A question on operation on list

2009-07-22 Thread megh
Thanks for your suggestions. I need one more thing : x = y = vector(list) for (i in 1:5) x[[i]] = rnorm(2); y[[i]] = rnorm(2) Here I want to get t(x[[i]]) %*% y[[i]] for each i. Can anyone please help me? Regards, Jorge Ivan Velez wrote: Hi megh, Perhaps? # Data x = vector(list)

Re: [R] Merge vectors

2009-07-22 Thread Erik Iverson
A[B] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of MarcioRibeiro Sent: Wednesday, July 22, 2009 2:31 PM To: r-help@r-project.org Subject: [R] Merge vectors Hi listers, I would like to merge two vectors as follows...

Re: [R] A question on operation on list

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 5:07 PM, megh wrote: Thanks for your suggestions. I need one more thing : x = y = vector(list) for (i in 1:5) x[[i]] = rnorm(2); y[[i]] = rnorm(2) Here I want to get t(x[[i]]) %*% y[[i]] for each i. Can anyone please help me? ?lapply Regards, Jorge Ivan

Re: [R] Problem with aov

2009-07-22 Thread Ben Bolker
theliver wrote: I'm currently doing simple, one way ANOVA using R. I'm analyzing a count based upon an Hour value (0-23) in which it occurs. The count varies greatly over the entire day (usually with a range of 400 or so), but certain hour groupings could be useful for later data

Re: [R] Problem with aov

2009-07-22 Thread Ben Bolker
Oops, I mean hours15t21.data.ztl$Hour - factor(hours15t21.data.ztl$Hour) Sorry -- View this message in context: http://www.nabble.com/Problem-with-aov-tp24613042p24615059.html Sent from the R help mailing list archive at Nabble.com. __

[R] Question on qplot

2009-07-22 Thread RON70
I have following code on qplot : library(ggplot2) ggplot() + geom_histogram(aes(x=rnorm(100), fill=..count..), xlab=, ylab=) However above code doesnot seem to remove the xlab ylab. What is the correct code? I also want to remove the color-palate in the right side. Is there any way to do that?

Re: [R] Question on qplot

2009-07-22 Thread baptiste auguie
try this, library(ggplot2) ggplot() + geom_histogram(aes(x=rnorm(100), fill=..count..))+ xlab(NULL)+ scale_y_continuous()+ opts(legend.position=none) HTH, baptiste 2009/7/22 RON70 ron_michae...@yahoo.com I have following code on qplot : library(ggplot2) ggplot() +

[R] How to use macro variable in a text string

2009-07-22 Thread kxk
I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in 1970:2005) { edge - read.table(file=edge_t.csv,

[R] Question about the lars package

2009-07-22 Thread lulu9797
Hello, I have a question about lars package, probably basic. The returned values of lars function include R squares along the variable selection path. However, such values are always slightly different from the R squares returned by the regression function lm using the same models. Anyone

Re: [R] How to use macro variable in a text string

2009-07-22 Thread Steve Lianoglou
Hi, On Jul 22, 2009, at 5:46 PM, kxk wrote: I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in

Re: [R] Merge vectors

2009-07-22 Thread Mark Knecht
Sort of like this? A-c(3,5,7,18,43,85,91,98,100,130,230,487) #data values B-c(10,5,5,10,8,11,2,7,3,11,10) #random numbers (sample) C = A[B] C [1] 130 43 43 130 98 230 5 91 7 230 130 On Wed, Jul 22, 2009 at 2:08 PM, Erik Iversoneiver...@nmdp.org wrote: A[B] -Original

Re: [R] How to use macro variable in a text string

2009-07-22 Thread David Winsemius
On Jul 22, 2009, at 5:46 PM, kxk wrote: I want to use read.table to input many files, each for a different year. I would like to use the macro variable 't' to refer to the exact file that I would like to input the data using read.table. How could I do this? Thank you! for (t in

Re: [R] How to use macro variable in a text string

2009-07-22 Thread Jorge Ivan Velez
Dear kxk, Here are a couple of options: # Option 1 -- sapply mydata - sapply(1970:2005, function(i){ mydata - read.table(file = paste(edge_, i, .csv, sep=), header=TRUE) # more code goes here } ) Please note that

[R] mathematical notation in R

2009-07-22 Thread Mary A. Marion
Hello, I have an R function which includes the statement LBAuo- -. Rather than printing out - I want it to print out - infinity. As of yet I have not been able to do that. I am not in a graphics window just outputting a set of variables. Can you help? Thanks. Sincerely, Mary A.

Re: [R] mathematical notation in R

2009-07-22 Thread Steven McKinney
Does this approach what you're looking for? See ?is.finite for more info LBAuo- - LBAuo [1] - if (LBAuo = -) LBAuo - -Inf LBAuo [1] -Inf HTH Steven McKinney -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of

[R] panel.lmline - are m, b, and r^2 accessible somehow?

2009-07-22 Thread Bryan Hanson
Hi R Folks... Are the results of a fit carried out by panel.lmline readily available for use in a lattice plot? I¹d like to put r^2, m, and b on each panel. I can certainly write something that does this manually and then use it with panel.text, but if it¹s already available, that would be

Re: [R] kmeans.big.matrix

2009-07-22 Thread Jay Emerson
This sort of question is ideal to send directly to the maintainer. We've removed kmeans.big.matrix for the time being and will place it in a new package, bigmemoryAnalytics. bigmemory itself is the core building block and tool, and we don't want to pollute it with lots of extras. Allan's point

[R] param:qsec in ggplot2

2009-07-22 Thread Mohan S
Hii i have been trying to do a scatter plot with ggplot2, like the plot 6 here (http://had.co.nz/ggplot2/geom_point.html) .. where the points size vary with values p + geom_point(aes http://had.co.nz/ggplot2/aes.html(size = qsec)) but am not sure how to setup the parameter - qsec could

[R] how to predict dynamic model in R

2009-07-22 Thread Hongwei Dong
I have a dynamic time series model like this: dyn$lm( y ~ lag(y,-1) + x + lag(x,-1)+lag(x,-2) ) I need to do an out of sample forecast with this model. Is there any way I can do this with R? It would be greatly appreciated if some one can give me an example. Thanks. Harry [[alternative

Re: [R] how to predict dynamic model in R

2009-07-22 Thread Gabor Grothendieck
Use dyn.predict like this: library(dyn) x - y - zoo(1:5) mod - dyn$lm(y ~ lag(x, -1)) predict(mod, list(x = zoo(6:10, 6:10))) 7 8 9 10 7 8 9 10 On Thu, Jul 23, 2009 at 12:54 AM, Hongwei Dongpdxd...@gmail.com wrote: I have a dynamic time series model like this: dyn$lm( y ~ lag(y,-1)

  1   2   >