Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Joshua Ulrich
Deb, See getQuote in the quantmod package. For example: getQuote("SPY") Be sure to read ?getQuote. Best, -- Joshua Ulrich  |  FOSS Trading: www.fosstrading.com On Thu, Nov 3, 2011 at 5:05 PM, Deb Midya wrote: > Michael, > > Thanks for your response. > > The link to the page is: http://www.g

Re: [R] how to count number of occurrences

2011-11-03 Thread uka
This was very helpful. Thank you very much. Just one question, I notice that it does not count the number of X's before the first Y. I want the result be 1 4 0 0 0 5 0 0 0 0. I tried combining this output with the first value of rle output, but realized that rle doesn't give me the 0s. So, if my fi

Re: [R] How to use 'prcomp' with CLUSPLOT?

2011-11-03 Thread Jo Frabetti
Hello, I have a large data set that has more columns than rows (sample data below). I am trying to perform a partitioning cluster analysis and then plot that using pca. I have tried using CLUSPLOT(), but that only allows for 'princomp' where I need 'prcomp' as I do not want to reduce my colum

[R] How to use 'prcomp' with CLUSPLOT?

2011-11-03 Thread Jo Frabetti
Hello, I have a large data set that has more columns than rows (sample data below). I am trying to perform a partitioning cluster analysis and then plot that using pca. I have tried using CLUSPLOT(), but that only allows for 'princomp' where I need 'prcomp' as I do not want to reduce my colum

Re: [R] Grouping clusters from dendrograms

2011-11-03 Thread plangfelder
Hi Julia, sorry for the very late reply, your original email was posted while I was on hiatus from R-help. I'm the author of the dynamicTreeCut package. I recommend that you try using the "hybrid" method using the cutreeDynamic function. What you observed is a known problem of the tree method (wh

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Deb Midya
Michael,   Thanks for your response.   The link to the page is: http://www.gummy-stuff.org/Yahoo-data.htm   I like to download the fields (mentioned under special tags) for a period of time and for a particular stock (or for a list of stocks).   Once again, thank you very much for the time you

Re: [R] problem with merging two matrices

2011-11-03 Thread flokke
Thanks, that helps a lot! -- View this message in context: http://r.789695.n4.nabble.com/problem-with-merging-two-matrices-tp3983136p3988319.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] Kaplan Meier - not for dates

2011-11-03 Thread Lancaster, Robert (Orbitz)
I think it really depends on what your event of interest is. If your event is that the patient got better and "left treatment" then I think this could work. You would have to mark as censored any patient still in treatment or any patient that stopped treatment w/o getting better (e.g. in the c

Re: [R] Select columns of a data.frame by name OR index in a function

2011-11-03 Thread Jean V Adams
Thaler, Thorn, LAUSANNE, Applied Mathematics wrote on 11/03/2011 08:48:26 AM: > > Dear all, > > Sometimes I have the situation where a function takes a data.frame and > an additional argument describing come columns. For greater flexibility > I want to allow for either column names or column ind

Re: [R] query about counting rows of a dataframe

2011-11-03 Thread Jean V Adams
Stefano Sofia wrote on 11/03/2011 11:28:08 AM: > > Dear R users, > I have got the following data frame, called my_df: > >gender day_birth month_birth year_birth labour > 1 F 22 10 2001 1 > 2 M29 10

Re: [R] Plotting skewed normal distribution with a bar plot

2011-11-03 Thread R. Michael Weylandt
It seems like you'll need to apply some sort of MLE to estimate the parameters directly from the data before using dsn() to get the density. This might help with some of it: http://help.rmetrics.org/fGarch/html/snorm.html Michael On Thu, Nov 3, 2011 at 2:54 PM, wrote: > > Hi, > > I need to crea

Re: [R] Histograms in R

2011-11-03 Thread R. Michael Weylandt
You're absolutely right. Was thinking exponential for some reason The rootogram is quite nice; I've never seen one before. Thanks! Michael On Thu, Nov 3, 2011 at 5:39 PM, David L Carlson wrote: > The lines() command doesn't work and histogram combines categories unless > you specify the num

Re: [R] Why can't this function be used with the 'by' command?

2011-11-03 Thread R. Michael Weylandt
I believe it has to do with passing multiple columns to the shapiro.test. Note that by(x[,1:2], x$group, function(x) shapiro.test(x)[[2]]) doesn't work but by(x[,1:2], x$group, function(x) shapiro.test(x[,1])[[2]]) does. Michael On Thu, Nov 3, 2011 at 8:08 AM, Kaiyin Zhong wrote: > Why can't

[R] Help: stemming and stem completion with package tm in R

2011-11-03 Thread Yanchang Zhao
Hi All I came across a problem below when doing stemming and stem completion with package tm in R. Word "mining" was stemmed to "mine" with stemDocument(), and then completed to "miners"with stemCompletion(). However, I prefer to keep "mining" intact. For stemCompletion(), the default type of com

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Joshua Wiley
Hi Mike, I definitely understand your point. I don't have any particularly good ideas, though I think you might like S4, which is the newer formal class/methods system. As a note, I misspoke (or miswrote) that difftime inherits from numeric---the mode is numeric, but does not inherit. Cheers,

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Hadley Wickham
>    I agree that it is non-trivial to solve the cases you & I have posed. >  However, I would wholeheartedly support having an error spit back for any > function that does not explicitly support a class.  In this case, if I > attempt to do   sapply(x, class), and 'x' is of class "difftime", then I

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Hadley Wickham
>    In the example I give above, the impact might seem small, but the > implications are *huge*.  This means that I am, in effect, not allowed to > use *any* of the vectoring functions in 'R', which avoid performing loops > thereby speeding up process time extraordinarily.  Many can sympathize tha

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Richard M. Heiberger
Mike, On time classes specifically, the lubridate package with documentation Garrett Grolemund, Hadley Wickham (2011). Dates and Times Made Easy with lubridate. Journal of Statistical Software, 40(3), 1-25. http://www.jstatsoft.org/v40/i03/. solves many confusion problems. Does it handle the

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Mike Williamson
Hi Joshua, Thank you for the input! I agree that it is non-trivial to solve the cases you & I have posed. However, I would wholeheartedly support having an error spit back for any function that does not explicitly support a class. In this case, if I attempt to do sapply(x, class), and

Re: [R] Problem with R CMD check and the inconsolata font business.

2011-11-03 Thread Brian Diggs
On 11/3/2011 3:30 PM, Brian Diggs wrote: The error on R CMD check I get is: * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: !pdfTeX error: pdflatex.EXE (file ec-inconsolata): Font ec-inconsolata at 5

Re: [R] Problem with R CMD check and the inconsolata font business.

2011-11-03 Thread Ray Brownrigg
On Fri, 04 Nov 2011, Brian Diggs wrote: > On 11/3/2011 2:29 PM, Rolf Turner wrote: > > On 03/11/11 20:37, Rolf Turner wrote: > >> I have just installed R version 2.14.0 and tried to re-build and > >> re-check some > >> of the packages that I maintain. > >> > >> I'm getting a warning (in the proces

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread William Dunlap
I neglected to give another benefit of putting your algorithms into functions: you can use the compiler package to compile them, which can give a big boost in speed. E.g., I compiled the functions f0, f1, and f2 that I defined earlier to make new functions f0_c, f1_c, and f2_c: > library(compiler

Re: [R] Question about Calculation of Cross Product

2011-11-03 Thread Rolf Turner
On 04/11/11 11:30, Jeff Newmiller wrote: The crossprod function in base R implements the MATRIX cross product, more familiarly known as "matrix multiplication". The term "crossprod" is thereby rather misleading, nicht wahr? Wouldn't it be *nice* to put into the help file a wee warning telling

Re: [R] Problem with R CMD check and the inconsolata font business.

2011-11-03 Thread Brian Diggs
On 11/3/2011 2:29 PM, Rolf Turner wrote: On 03/11/11 20:37, Rolf Turner wrote: I have just installed R version 2.14.0 and tried to re-build and re-check some of the packages that I maintain. I'm getting a warning (in the process of running R CMD check on my "deldir" package): * checking PDF

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread Carl Witthoft
I have to admit to not doing careful timing tests, but I often eliminate if() lines as follows (bad/good is just my preference) BAD: b[i] <- if(a[i]>1) a[i] else a[i-1] GOOD: b[i] <- a[i]* (a[i]>1) + a[i-1] * (a[i]<=1) On Thu, Nov 3, 2011 at 12:10 PM, hihi wrote: > Dear Members, > > I wo

Re: [R] Question about Calculation of Cross Product

2011-11-03 Thread Jeff Newmiller
The crossprod function in base R implements the MATRIX cross product, more familiarly known as "matrix multiplication". --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

Re: [R] How much data can R process?

2011-11-03 Thread Carl Witthoft
My answer is similar: how much data? All of it. And shame on the OP for ever using Excel. From: Rolf Turner Date: Thu, 03 Nov 2011 22:20:17 +1300 On 03/11/11 15:59, Nicholay Anne Caumeran wrote: > Would like to know how much data can R process - number of rows and columns? How long is a pie

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread William Dunlap
You should get familiar with some basic timing tools and techniques so you can investigate things like this yourself. system.time is the most basic timing tool. E.g., > system.time(for(i in 1:1000)f0(a)) user system elapsed 22.920 0.000 22.932 means it took c. 23 seconds of real tim

Re: [R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Joshua Wiley
Hi Mike, This isn't really an answer to your question, but perhaps will serve to continue discussion. I think that there are some fundamental issues when working special classes. As a thought example, suppose I wrote a class, "posreal", which inherits from the numeric class. It is only valid fo

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread R. Michael Weylandt
Yes -- if & else is much faster than ifelse() because if is a primitive while ifelse() is a whole function call (in fact, you can see the code by typing ifelse into the prompt and see that it has two if calls within it. Michael On Thu, Nov 3, 2011 at 4:38 PM, hihi wrote: > Hi, > thank you for yo

Re: [R] Histograms in R

2011-11-03 Thread David L Carlson
The lines() command doesn't work and histogram combines categories unless you specify the number. How about a barplot Lam <- 3 X <- table(rpois(500, Lam)) Max <- length(X)-1 barplot(rbind(X, 500*dpois(0:Max, Lam)), beside=TRUE, legend.text=c("Observed", "Expected")) or a rootogram library(vcd) ro

Re: [R] Problem with R CMD check and the inconsolata font business.

2011-11-03 Thread Rolf Turner
On 03/11/11 20:37, Rolf Turner wrote: I have just installed R version 2.14.0 and tried to re-build and re-check some of the packages that I maintain. I'm getting a warning (in the process of running R CMD check on my "deldir" package): * checking PDF version of manual ... WARNING LaTeX er

Re: [R] Kaplan Meier - not for dates

2011-11-03 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
Thanks for the reply. The treatment is effectively for a chronic condition - so you stay on the treatment till it stops working. We know from trials how long that should be and we know the theoretical cost of that treatment but that's based on the text book dose (patients dose reduce and delay

Re: [R] Reclassify string values

2011-11-03 Thread David Winsemius
On Nov 3, 2011, at 4:40 PM, Peter Langfelder wrote: On Thu, Nov 3, 2011 at 1:31 PM, Zev Ross wrote: Hi Peter, Thanks for the response. What you've suggested works fine but I'm looking for something that is simpler than my solution and avoids the pesky warning message. Your response avoid

Re: [R] Searching elements in list

2011-11-03 Thread David Winsemius
On Nov 3, 2011, at 3:21 PM, mstepano wrote: I forget to mention that the vectors are ordered. I think that one of the possible solutions is to use lapply, i.e., < T %in% lapply(allv, function(x,y) all.equal(x,y),y=somev) [1] TRUE all.equal worked fine when the answer was 'true' but not so

Re: [R] Reclassify string values

2011-11-03 Thread Peter Langfelder
On Thu, Nov 3, 2011 at 1:31 PM, Zev Ross wrote: > Hi Peter, > > Thanks for the response. What you've suggested works fine but I'm looking > for something that is simpler than my solution and avoids the pesky warning > message. Your response avoids the warning message but just as complex (if > not

Re: [R] Problem with R CMD check and the inconsolata font business.

2011-11-03 Thread Brian Diggs
On 11/3/2011 12:37 AM, Rolf Turner wrote: I have just installed R version 2.14.0 and tried to re-build and re-check some of the packages that I maintain. I'm getting a warning (in the process of running R CMD check on my "deldir" package): * checking PDF version of manual ... WARNING LaTeX er

Re: [R] Reclassify string values

2011-11-03 Thread Zev Ross
Hi Peter, Thanks for the response. What you've suggested works fine but I'm looking for something that is simpler than my solution and avoids the pesky warning message. Your response avoids the warning message but just as complex (if not more). I just assumed there would be a function along t

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread hihi
Thank you, I will try as soon as possible... Regards, Peter 2011/11/3 Mark Leeds > hi hihi: you're not using the ifelse construct correctly because it's > already vectorized > so there's no need to use a loop. > > check if below works AND if it's fast enough because I didn't check either > one.

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread Dennis Murphy
Hi: You're doing the right thing in R by pre-allocating memory for the result, but ifelse() is a vectorized function and your loop is operating elementwise, so if-else is more appropriate. Try for (i in 2:100){ b_vec[i] <- if(abs(b_vec[i-1] + a_vec[i]) > 1) a_vec[i] else b_vec[i-1] + a_vec[i]

Re: [R] Comparing negative binomial models

2011-11-03 Thread Ben Bolker
Davg hotmail.com> writes: > I am trying to compare negative binomial models for the prediction of sports > games (I know that Poisson models would be better but I'm just trying > Negative Binomial at the moment). > > But, to compare the models I need them to have the same theta value. How > can

Re: [R] Histograms in R

2011-11-03 Thread R. Michael Weylandt
Try something like this Lam <- 3 X <- rpois(500, Lam) hist(X, freq = F) x <- seq(min(X), max(X), length = 500) lines(x, dpois(x, Lam), col=2) Adapt as necessary Michael On Nov 3, 2011, at 8:03 AM, kerry1912 wrote: > We have a histogram of our observed response and we want to overlay the > cor

Re: [R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread R. Michael Weylandt
I don't immediately see a good trick for vectorization so this seems to me to be a good candidate for work in a lower-level language. Staying within R, I'd suggest you use if and else rather than ifelse() since your computation isn't vectorized: this will eliminate a small amount over overhead.

Re: [R] Searching elements in list

2011-11-03 Thread mstepano
I forget to mention that the vectors are ordered. I think that one of the possible solutions is to use lapply, i.e., < T %in% lapply(allv, function(x,y) all.equal(x,y),y=somev) [1] TRUE -- View this message in context: http://r.789695.n4.nabble.com/Searching-elements-in-list-tp3987066p3987487.h

[R] Searching elements in list

2011-11-03 Thread mstepano
Hi all, I have a list ov vectors of enequal lenght and need to check is the given vector in list. > v1<-c(1,2) > v2<-c(1,2,3) > v3<-c(1,3) > allv<-list(v1,v2,v3) > > somev<-c(1,2) > somev%in%allv [1] FALSE FALSE Hence, %in% checks that elements of vector somev are in list. How it is possible to

[R] [R-pkgs] new version of FRAILTYPACK: general frailty models

2011-11-03 Thread Rondeau Virginie
Dear R users, We are pleased to tell you that "FRAILTYPACK" has been updated. "FRAILTYPACK" stands now for general frailty models estimated with a semi-parametrical penalized likelihood, but also with a parametrical approach. In case of comments/corrections/remarks/suggestions -- which are ve

Re: [R] Reclassify string values

2011-11-03 Thread Peter Langfelder
On Thu, Nov 3, 2011 at 11:59 AM, Zev Ross wrote: > Hi All, > > Is there a simple way to convert a string such as c("A", "B" ,"C", "D") to a > string of c("Group1", "Group1", "Group2", "Group2"). Naturally I could use > the factor function as below but I don't like seeing that warning message > (an

[R] Is it possible to vectorize/accelerate this?

2011-11-03 Thread hihi
Dear Members, I work on a simulaton experiment but it has an bottleneck. It's quite fast because of R and vectorizing, but it has a very slow for loop. The adjacent element of a vector (in terms of index number) depends conditionally on the former value of itself. Like a simple cumulating funct

Re: [R] data frame to workspace

2011-11-03 Thread R. Michael Weylandt
What did you do to create/save/load your data frame? There are n -> infty ways to do all three of those steps and it's hard to give meaningful help without knowing what you tried. M On Nov 3, 2011, at 11:46 AM, playballa23 wrote: > Is there a way to import a data frame into a workspace? I cr

[R] Plotting skewed normal distribution with a bar plot

2011-11-03 Thread Steve_Friedman
Hi, I need to create a plot (type = "h") and then overlay a skewed-normal curve on this distribution, but I'm not finding a procedure to accomplish this. I want to use the plot function here in order to control the bin distributions. I have explored the sn library and found the dsn function. d

[R] Reclassify string values

2011-11-03 Thread Zev Ross
Hi All, Is there a simple way to convert a string such as c("A", "B" ,"C", "D") to a string of c("Group1", "Group1", "Group2", "Group2"). Naturally I could use the factor function as below but I don't like seeing that warning message (and I don't want to turn off warning messages). Perhaps a

Re: [R] For loop to cycle through datasets of differing lengths

2011-11-03 Thread Peter Langfelder
On Thu, Nov 3, 2011 at 11:41 AM, Schatzi wrote: > I have encountered this problem on several occasions and am not sure how to > handle it. I use for-loops to cycle through datasets. When each dataset is > of equal length, it works fine as I can combine the datasets and have each > loop pick up a d

[R] For loop to cycle through datasets of differing lengths

2011-11-03 Thread Schatzi
I have encountered this problem on several occasions and am not sure how to handle it. I use for-loops to cycle through datasets. When each dataset is of equal length, it works fine as I can combine the datasets and have each loop pick up a different column, but when the datasets are differing leng

Re: [R] Create design matrix

2011-11-03 Thread Bert Gunter
?expand.grid is what you're looking for, I think. (which, I agree, is not something one could easily guess) -- Bert On Thu, Nov 3, 2011 at 10:56 AM, Bond, Stephen wrote: > Greetings useRs, > > What is the easiest way to create a design matrix of several factor > variables? Function gendata in

Re: [R] Create design matrix

2011-11-03 Thread Justin Haynes
?expand.grid > expand.grid(c("M","F"),c("Y","O")) Var1 Var2 1MY 2FY 3MO 4FO > Justin On Thu, Nov 3, 2011 at 10:56 AM, Bond, Stephen wrote: > Greetings useRs, > > What is the easiest way to create a design matrix of several factor > variables? Function gendata

Re: [R] problem with merging two matrices

2011-11-03 Thread Sarah Goslee
Hi, On Thu, Nov 3, 2011 at 12:31 PM, flokke wrote: > Dear Sarah, > THanks for your answer! > Sorry that my thread is somehow not clear, that's because I am not really > experienced with R and > dont know yet how to put thinings in words.. > > I am not trying to work with them differently, I am ju

[R] Create design matrix

2011-11-03 Thread Bond, Stephen
Greetings useRs, What is the easiest way to create a design matrix of several factor variables? Function gendata in Design seems to do that for a fitted model, but how to do that only on several factor vectors?? The result should be a df with one row for each distinct combination of levels of

[R] any updates w.r.t. lapply, sapply, apply retaining classes

2011-11-03 Thread Mike Williamson
Hi All, I don't have a "I need help" question, so much as a query into any update whether 'R' has made any progress with some of the core functions retaining classes. As an example, because it's one of the cases that most egregiously impacts me & my work and keeps pushing me away from 'R' and

Re: [R] EMD arguments default values

2011-11-03 Thread Raphael Saldanha
The help shows: emd(xt, tt=NULL, tol=sd(xt)*0.1^2, max.sift=20, stoprule="type1", boundary="periodic", smlevels=c(1), sm="none", spar=NA, weight=20, check=FALSE, max.imf=10, plot.imf=TRUE, interm=NULL) You can use ?emd to show the help and see the defaults. On Thu, Nov 3, 2011 at 9:13 AM, Sara

Re: [R] optimising a loop

2011-11-03 Thread jim holtman
try this: > nom.plac2 <- c("102", "103", "301", "303","304", "403") > poids2 <- matrix(NA, 6,6, dimnames=list(nom.plac2,nom.plac2)) > poids2 102 103 301 303 304 403 102 NA NA NA NA NA NA 103 NA NA NA NA NA NA 301 NA NA NA NA NA NA 303 NA NA NA NA NA NA 304 NA NA NA

Re: [R] take me off the list

2011-11-03 Thread Rich Shepard
On Thu, 3 Nov 2011, Alan Gao wrote: Alan, This is a self-service mail list; no maids to do the work for you. Go to the Web site , navigate to the mail list page, and unsubscribe yourself. Rich __ R-help@r-project.org mail

Re: [R] Creating barplot using time as X

2011-11-03 Thread PEL
Thank you very much. This is exactly what I needed. Problem solved! Thanks again PEL -- View this message in context: http://r.789695.n4.nabble.com/Creating-barplot-using-time-as-X-tp3981961p3986882.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Uploding package help

2011-11-03 Thread Prof Brian Ripley
See 'Writing R Extensions', http://cran.r-project.org/doc/manuals/R-exts.html#Submitting-a-package-to-CRAN However, you can only submit a package: other people actually upload it to CRAN, if they accept it. On Thu, 3 Nov 2011, Reema Singh wrote: Hello All I want to upload a R package in CRA

[R] L1 penalization for proportional odds logistic regression

2011-11-03 Thread blackscorpio
Dear community, I am currently attempting to perform a (L1) penalized ordinal logistic regression with proportional odds. For the moment I only found R packages allowing to perform forward or backward continuation ratio model with several penalizations. Does anyone have a clue of what R package I c

Re: [R] optimising a loop

2011-11-03 Thread William Dunlap
Try replacing your for loop with the line loop[cbind(as.vector(row(voisin)), match(voisin, nom.plac2))] <- as.vector(wei2) Look help(Subscript) to see how subscripting an n-way array by an n-column integer matrix works. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original

Re: [R] XLConnect Error

2011-11-03 Thread dcelta
Hi, I am having the same issue as described by the original subscriber can you offer any guidance on how to install Java ??? Do I need to do this from the R command line ??? or do I need to do this outside of the application?? Thanks Daniel -- View this message in context: http://r.78

Re: [R] data frame to workspace

2011-11-03 Thread Raphael Saldanha
Hi, When you saves a workspace, all the objects created are saved inside the workspace. When you restarts R, you are loading this workspace? (Se quiser que eu te responda em português, me envie um e-mali direto para saldanha.plan...@gmail.com). On Thu, Nov 3, 2011 at 1:46 PM, playballa23 wrote:

[R] Uploding package help

2011-11-03 Thread Reema Singh
Hello All I want to upload a R package in CRAN. Kindly tell me how to upload a new package in CRAN REGARDS~ Reema Singh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] Back-transforming in lme

2011-11-03 Thread Allan Carson
Hello I am analysing aboveground biomass data from revegetation testplots which I constructed in a split-plot design using the function lme. For the experiment, the three factors are amelioration (2 levels), fertilizer (2 levels) and treatment (7 levels). Each testplot (block) has a singlerepli

[R] Histograms in R

2011-11-03 Thread kerry1912
We have a histogram of our observed response and we want to overlay the corresponding poisson distribution with respect to our poisson model. -- View this message in context: http://r.789695.n4.nabble.com/Histograms-in-R-tp3985397p3985397.html Sent from the R help mailing list archive at Nabble

Re: [R] problem with merging two matrices

2011-11-03 Thread flokke
Dear Sarah, THanks for your answer! Sorry that my thread is somehow not clear, that's because I am not really experienced with R and dont know yet how to put thinings in words.. I am not trying to work with them differently, I am just trying to print them as the result of a function. But as the

[R] Fit continuous distribution to truncated empirical values

2011-11-03 Thread Michele Mazzucco
Hi all, I am trying to fit a distribution to some data about survival times. I am interested only in a specific interval, e.g., while the data lies in the interval (0,, 600), I want the best for the interval (0,..., 24). I have tried both fitdistr (MASS package) and fitdist (from the fitdist

[R] take me off the list

2011-11-03 Thread Alan Gao
thank you. Alan Gao University of Michigan '12 Statistics, B.S. 239.682.3509 __ 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 com

[R] Comparing negative binomial models

2011-11-03 Thread Davg
Hi, I am trying to compare negative binomial models for the prediction of sports games (I know that Poisson models would be better but I'm just trying Negative Binomial at the moment). But, to compare the models I need them to have the same theta value. How can I change the explanatory variables

[R] data frame to workspace

2011-11-03 Thread playballa23
Is there a way to import a data frame into a workspace? I created a data frame and from my understanding, a data frame is a type of object, and that the workspace stores the current session's objects. Wondering why my data frame is not showing up... Any thoughts/suggestions? -- View this message

[R] EMD arguments default values

2011-11-03 Thread Sara
Hi, i'm using this command line with EMD package filename<-emd(y,x,boundary="wave",plot.imf=F) i'd like to know if this EMD uses default values for non-specified arguments. i'm especially interested in "stoprule", "max.imf", "tol" behavior in such cases. Thanks ___

[R] Why can't this function be used with the 'by' command?

2011-11-03 Thread Kaiyin Zhong
Why can't this function be used with the 'by' command? > x = array(runif(16), dim=c(8,2)) > x = data.frame(x) > x$group = rep(c('wt', 'app'), each=4) > shapiro.p = function(x) shapiro.test(x)[[2]] > apply(x[,1:2], 2, shapiro.p) X1X2 0.4126345 0.2208781 > by(x[,1:2], x$group, shapi

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread Deb Midya
Vikram,   Thanks for this.   The field names we put like this: quote = c("Open", "High", "Low", "Close")   But in order to download all the fields, what are the names I need to use in the object quote.  In Yahho Finance these are special tags.   The special tags are: a=Ask, b= Bid, .

Re: [R] Sum with condition

2011-11-03 Thread Celine
Problem solved, thanks everyone for your help. Céline -- View this message in context: http://r.789695.n4.nabble.com/Sum-with-condition-tp3972839p3984909.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

[R] How to interpret vglm output!!

2011-11-03 Thread Akram Khaleghei Ghosheh balagh
Hello , I need to estimate the parameters of generalized poisson regression model. I found that I could use : vglm(formula, family,.., data), but I dont know how to interpret the output!!! min 1Q Median 3Q Max elogit (lambda)-.66 -.61

Re: [R] does there any function like sumif in excel?

2011-11-03 Thread Celine
Sorry for the duplicates message and thanks for your help, it works well now. Céline -- View this message in context: http://r.789695.n4.nabble.com/does-there-any-function-like-sumif-in-excel-tp858444p3984899.html Sent from the R help mailing list archive at Nabble.com.

[R] RpgSQL vs RPostgreSQL

2011-11-03 Thread Ben quant
Hello, Could someone who has experience with or knowledge regarding both RPostgreSQL and RpgSQL packages provide some feedback? Thanks! I am most interested in hearing from people who have knowledge regarding both packages, not just one. The only real difference I can see is that RpgSQL has a Jav

[R] optimising a loop

2011-11-03 Thread Bastien.Ferland-Raymond
Dear R community, I'm trying to remove a loop from my code but I'm stock and I can't find a good way to do it. Hopefully one of you will have something clever to propose. Here is a simplified example: I have a squared matrix: > nom.plac2 <- c("102", "103", "301", "303","304", "403") > poids2

Re: [R] variable transformation for lm

2011-11-03 Thread David Winsemius
On Nov 3, 2011, at 11:55 AM, "Johannes Radinger" wrote: > Hello, > > I am doing a simple regression using lm(Y~X). > As my response and my predictor seemed to be skewed > and I can't meet the model assumptions. Therefore > I need to transform my variables. The presence of skewness in either o

Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread AC Del Re
Thats a good start but I am looking for more. Specifically (from previous post): 4x4 matrix (based on the maximum number of factor levels in 'o') for each 'id' as a list. Each matrix would have v in the diagonal and r*s*s in the off-diagonal (e.g., .5*2.0814*.1095 = 0.1139), where r is constant (

Re: [R] variable transformation for lm

2011-11-03 Thread Bert Gunter
See the acepack package or the transace function in Hmisc for ACE or AVAS. -- Bert On Thu, Nov 3, 2011 at 8:55 AM, Johannes Radinger wrote: > Hello, > > I am doing a simple regression using lm(Y~X). > As my response and my predictor seemed to be skewed > and I can't meet the model assumptions.

Re: [R] Lattice plots and missing x-axis labels on second page

2011-11-03 Thread Bert Gunter
A follow-up to my reply below. My explanation below is correct AFAICS, but my proposed remedy using "alternating" is not. Instead(again, AFAICS), one must use even finer control with the "at" and "labels" components of scales.This "worked" for me. -- Bert On Thu, Nov 3, 2011 at 6:40 AM, Bert Gun

[R] query about counting rows of a dataframe

2011-11-03 Thread Stefano Sofia
Dear R users, I have got the following data frame, called my_df: gender day_birth month_birth year_birth labour 1 F 22 10 2001 1 2 M29 10 2001 2 3 M 1

Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread jose Bartolomei
I missed; using the Hadley Wickham plyr package >library (plyr)> dlply(dat, .(id)) $`1` id o r v s 1 1 1 0.5 -1.7131858 -2.0548666 2 1 2 0.5 0.6582979 0.9688939 3 1 3 0.5 -0.6861830 2.4213072 4 1 4 0.5 1.4134171 -0.4540244$`2` id o r v s 5 2 1

Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread jose Bartolomei
If i understood correctly this may help you > dlply(dat, .(id)) $`1` id o r v s 1 1 1 0.5 -1.7131858 -2.0548666 2 1 2 0.5 0.6582979 0.9688939 3 1 3 0.5 -0.6861830 2.4213072 4 1 4 0.5 1.4134171 -0.4540244$`2` id o r v s 5 2 1 0.5 0.2771839 1.06

Re: [R] Sample size calculations for one sided binomial exact test

2011-11-03 Thread Marc Schwartz
From: https://stat.ethz.ch/pipermail/r-help/2011-November/294329.html > I'm trying to compute sample size requirements for a binomial exact test. > we want to show that the proportion is at least 90% assuming that it is > 95%, with 80% power so any asymptotic approximations are out of the > quest

[R] Take variables in data.frame and create list of matrices

2011-11-03 Thread AC Del Re
Hi, I have this sample data below and would like to create a list of matricies. setseed(1254) id <- c(1,1,1,1 ,2,2,2) o <- as.factor(c(1:4, 1, 3, 4)) r <- rep(.5, 7) v <- rnorm(7) s <- rnorm(7) dat <-data.frame(id, o, r, v, s) dat #> dat # id o r v s # 1 1 0.5 0.7024631 2

[R] variable transformation for lm

2011-11-03 Thread Johannes Radinger
Hello, I am doing a simple regression using lm(Y~X). As my response and my predictor seemed to be skewed and I can't meet the model assumptions. Therefore I need to transform my variables. I wanted to ask what is the preferred way to find out if predictor and/or response needs to be transformed a

Re: [R] Creating barplot using time as X

2011-11-03 Thread Richard M. Heiberger
This should get you started. > PEL <- read.table("http://r.789695.n4.nabble.com/file/n3981961/example.txt";, header=TRUE, sep="\t") > PELtable <- with(PEL, tapply(phasetime, data.frame(activity, as.Date(beg)), sum)) > PELtable as.Date.beg. activity 2010-06-03 2010-06-04 2010-06-05 2010-06-

Re: [R] HOW TO REMOVE MTEXT FROM PLOT, plotting changing populations with titles in loop

2011-11-03 Thread Uwe Ligges
On 02.11.2011 20:29, Sarah Goslee wrote: It's not perfect, but you could use: mtext(paste("this is iteration ", i, sep=""), col="white") to overwrite it, or polygon() to draw a white rectangle over the text each time. The question is if it is not better to do the whole plot again and just

Re: [R] non-parametric sample size calculation

2011-11-03 Thread Marc Schwartz
On Nov 3, 2011, at 3:47 AM, David A. wrote: > > Hi, > > I am trying to estimate the sample size needed for the comparison of two > groups on a certain measurement, given some previous data at hand. I find > that the data collected does not follow a normal distribution, so I would > like to us

Re: [R] grep fixed (?) in 2.14

2011-11-03 Thread Stephen Sefick
That did the trick. I have read about regular expressions often, and sometimes I get them right and sometimes I don't. Is there a good reference resource that anyone could suggest? Thanks for all of the help. Stephen Sefick On 11/03/2011 08:03 AM, jim holtman wrote: your syntax is wrong,

[R] Select columns of a data.frame by name OR index in a function

2011-11-03 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Dear all, Sometimes I have the situation where a function takes a data.frame and an additional argument describing come columns. For greater flexibility I want to allow for either column names or column indices. What I usually do then is something like the following: -8<-

Re: [R] Lattice plots and missing x-axis labels on second page

2011-11-03 Thread Bert Gunter
I believe that the explanation is: Axes, including tick labels, appear only on the "edges" of the trellis array, which in your case would be at the bottom of the 4th row. However, on the second page there is no 4th row, and lattice is not smart enough to put them instead at the bottom of the secon

Re: [R] Extract Data from Yahoo Finance

2011-11-03 Thread R. Michael Weylandt
The quantmod package can probably do what you are asking, but it's a little hard to be certain since you provide neither a list of all the fields you are actually talking about nor a link to the page with the fields in question. Michael On Thu, Nov 3, 2011 at 12:02 AM, Deb Midya wrote: > Hi R –u

  1   2   >