[R] mvpart - easy way to calculate deviance explained by variables

2014-04-22 Thread Kumar Mainali
Dear R-users, I can use mvpart function of library mvpart to get a decision tree. The output of decision tree could be something like the following. I can use it to manually calculate deviance explained by the variable in the first split as below. There should be an easy way to tabulate deviance

Re: [R] Read.table mucks up headers

2014-04-22 Thread Pavneet Arora
Hello Uwe I tried both the options you mentioned, but it didnt work. All i get as output then is the header line and the headers as row.names and X. I am using R-Studio v0.98 From: Uwe Ligges lig...@statistik.tu-dortmund.de To: Pavneet Arora/UK/RoyalSun@RoyalSun,

Re: [R] List of Dataframes

2014-04-22 Thread Timothy W. Cook
On Mon, Apr 21, 2014 at 10:01 PM, arun smartpink...@yahoo.com wrote: Hi, #or you could use: do.call(rbind,result) A.K. Excellent. Thank you. That also saves a library requirement sine I am not using plyr anywhere else. Cheers, Tim On Monday, April 21, 2014 4:48 PM, Timothy W. Cook

Re: [R] List of Dataframes

2014-04-22 Thread Timothy W. Cook
On Tue, Apr 22, 2014 at 12:24 AM, Jim Holtman jholt...@gmail.com wrote: also do.call(rbind, result) Thanks Jim. I appreciate it. Sent from my iPad On Apr 21, 2014, at 16:47, Timothy W. Cook t...@mlhim.org wrote: Okay, all day on this and I send the msg. and almost immediately

[R] Fetch tweets using searchTwitter()

2014-04-22 Thread tripti gupta
Hi, I have installed R in windows7. I was trying to fetch twitter data using searchTwitter() for a specific text [package: twitter]. The number of tweets received are less as compared the tweets requested. And I get a warning message as Warning message: In doRppAPICall(search/tweets, n, params =

[R] lm models over all possible pairwise combinations of the columns of two matrices

2014-04-22 Thread Matthew Robinson
Dear all, I am working through a problem at the moment and have got stuck. I have searched around on the help list for assistance but could not find anything - but apologies if I have missed something. A dummy example of my problem is below. I will continue to work on it, but any help would be

[R] joint distribution

2014-04-22 Thread Ms khulood aljehani
Hello i have two independent variablesx1 from normal (0,1)x2 from bernoulli (o.75) i need the density estimation of(b1*x1) + (b2*x2) where b1 and b2 are two fixed coefficients thank you [[alternative HTML version deleted]]

Re: [R] find maximum values on the density function of a bimodal distribution

2014-04-22 Thread David Carlson
Following on Bert's comments, you can see some of the issues by plotting histograms of the original data: hist(rv, breaks=15) abline(v= d.rv$x[c(mode1, mode2)], lty=2) hist(rv, breaks=25) abline(v= d.rv$x[c(mode1, mode2)], lty=2) The density plot smooths the values into two peaks, but the

Re: [R] joint distribution

2014-04-22 Thread Prof. Dr. Matthias Kohl
have a look at our package distr: library(distr) x1 - Norm(mean = 0, sd = 1) x2 - Binom(size = 1, prob = 0.75) x3 - x1 + x2 plot(x3) # to get density, cdf, quantile, and random numbers use d(x3)(5) p(x3)(0) q(x3)(0.975) r(x3)(20) # you can also have additonal coefficients; eg. x4 - 3*x1 + 2*x2

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-22 Thread starter
That is what I was trying to achieve; i.e. plot all my graphs using a loop function. But somewhere in the loop it converts each graph into png or bitmap image and then compiles all these png or bitmap images in a pdf file. So each page in a pdf file is a bitmap or png picture of my graph. Does

Re: [R] lm models over all possible pairwise combinations of the columns of two matrices

2014-04-22 Thread Bert Gunter
Well... If my arithmetic and understanding is correct, that's 32 billion combinations, which, to put it politely, is nuts. As all you'll be doing is generating random numbers anyway, the fastest way to do this is just to use a random number generator. Cheers, Bert Bert Gunter Genentech

Re: [R] metafor - rstudent(res) - omitted rows

2014-04-22 Thread Viechtbauer Wolfgang (STAT)
I think this may help: http://www.metafor-project.org/doku.php/tips:handling_missing_data I am not sure I understand your second question. All studies are shown (for which the standardized residual can be computed), but since there are so many studies, these plots are not really all that

[R] KappaSize

2014-04-22 Thread Carlos Javier Rincon Rodriguez
Hello, good morning. I need to calculate a kappa coeficient between three raters and the scale have five categories outcome. Until now I read the command CI3Cats for the package KappaSize in order to calculate the sample size, but when i save the package into the library, R can read it and i dont

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-22 Thread Jeff Newmiller
Sounds like you are getting what you want... except that you used the word but. If you are not getting what you want, then what is it that you do want? In particular, how do you intend to review or use many plots generated at once if not in a PDF file?

Re: [R] KappaSize

2014-04-22 Thread Bert Gunter
update to the latest R version first. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Tue, Apr 22, 2014 at 7:26 AM, Carlos Javier Rincon Rodriguez

Re: [R] Need to download this data... can someone help?

2014-04-22 Thread Christofer Bogaso
Hi Rui, Sorry to late reply. Thanks for your pointer. However using this method, I am having difficulty to download related data from same site. I need to download data from: '

Re: [R] Need to download this data... can someone help?

2014-04-22 Thread Rui Barradas
Hello, Have you tried which=2? dat - readHTMLTable(readLines(Link), which = 2, header = TRUE, na.strings = -) dat[, 3:15] - lapply(dat[, 3:15], function(x) sub(([[:digit:]]) [ab], \\1, x)) dat[, 3:15] - lapply(dat[, 3:15], function(x)as.numeric(as.character(x))) str(dat) Hope this

Re: [R] Need to download this data... can someone help?

2014-04-22 Thread Rui Barradas
Hello, I've just noticed that na.strings is not needed and will not be used by readHTMLTable. I was with the false impression that the dots argument was to pass other arguments to read.table, but it's not, they're passed to as.data.frame, that doesn't use na.strings. Rui Barradas Em

Re: [R] Hi , Is it possible select a different number of rows by each group with R????

2014-04-22 Thread arun
Hi Marta, It's not clear whether you wanted to select the first n rows specified by field2 in the first dataset or just random rows. ##using a modified example if my guess is correct dat1 - structure(list(field1 = 1:3, field2 = c(3L, 6L, 4L)), .Names = c(field1, field2), class = data.frame,

[R] finding value for a parameter in an equation

2014-04-22 Thread Andras Farkas
Dear All,   please provide some insights for the following:   we have:   D1 -c(0.2,0.6,0.8) D2 -c(114,190,304) IC501 -0.62 IC502 -137.8 ECON -5.95 ALPHA -0.5 M1 -0.84 M2 -0.96   and the equation:   1 =

Re: [R] Need to download this data... can someone help?

2014-04-22 Thread Rui Barradas
Hello, I'm getting the data, apparently correct. What I'm getting is the following: dput(dat) structure(list(Updated = structure(c(1L, 1L, 1L, 4L, 6L, 5L, 7L, 6L, 2L, 3L), .Label = c(09:06:41 CT 22 Apr 2014, 10:57:42 CT 22 Apr 2014, 10:57:46 CT 22 Apr 2014, 11:10:10 CT 22 Apr 2014, 11:21:31

[R] detecting the sourcing of site profile on Startup versus post-Startup

2014-04-22 Thread Benjamin Tyner
Greetings, Is there any way to programmatically detect whether a piece of code is being run within the initial (Startup) sourcing of the site profile? For example, say I have a site profile, /path/to/Rprofile.site. Is there any function my_func which would return different values for these two

[R] Fwd: How to custom initialize such that we can pre-load data and libraries.

2014-04-22 Thread Li Liu
Hello, Everyone, I am learning on Rserve these days. I was wondering whether you could give me an example on how to custom initialize such that we can pre-load data and libraries. Thank you very much! Liu Li [[alternative HTML version deleted]]

[R] loess.control extrapolation

2014-04-22 Thread Kang, Zhuang
Dear r-help, What exactly the extrapolation in loess does by using suface=direct? I tried to dig into stats:::simpleLoess and even the C/fortan code, but find it's real difficult to read through them. A toy example is below, I would appreciate if anyone to show me how to (closely enough)

[R] Questions regarding cvAUC package (cross validation AUC)

2014-04-22 Thread Elena Lopez
Hello, Can anybody help me to estimate the AUC using a cross validation test ?? I have downloaded the cvAUC package and looked at the ci.cvAUC example but it doesn't work with my data. - Where in the example says data and y, do I have to write the name of my own data file and the name of my

[R] How to convert R package and dependencies to debian packages?

2014-04-22 Thread Sathish Kumar
Hi, I need to install R packages in several nodes (10+) in AWS. I wont be able to open R shell in each and do install.packages(foo) This will be done using a configuration management tool like Puppet and it'll be easier if i can do an apt-get installation of R packages automatically. I found a

[R] Problem in handling Date format

2014-04-22 Thread Ashis Deb
Hi all , I have this data like , ashdata YHOO.Open YHOO.High YHOO.Low YHOO.Close YHOO.Volume YHOO.Adjusted 2007-01-03 25.85 26.2625.26 25.6126352700 25.61 2007-01-04 25.64 26.9225.52 26.8532512200 26.85 2007-01-05

[R] JAGS returning error after sampling MCMC chain

2014-04-22 Thread Brandon Vaughan
Hello all, I'm still pretty new to R, and often am unsure of what I am doing. In this case, I am modifying some code for a textbook exercise. The textbook uses BUGS, but the unmodified code for the BUGS version refuses to even run, so I decided to use JAGS instead. The unmodified JAGS code runs

[R] R dataset copyrights

2014-04-22 Thread Soeren Groettrup
Hi everybody, I've been searching the web for quite a time now and haven't found a satisfying answer. I was wondering if the datasets provided within the R packages are open, and thus can be used in publications? Concretely, can the data, for example, be exported from R and uploaded in a

Re: [R] R Example scripts

2014-04-22 Thread Gene Leynes
Duncan, First, thank you. It's amazing how many things R has built in... such as these quirky functions! I really appreciate the example. Second, as it turns out I was looking for something that doesn't exist in bayesm, although it wasn't obvious to me until I followed your answer and read the

Re: [R] Need to download this data... can someone help?

2014-04-22 Thread Christofer Bogaso
Hi Rui, Thanks for your prompt reply. However unfortunately I see that the correct information is not getting fetched. Here I have tried another page: Link - '

[R] LASSO covTest doesn't work when used inside a function

2014-04-22 Thread Brad P
Hello, I have stumbled across a peculiar problem. I am writing code for a simulation, and would like to package it into a function that completes one iteration. I'm using covTest sig. tests for LASSO (link is below to info and the source code). When this function is used within a function (F.1

Re: [R] Problem in handling Date format

2014-04-22 Thread David Winsemius
On Apr 22, 2014, at 10:10 PM, Ashis Deb wrote: Hi all , I have this data like , ashdata YHOO.Open YHOO.High YHOO.Low YHOO.Close YHOO.Volume YHOO.Adjusted 2007-01-03 25.85 26.2625.26 25.6126352700 25.61 2007-01-04 25.64 26.9225.52