Re: [R] how to compure R-squared in glm

2014-11-14 Thread David Winsemius
> On Nov 14, 2014, at 5:48 PM, Aravindhan, K wrote: > > Team, > Can some one help me in computing the R-squared value in glm. > Which version of a pseudo-R^2? What’s the model? > Thanks > Aravindhan > > [[alternative HTML version deleted]] This is a plain text mailing list > R-help@

Re: [R] boot strapping poisson getting warnings and negative values

2014-11-14 Thread David Winsemius
> On Nov 14, 2014, at 6:28 PM, Aravindhan, K wrote: > > Team, > Has anyone looked at this question from me ? it will help me immensely if > someone can provide an answer to this. > > Thanks > Aravindhan > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun..

Re: [R] boot strapping poisson getting warnings and negative values

2014-11-14 Thread Aravindhan, K
Team, Has anyone looked at this question from me ? it will help me immensely if someone can provide an answer to this. Thanks Aravindhan -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of K Aravindhan Sent: Friday, August 08, 2014 7

[R] how to compure R-squared in glm

2014-11-14 Thread Aravindhan, K
Team, Can some one help me in computing the R-squared value in glm. Thanks Aravindhan [[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:/

Re: [R] Data Import to R

2014-11-14 Thread Jeff Newmiller
If your data uses a special marker such as "--" or "n/a" to indicate not available then once you have identified those markers (using any method, though Don's procedure below is what I use) then you can specify them with the na.strings parameter to read.csv. (See the help for read.table for many

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
Thanks. I will try to further simplify the example. On Sat, Nov 15, 2014 at 2:01 AM, Jeff Newmiller wrote: > While you appear to have been thorough in providing access to your code, I > don't think I will install a bunch of your dev code to debug it for you. > The Posting Guide does say your exa

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Jeff Newmiller
While you appear to have been thorough in providing access to your code, I don't think I will install a bunch of your dev code to debug it for you. The Posting Guide does say your example should be minimal, and IMO this doesn't fit that description. You should extract enough generic functions to

Re: [R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
Hi Duncan, thanks for answering and I'm very sorry: I was a bit too quick with letting the example go. This should be self-contained now: require("devtools") ## Dependencies // devtools::install_github("Rappster/conditionr") devtools::install_github("Rappster/typr") devtools::install_github("Ra

[R] Lexical scoping/calling stack issue: R fails to recognize an argument's default value

2014-11-14 Thread Janko Thyson
Dear list, I just encountered a behavior that I've never seen before: Is it possible, that certain argument names (lazy in my case) are special/reserved and thus would lead to unexpected behavior when a calling stack is involved that spreads across functions of three different packages: optionr::

Re: [R] Bootstrap CIs for weighted means of paired differences

2014-11-14 Thread David Winsemius
On Nov 14, 2014, at 12:15 PM, ivan wrote: > Hi, > > I am trying to compute bootstrap confidence intervals for weighted means of > paired differences with the boot package. Unfortunately, the weighted mean > estimate lies out of the confidence bounds and hence I am obviously doing > something wro

Re: [R] select same row in a data frame several times

2014-11-14 Thread MacQueen, Don
Sorry, I was too quick. Try A[ match(B, A$ID2) ,] -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/14/14, 1:45 PM, "Pedro Mardones" wrote: >Dear R user; > >Consider the following toy example > >A <- data.frame(ID1 = c(1

Re: [R] select same row in a data frame several times

2014-11-14 Thread Rolf Turner
On 15/11/14 10:45, Pedro Mardones wrote: Dear R user; Consider the following toy example A <- data.frame(ID1 = c(1,2,3,1,2,3,1,2,3), ID2 = c("a","b","c","d","e","f","g","h","i"), stringsAsFactors = FALSE) B <- sample(a$ID2, 6, replace = TRUE) Lets say B is = "a", "a", "a", "h", "b", "e" I wan

Re: [R] select same row in a data frame several times

2014-11-14 Thread MacQueen, Don
Try B <- c("a", "a", "a", "h", "b", "e") subset(A, ID2 %in% B) or subset(A, ID2 %in% unique(B)) will do as well -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/14/14, 1:45 PM, "Pedro Mardones" wrote: >Dear R user; >

Re: [R] HELP ON NON-LINEAR MIXED MODEL

2014-11-14 Thread Rolf Turner
On 14/11/14 18:29, Popoola Daniel wrote: Good Morning Sir/Ma, I am POPOOLA DANIEL a Forest Biometrician in making from the University of Ibadan, Ibadan Nigeria. Please Sir/Ma I am having issues on performing Non-linear mixed model on R (using maximum likelihood approach). I am trying to input fou

[R] select same row in a data frame several times

2014-11-14 Thread Pedro Mardones
Dear R user; Consider the following toy example A <- data.frame(ID1 = c(1,2,3,1,2,3,1,2,3), ID2 = c("a","b","c","d","e","f","g","h","i"), stringsAsFactors = FALSE) B <- sample(a$ID2, 6, replace = TRUE) Lets say B is = "a", "a", "a", "h", "b", "e" I want to extract from A the rows where ID2 == B

Re: [R] Urgent Help - Editing XML through R

2014-11-14 Thread jim holtman
Here is one way using the XML package: > x <- ' + + + + Open Analysis from Library + /Z- Archive - TO BE + purged/ConditionEmailTest + + + Send Email + + chidambaramselvaku...@gmail.com + chidambaramselvaku...@gmail.com + + Sales Re

[R] Bootstrap CIs for weighted means of paired differences

2014-11-14 Thread ivan
Hi, I am trying to compute bootstrap confidence intervals for weighted means of paired differences with the boot package. Unfortunately, the weighted mean estimate lies out of the confidence bounds and hence I am obviously doing something wrong. Appreciate any help. Thanks. Here is a reproducible

Re: [R] Urgent Help - Editing XML through R

2014-11-14 Thread Duncan Murdoch
On 14/11/2014 12:34 PM, Chidambaram Selvakumar wrote: Hi Team, Can you please help me on the below? 1) Is it possible to achieve the below requirement through or not? Open XMl; find and remove the all the string tag;add new string tag based on the email count; save it in the same XML. 2

Re: [R] Data Import to R

2014-11-14 Thread MacQueen, Don
Petr is almost certainly correct. A further suggestion: Continue to import using stringsAsFactors = FALSE On one of the columns that should be numeric, use as.numeric(), find the NA's in the result of that, and then look at those rows of the data. There will be something there that is non-numeric

Re: [R] How to put inlined C code on a worker node?

2014-11-14 Thread Dirk Eddelbuettel
Mikhail, The canonical recommendation is to wrap you code in a package -- either source or even binary -- and to install it on the nodes. Writing a package is the correct answer to many questions, and is particularly true here. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debia

Re: [R] How to put inlined C code on a worker node?

2014-11-14 Thread Mikhail Umorin
Sorry for the trouble with double posting: I never received my original message through the mailing list so I assumed that it did not go through. I’ll try your suggestions, thank you. Mikhail. > On Nov 14, 2014, at 12:04, Jeff Newmiller wrote: > > Repeating yourself verbatim is poor form. At

Re: [R] How to put inlined C code on a worker node?

2014-11-14 Thread Jeff Newmiller
Repeating yourself verbatim is poor form. At least quote your previous message and indicate that this is a reprise. While I doubt that my opinion is universal, I think that mixing C and R in the same file is already living on the edge of good practice. You are assuming that all of your nodes ha

Re: [R] Urgent Help - Editing XML through R

2014-11-14 Thread Chidambaram Selvakumar
Hi Team, Can you please help me on the below? 1) Is it possible to achieve the below requirement through or not? Open XMl; find and remove the all the string tag;add new string tag based on the email count; save it in the same XML. 2) If yes can you please share the script As I am new to

Re: [R] Data Import to R

2014-11-14 Thread theo
i think you can set: options(stringsAsFactor=FALSE) which will apply globally or use read.csv(..., stringsAsFactor=FALSE) when imporing. have a look at the documentation ?read.csv good luck. On 11/14/2014 09:44 AM, David Winsemius wrote: > > On Nov 13, 2014, at 4:28 PM, Ramesh Gautam wrote: > >

Re: [R] Help with ddply/summarize

2014-11-14 Thread John Posner
> -Original Message- > From: David L Carlson [mailto:dcarl...@tamu.edu] > Sent: Friday, November 14, 2014 10:25 AM > To: John Posner; 'r-help@r-project.org' > Subject: RE: Help with ddply/summarize > > I think this is what you want: > > > MyVar <- 1:10 > > MyVar > [1] 1 2 3 4 5 6

[R] package multicore: check progress?

2014-11-14 Thread Brian Smith
Hi, I use multicore package quite a lot. However, I want to find a way to check on the progress of my job. For example: ftest <- function(x){ if(x %% 100 == 0) print(x) y <- 2x return(y) } res <- mclapply(1:1000,ftest) This would print the value of x in a for loop, but doesn't produce anythin

Re: [R] replacing columns with same names

2014-11-14 Thread eliza botto
Thankyou very much Berend. It worked!!! Have a great weekend!! :) Eliza > Subject: Re: [R] replacing columns with same names > From: b...@xs4all.nl > Date: Fri, 14 Nov 2014 16:24:03 +0100 > CC: r-help@r-project.org > To: eliza_bo...@hotmail.com > > > On 14-11-2014, at 16:04, eliza botto wrote:

[R] How to put inlined C code on a worker node?

2014-11-14 Thread Mikhail Umorin
Hello — I am using inline C functions within foreach %dopar% loop. On SMP (doParallel, doMP) it works but on MPI-based clusters (doMPI) it does’t. The reason, I think, is because the object code produced using the inline package, essentially an .so file, does not get copied onto the worker node

Re: [R] Help with ddply/summarize

2014-11-14 Thread David L Carlson
I think this is what you want: > MyVar <- 1:10 > MyVar [1] 1 2 3 4 5 6 7 8 9 10 > mean(MyVar) [1] 5.5 > txt <- "MyVar" > mean(txt) [1] NA Warning message: In mean.default(txt) : argument is not numeric or logical: returning NA > mean(get(txt)) [1] 5.5 --

Re: [R] replacing columns with same names

2014-11-14 Thread Berend Hasselman
On 14-11-2014, at 16:04, eliza botto wrote: > Dear useRs, > I have two matrices >> dput(EB) > structure(1:15, .Dim = c(3L, 5L), .Dimnames = list(NULL, c("A", "B", "C", > "D", "E"))) > >> dput(EA) > structure(31:36, .Dim = c(3L, 2L), .Dimnames = list(NULL, c("D", "E"))) > I have two question >

[R] replacing columns with same names

2014-11-14 Thread eliza botto
Dear useRs, I have two matrices > dput(EB) structure(1:15, .Dim = c(3L, 5L), .Dimnames = list(NULL, c("A", "B", "C", "D", "E"))) > dput(EA) structure(31:36, .Dim = c(3L, 2L), .Dimnames = list(NULL, c("D", "E"))) I have two question 1-Generally speaking, How can I replace the columns of matrix wit

Re: [R] Small vector into large data frame

2014-11-14 Thread Adams, Jean
Use the p_f numbers as an "index" of spot$pxlast. Suppose your data frame is called mydata, mydata$newvar <- spot$pxlast[mydata$p_f] Jean On Fri, Nov 14, 2014 at 8:48 AM, Francesca Pancotto < francesca.panco...@unimore.it> wrote: > Dear Contributors > I seem not to get the general rule applyin

[R] Small vector into large data frame

2014-11-14 Thread Francesca Pancotto
Dear Contributors I seem not to get the general rule applying to the use of loops. I need some help. I have a database in which i need to generate a variable according to the following rule. This is the database head bank_name date px_last Q_Y p_made p_for p_m p_f aba.1

Re: [R] file.copy

2014-11-14 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello Duncan, Jeff's tweaks to my code has worked. Now I am trying your way. Below are the R script and console. The issue is that the object (list.of.files) has not been created. Any thoughts? Thanks, ### R script ## #file.copy.dm.way.R #identify th

Re: [R] file.copy

2014-11-14 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Jeff, Thank you so much for your help. Below are the revised code (done with your hints) that has worked and the console. I have just added - overwrite=TRUE) to file.copy(). Pradip ### #file.copy.jn.way.R #identify the folders fromFolder <- "H:/R/cis

Re: [R] file.copy

2014-11-14 Thread Duncan Murdoch
On 14/11/2014 8:21 AM, Jeff Newmiller wrote: Sorry.. typo... file.copy(file.path(fromFolder,list.of.files), toFolder) Or construct the list of files containing full paths. See ?list.files. Duncan Murdoch --- Jeff Newmi

Re: [R] expected arguments for rgl.triangles

2014-11-14 Thread Duncan Murdoch
On 14/11/2014 7:18 AM, Alexander Shenkin wrote: Hello all, I have a set of points in 3D space that represent vertices of a non-convex polyhedron. I would like to plot this polyhedron, and have been trying to do so with rgl.triangles, but to no avail. I imagine I don't understand what rgl.trian

Re: [R] file.copy

2014-11-14 Thread Jeff Newmiller
Sorry.. typo... file.copy(file.path(fromFolder,list.of.files), toFolder) --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] hi

2014-11-14 Thread PIKAL Petr
It seems rather complicated. AFAIK cor gives you correlation matrix, you can check items in this matrix but I do not understand your rules. ¨ Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Cox Lwaka > Sent: Frida

Re: [R] file.copy

2014-11-14 Thread Jeff Newmiller
Your list.of.files variable just has filenames without the fromFolder path. Try file.copy(file.path,fromFolder,list.of.files), toFolder) --- Jeff NewmillerThe . . Go Live... DCN:

[R] expected arguments for rgl.triangles

2014-11-14 Thread Alexander Shenkin
Hello all, I have a set of points in 3D space that represent vertices of a non-convex polyhedron. I would like to plot this polyhedron, and have been trying to do so with rgl.triangles, but to no avail. I imagine I don't understand what rgl.triangles expects for arguments. I have construct

[R] file.copy

2014-11-14 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, Here is something (file.copy) trivial but does not seem to work. I could not figure out what I am doing wrong. The R script below creates folders (fromFolder and toFolder) and finds the list of files (list.of.files) to be copied to the toFolder, which I have verified using the print

Re: [R] "R CMD Rd2txt" generate "_^H" for in all section titles

2014-11-14 Thread Duncan Murdoch
On 13/11/2014, 10:28 PM, Jeff Newmiller wrote: >> Which text editor can actually display _^H correct? > > Not aware of any. It is from very old line printer behavior, which most > (all?) printers can still support even though few computers are set up to > utilize it. The "less" command in Unix-

Re: [R] "R CMD Rd2txt" generate "_^H" for in all section titles

2014-11-14 Thread Duncan Murdoch
On 13/11/2014, 8:16 PM, Rolf Turner wrote: > On 14/11/14 13:59, Duncan Murdoch wrote: >> On 13/11/2014, 2:51 PM, Zheng Da wrote: >>> Hello, >>> >>> I'm trying to generate plain text from the .Rd files. I run "R CMD >>> Rd2txt xx.Rd -o xx.txt" to get the plain text file. When I open the >>> text fil

Re: [R] metafor - code for analysing geometric means

2014-11-14 Thread Viechtbauer Wolfgang (STAT)
With "geometric mean 1 CI /3.92", I assume you mean "(upper bound - lower bound) / 3.92". Two things: 1) That will give you the SE of the mean, not the SD of the observations (which is what you need as input). 2) Probably the CI for the geometric mean was calculated on the log-scale (as Michae

Re: [R] Strange error while passing string as an argument to the function in bnlearn package

2014-11-14 Thread Alexandr M
Hello Marco, > By any chance, are using that for prediction? Yes, I am using it for prediction. > To compute P(A = a | whatever you conditioned on), just sum the > corresponding weights over the total weight mass. Since no language > trickery is involved, this works reliably. Thank you! It's ex

Re: [R] hi

2014-11-14 Thread Cox Lwaka
Thanks,Following your explanation i have through bi conductor but still unable to figure out how to group. for the data, my data takes values 0,1,2  hence simulating from a multinomial distribution such as (rmultinom(10, size = 3, prob = c(0.1,0.2,0.8))) gives 10 variables from three individuals