Re: [R] Sorting order of reorder with multiple variables

2011-08-27 Thread Deepayan Sarkar
On Thu, Aug 25, 2011 at 6:15 PM, markm0705 markm0...@gmail.com wrote: I've been building a ranked dot plot for several days now and am sorting the data using the reorder command.  What I don't understand is how reorder works when mutiple varibles are plotted by grouping.  In the example below

Re: [R] How to vectorize a function to handle two vectors

2011-08-27 Thread Jeff Newmiller
Isn't a vector of vectors usually considered a matrix? So if you want to vectorize a vector function you would normally rewrite it to operate on matrices. --- Jeff Newmiller The . . Go Live...

[R] hopelessly overdispersed?

2011-08-27 Thread Kilo Bismarck
dear list! i am running an anlysis on proportion data using binomial (quasibinomial family) error structure. My data comprises of two continuous vars, body size and range size, as well as of feeding guild, nest placement, nest type and foragig strata as factors. I hope to model with these

Re: [R] Grouping variables in a data frame

2011-08-27 Thread Liviu Andronic
On Sat, Aug 27, 2011 at 7:26 AM, Andra Isan andra_i...@yahoo.com wrote: Hi All, I have a data frame as follow: user_id time age location gender . and I learn a logistic regression to learn the weights (glm with family= (link = logit))), my response value is either zero or one. I

[R] Degrees of freedom in the Ljung-Box test

2011-08-27 Thread Marcin P?�ciennik
Dear list members, I have 982 quotations of a given stock index and I want to run a Ljung-Box test on these data to test for autocorrelation. Later on I will estimate 8 coefficients. I do not know how many degrees of freedom should I assume in the formula for Ljung-Box test. Could anyone tell me

[R] Asking Favor For Remove element with Particular Value In Vector

2011-08-27 Thread chuan_zl
Dear All. I am Chuan. I am beginner for R.I facing some problem in remove element from vector.I have a vector with size 238 element as follow(a part) [1] 0 18 24 33 44..[238] 255 Let the vector label as x,I want remove element 0 and 255.I try use such function:

[R] gplot data manipulation question

2011-08-27 Thread vamshi999
i have this data with me...i am only copying part of data here... date time 2011-05-2304:31:17 2011-05-2304:31:20 2011-05-2304:31:22 2011-05-2304:31:25 2011-05-2304:31:27 2011-05-2304:31:18 2011-05-2304:31:20 2011-05-2304:31:22 2011-05-23

[R] separate mfrow region with line

2011-08-27 Thread dood
Dear R users, I have six plots in one figure, created with par(mfrow=c(2,3)). I would like to add two lines to the figure outside the plotting regions, separating the figure into 3 columns. Is this possible? Thanks -- View this message in context:

[R] rmongodb released

2011-08-27 Thread Gerald Lindsly
The source code to a new package, rmongodb (http://cnub.org/rmongodb.ashx), has just been released. This is a full-featured driver to MongoDB ( http://www.mongodb.org) for the R language. Just out of development, I would like some feedback from some real world usage before submitting the package

[R] comparing GLM coefficients repeatability

2011-08-27 Thread RCulloch
Many thanks for taking the time to read this! I am looking at the repeatability of behaviour between re-sighted individuals across discrete time periods (annual breeding seasons). My approach was to run a GLM (with a logit link - the data are proportional, presence v. absence of behaviour) for

Re: [R] Asking Favor For Remove element with Particular Value In Vector

2011-08-27 Thread Rainer Schuermann
Not sure whether I understand your question right but here is what I would do: # Sample data x - seq( 1, 100, by=6) x [1] 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 # remove element with value 19 x - x[ x != 19 ] x [1] 1 7 13 25 31 37 43 49 55 61 67 73 79 85 91 97 If you want to

Re: [R] Make a function work on an environemnt

2011-08-27 Thread Tyler Rinker
A previous attempt at this question resulted in the message running together, making the message difficult to read and the code lines hard to distinquinsh. In my R learning I've come across a situation in which a piece of code that works on the work space outside a function does not work

Re: [R] Degrees of freedom in the Ljung-Box test

2011-08-27 Thread Prof Brian Ripley
Please fix your email settings: your 'From:' field is not in the correct encoding, so I had to manually copy the ASCII part. (The header as received here said it was UTF-8, but it is not valid UTF-8. Most likely no encoding was declared your end.) On Sat, 27 Aug 2011, Marcin Pciennik

Re: [R] separate mfrow region with line

2011-08-27 Thread David Winsemius
On Aug 27, 2011, at 5:01 AM, dood wrote: Dear R users, I have six plots in one figure, created with par(mfrow=c(2,3)). I would like to add two lines to the figure outside the plotting regions, separating the figure into 3 columns. Is this possible? The xpd parameter used with the

Re: [R] Asking Favor For Remove element with Particular Value In Vector

2011-08-27 Thread David Winsemius
On Aug 27, 2011, at 5:31 AM, chuan_zl wrote: Dear All. I am Chuan. I am beginner for R.I facing some problem in remove element from vector.I have a vector with size 238 element as follow(a part) [1] 0 18 24 33 44..[238] 255 Let the vector label as x,I want

Re: [R] hopelessly overdispersed?

2011-08-27 Thread Ben Bolker
Kilo Bismarck tweedie-d at web.de writes: i am running an anlysis on proportion data using binomial (quasibinomial family) error structure. My data comprises of two continuous vars, body size and range size, as well as of feeding guild, nest placement, nest type and foragig strata as

[R] Error: package 'lsei' is not installed for 'arch=i386'

2011-08-27 Thread MK
Hi guys, I am having problem loading a package that I have installed. I have searched some old thread but they were no help in terms of solving the problem. I uninstalled every possible component of R and installed R 2.13 and followed the R-faqs installation steps. Then I installed the package

Re: [R] Make a function work on an environemnt

2011-08-27 Thread R. Michael Weylandt
Well, here's one way you could do it: # Don't run this unless you really mean it clear - function(){rm(list=ls(.GlobalEnv), envir = .GlobalEnv)} Both calls to .GlobalEnv seem necessary so that both rm() and ls() go everywhere with it. However, this certainly isn't the most useful code because it

Re: [R] Make a function work on an environemnt

2011-08-27 Thread Tyler Rinker
Michael, Thank you for that information. It was very insightful. Anyone else with why my second attempt does not work (using eapply)? ThanksTylerFrom: michael.weyla...@gmail.com Date: Sat, 27 Aug 2011 12:01:02 -0400 Subject: Re: [R] Make a function work on an environemnt To:

Re: [R] Make a function work on an environemnt

2011-08-27 Thread Tyler Rinker
Michael, Michael wrote: However, this certainly isn't the most useful code because it clears itself... If you were to put this code in a package, .Rdata file, or .First() script it could be recalled in that way. So it could serve a purpose. The exercise was more about me learning how to

Re: [R] Sicherheitszertifikat für R-Pakete unter Windows [Security Certificates for R Packages in Windows]

2011-08-27 Thread Uwe Ligges
On 26.08.2011 19:36, R. Michael Weylandt wrote: To save anyone else 30 seconds, here's how google translates the below: Ladies and Gentlemen, I would like to inform me whether there is the possibility of security certificates for R packages are. Impressingly accurate given the original

[R] all combinations of the elements of two vectors

2011-08-27 Thread Campbell, Desmond
Dear R-help readers, I'm sure this problem has been answered but I can't find the solution. I have two vectors v1 - c(a,b) v2 - c(1,2,3) I want an easy way to produce every possible combination of v1, v2 elements Ie I want to produce c(a1,a2,a3, b1,b2,b3) regards Desmond Desmond Campbell Dept

Re: [R] eRm/raschsampler error message

2011-08-27 Thread reinhold
Hi, this error message is due to a bug in RaschSampler. I corrected it and sent it to CRAN. RaschSampler version 0.8-5 should be available from there soon. Thanks for the hint and please apologize for any inconveniences. Reinhold -- View this message in context:

[R] to represent color range on plot segment

2011-08-27 Thread karthicklakshman
Dear R community, With an advantage of being NEW to R, I would like to post a very basic query here, I am in need of representing gene expression data which ranges from -0.09 to +4, on plot segment. please find below the data df, the expression values are in df[,2]. kindly help me with the code,

Re: [R] all combinations of the elements of two vectors

2011-08-27 Thread Jorge I Velez
Hi Desmond, You might try sort(apply(expand.grid(v1, v2), 1, paste, collapse = , sep = )) [1] a1 a2 a3 b1 b2 b3 HTH, Jorge On Sat, Aug 27, 2011 at 12:54 PM, Campbell, Desmond wrote: Dear R-help readers, I'm sure this problem has been answered but I can't find the solution. I have two

Re: [R] all combinations of the elements of two vectors

2011-08-27 Thread Daniel Malter
x-letters[1:3] y-1:3 d-expand.grid(x,y) g-apply(d,1,function(x) paste(x[1],x[2],sep=)) HTH, Daniel Campbell, Desmond-2 wrote: Dear R-help readers, I'm sure this problem has been answered but I can't find the solution. I have two vectors v1 - c(a,b) v2 - c(1,2,3) I want an easy way

Re: [R] Overdispersed GLM

2011-08-27 Thread Jim Silverton
Hi all, I have the following data: rep1_treat rep2_treat rep1_control rep2_control 2 3 4 5 100 20 98 54 0 1

Re: [R] all combinations of the elements of two vectors

2011-08-27 Thread Campbell, Desmond
Dear Jorge Yes expand.grid() is exactly what I wanted. This problem keeps cropping up, and I've never known a simple way to implement it. Thanks very much. Regards Desmond From: Jorge I Velez [mailto:jorgeivanve...@gmail.com] Sent: 27 August 2011

[R] Ordered probit model -marginal effects and relative importance of each predictor-

2011-08-27 Thread franco salerno
Hi, I have a problem with the ordered probit model -polr function (library MASS). My independent variables are countinuos. I am not able to understand two main points: a) how to calculate marginal effects b) how to calculate the relative importance of each independent variables If required i

Re: [R] to represent color range on plot segment

2011-08-27 Thread Dennis Murphy
On Sat, Aug 27, 2011 at 11:07 AM, karthicklakshman karthick.laksh...@gmail.com wrote: Dear R community, With an advantage of being NEW to R, I would like to post a very basic query here, Really? I found two posts with your name on it dating from October and November of 2010.

[R] Am having trouble calling a function

2011-08-27 Thread James Rome
In my main R program, I have source(retaanalysis/Functions/doAirport.R) stuff to read data and calculate ads sapply(ads,function(x) {doAirport(x, base)} ) And doAirport has # analyze the flights for a given airport doAirport = function(df, base) { # Get rid of unused runway factor

[R] Counting non-missing values XXXX

2011-08-27 Thread Dan Abner
Hello everyone, What is the most elegant and efficient way to count non-missing values of a vector? Thanks! Dan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Counting non-missing values XXXX

2011-08-27 Thread R. Michael Weylandt michael.weyla...@gmail.com
sum(!is.na(x)) Michael On Aug 27, 2011, at 4:39 PM, Dan Abner dan.abne...@gmail.com wrote: Hello everyone, What is the most elegant and efficient way to count non-missing values of a vector? Thanks! Dan [[alternative HTML version deleted]]

Re: [R] How download Yahoo Quote?

2011-08-27 Thread Yumin
Hi Michael: I tried to simplify the code, but still failed. *con - url(http://quote.yahoo.com;) if(!inherits(try(open(con), silent = TRUE), try-error)) { close(con) x - get.hist.quote(instrument =

[R] Exception while using NeweyWest function with doMC

2011-08-27 Thread Simon Zehnder
Dear R users, I am using R right now for a simulation of a model that needs a lot of memory. Therefore I use the *bigmemory* package and - to make it faster - the *doMC* package. See my code posted on http://pastebin.com/dFRGdNrG Now, if I use the foreach loop with the addon %do% (for sequential

Re: [R] How download Yahoo Quote?

2011-08-27 Thread R. Michael Weylandt
Did you install the package quantmod? install.packages(quantmod) Michael On Sat, Aug 27, 2011 at 4:32 PM, Yumin zpx...@gmail.com wrote: Hi Michael: I tried to simplify the code, but still failed. *con - url(http://quote.yahoo.com;) if(!inherits(try(open(con),

[R] Placing a column name in a variable XXXX

2011-08-27 Thread Dan Abner
Hi everyone, How does one place an object name (in this case a vector name) into another object (while essentially masking the values of the first object? For example: JOBSAT-rnorm(40) CI-function(x,alpha){ + result-cbind(x,mean=mean(x),alpha) + print(result) + } CI(JOBSAT,.05) I want this

Re: [R] Overdispersed GLM

2011-08-27 Thread Ben Bolker
Jim Silverton jim.silverton at gmail.com writes: Hi all, I have the following data: rep1_treat rep2_treat rep1_control rep2_control 2 3 4 5 100 20 98

Re: [R] How download Yahoo Quote?

2011-08-27 Thread Yumin
- Original Message - From: Yumin [via R] To: Yumin Sent: Saturday, August 27, 2011 3:32 PM Subject: Re: How download Yahoo Quote? Hi Michael: I tried to simplify the code, but still failed. con - url(http://quote.yahoo.com;)

Re: [R] Am having trouble calling a function

2011-08-27 Thread Carl Witthoft
First of all, please replace your = with - per general R-usage rules. Next: you need to provide a clear listing of doAirport.R so we can tell what it actually is, and what you've done outside the function. That said, my suspicion is that your parent function (the one which calls doAirport)

Re: [R] Am having trouble calling a function

2011-08-27 Thread jim holtman
Add the following to your script: options(error=utils::recover) (actually put it in you Startup script), then learn how to use the debugging in R. On the error, this should provide a trace of the stack so that we know where the error occurs. By learning how to use debug/browser, you will be

Re: [R] Placing a column name in a variable XXXX

2011-08-27 Thread jim holtman
The function is doing exactly what you are telling it to do. You have 'cbind(x, mean(x), alpha)' which is creating a matrix where the first column is all the values in 'x' and the next two are the recycled values of mean and alpha. Is this what you want: JOBSAT-rnorm(10)

Re: [R] to represent color range on plot segment

2011-08-27 Thread jim holtman
?colorRamp On Sat, Aug 27, 2011 at 2:07 PM, karthicklakshman karthick.laksh...@gmail.com wrote: Dear R community, With an advantage of being NEW to R, I would like to post a very basic query here, I am in need of representing gene expression data which ranges from -0.09 to +4, on plot

Re: [R] data manipulation and summaries with few million rows

2011-08-27 Thread jim holtman
Factors are you friend here: myData mydate gender mygroup id mygrp.f 1 2012-03-25 F A 1 1 2 2005-05-23 F B 2 2 3 2005-09-08 F B 2 2 4 2005-12-07 F B 2 2 5 2006-02-26 F C 2 3 6 2006-05-13 F

Re: [R] Placing a column name in a variable XXXX

2011-08-27 Thread jim holtman
In this case you want to use a 'list' since you want character and numerics returned: JOBSTAT-rnorm(10) # new function that does not return 'x' CInew -function(x,alpha){ + list(variable = deparse(substitute(x)), mean=mean(x), alpha = alpha) + } CInew(JOBSTAT, 0.05) $variable [1] JOBSTAT

Re: [R] issue with available.packages() and download.file()

2011-08-27 Thread Duncan Murdoch
On 11-08-25 9:52 PM, Seth Schommer wrote: Dear R-Users, I think I have encountered a potential bug (or at least unwanted behavior), but I'm not sure so I wanted to post here first. Lately I've been I'd say it's a bug with your network setup: when a URL is not found, an error should be

[R] control line break behavior of R output

2011-08-27 Thread Martin Batholdy
Hi, Is it possible to define at which point a line-break is happening in R-output? I for example would rather like to scroll horizontally in a data-frame with a lot of columns instead of having a lot of breakpoints in the data.frame (to fit the screen). Can you control that? Can you tell R

[R] calculating avg silhouette with fpc package

2011-08-27 Thread Matthew Pirritano
All, Excuse me for being a newbie. I'm trying to calculate the average silhouette, a measure of cluster validity. I've already brought my spss data in. It's 1008 cases with 8 variables, no missing data. So far I've run this: fit - agnes(mydata, diss= FALSE, metric = euclidean, stand=FALSE,

Re: [R] How download Yahoo Quote?

2011-08-27 Thread Yumin
Hi Michael: I installed: install. packages(quantmod) and now it accept library(quantmod) sentence. BUT after input: * con - url(http://quote.yahoo.com;) if(!inherits(try(open(con), silent = TRUE), try-error)) {

Re: [R] Legent to the Periodogram

2011-08-27 Thread Peter Maclean
How Can I add a legent (showing x1, x2, x3, x4) to the last plot? require(TSA) require(graphics) require(stats) t-1986:2011 x1-cos(t*1990/2011) x2-cos(t*2000/20011) x3-sin(t*1990/2011) x4-sin(t*2000/2011) y-cbind(t,x1,x2, x3,x4) y.time = ts(y.time, start=1986, frequency=1) y.spc-spec.pgram(y.time,

Re: [R] How download Yahoo Quote?

2011-08-27 Thread R. Michael Weylandt
What is wrong with the getSymbols(IBM) command I originally suggested to you? Michael On Sat, Aug 27, 2011 at 6:23 PM, Yumin zpx...@gmail.com wrote: Hi Michael: I installed: install. packages(quantmod) and now it accept library(quantmod) sentence. BUT after input: *

Re: [R] Ordered probit model -marginal effects and relative importance of each predictor-

2011-08-27 Thread David Winsemius
On Aug 27, 2011, at 3:15 PM, franco salerno wrote: Hi, I have a problem with the ordered probit model -polr function (library MASS). My independent variables are countinuos. I am not able to understand two main points: a) how to calculate marginal effects b) how to calculate the relative

Re: [R] control line break behavior of R output

2011-08-27 Thread David Winsemius
On Aug 27, 2011, at 8:19 PM, Martin Batholdy wrote: Hi, Is it possible to define at which point a line-break is happening in R-output? I for example would rather like to scroll horizontally in a data- frame with a lot of columns instead of having a lot of breakpoints in the data.frame

Re: [R] Legent to the Periodogram

2011-08-27 Thread Mikhail Titov
plot.spec uses matplot. see ?matplot for default col lty and use legend as usual. P.S. You can add plot=FALSE to spec.pgram to prevent it from plotting On 08/27/2011 05:39 PM, Peter Maclean wrote: How Can I add a legent (showing x1, x2, x3, x4) to the last plot? require(TSA)

[R] Trying to extract probabilities in CARET (caret) package with a glmStepAIC model

2011-08-27 Thread Jon Toledo
Dear developers, I have jutst started working with caret and all the nice features it offers. But I just encountered a problem: I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor). Everything was working fine I got