Re: [R] upgrade from 3.1.1 > 3.1.2

2014-11-10 Thread Jeff Newmiller
Mindreading option not enabled. Please make your example reproducible by including all code necessary for us to reproduce your problem starting from an empty R environment. --- Jeff NewmillerThe ..

Re: [R] upgrade from 3.1.1 > 3.1.2

2014-11-10 Thread David Winsemius
On Nov 10, 2014, at 4:10 PM, RICHARD M KARCICH wrote: > in 3.1.1, i had a few small scripts like the one attached -- > installed 3.1.2, then from the R-console, i chg dir and can successfully > source() the mycode.R -- > however, >> getwd()[1] "C:/RProgramming"> dir()[1] "forCondition.R" "ifC

[R] upgrade from 3.1.1 > 3.1.2

2014-11-10 Thread RICHARD M KARCICH
in 3.1.1, i had a few small scripts like the one attached -- installed 3.1.2, then from the R-console, i chg dir and can successfully source() the mycode.R -- however, > getwd()[1] "C:/RProgramming"> dir()[1] "forCondition.R" "ifCondition.R" > "mycode.R""nestedForLoop.R"[5] "whileLoo

Re: [R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-10 Thread Ista Zahn
On Mon, Nov 10, 2014 at 4:15 PM, John McKown wrote: > On Mon, Nov 10, 2014 at 7:12 AM, Aditya Singh wrote: [snip] > Suggestion 2: If you haven't already, I would strongly recommend getting & > installing RStudio. It is free (as in beer, which is a curious phrase > because beer isn't usually fre

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

2014-11-10 Thread Alexandr M
Hi Marco, Thanks for your reply! Logic sampling in cpquery() relies on handling unevaluated > expressions, so it is a tad fragile in any complex setting (inside > loops and function calls, for example). Actually I am doing it inside the loop. Inside the loop I determine important features and f

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

2014-11-10 Thread Marco Scutari
Hi Alexandr, On 10 November 2014 17:46, Alexandr M wrote: > I am working with the package bnlear, but, probably, error is caused not by > the package itself. Logic sampling in cpquery() relies on handling unevaluated expressions, so it is a tad fragile in any complex setting (inside loops and fu

Re: [R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-10 Thread John McKown
On Mon, Nov 10, 2014 at 7:12 AM, Aditya Singh wrote: > Hi, > I have 2 queries: > 1. What function to use to read all the files in a directory to a vector > in R code? > 2. What function to use to coerce character string into numeric? > As a help to others, I figured out to use setwd("C:/") to

[R] Submodel selection using dredge and gam (mgcv)

2014-11-10 Thread Arnaud Mosnier
Hi, I want to use dredge to test several gam submodels including interactions. I tried to find a way in order to keep models with interaction only if the single variables occurring in the interaction are also included. i.e.: for y~s(x0)+s(x1)+ti(x0, x1) I want to keep y ~ s(x0) y ~ s(x1) y ~ s(

[R] Error when install R package in Windows

2014-11-10 Thread Michael Peng
Dear all, I am now writing a R library. After I build it in Windows *R CMD INSTALL --build --compile-both foo.tar.gz*, I get a file foo.zip. foo.tar.gz is the source file tarball. When I tried to install the package in R ( *install.packages("foo.zip")*, or choose the zip file from menu package/ins

Re: [R] Remove from listserv

2014-11-10 Thread Berend Hasselman
On 10-11-2014, at 19:18, Emma Gerald Boyer wrote: > Hello > > Is there any way that I can be removed from the list-serv? Let me know if > I need to do anything. > You can find this in the section Mailing Lists on the R project page. Click on Mailing Lists and then select web interface in the

Re: [R] Remove from listserv

2014-11-10 Thread Ista Zahn
Hi Emma, (Un)Subscription is self-service at the link in the bottom of this (and every) message on R-help, i.e., https://stat.ethz.ch/mailman/listinfo/r-help Best, Ista On Mon, Nov 10, 2014 at 1:18 PM, Emma Gerald Boyer wrote: > Hello > > Is there any way that I can be removed from the list-ser

Re: [R] Remove from listserv

2014-11-10 Thread Uwe Ligges
On 10.11.2014 19:18, Emma Gerald Boyer wrote: Hello Is there any way that I can be removed from the list-serv? Let me know if I need to do anything. Thanks so much [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Bill and mark, I meant the mutate does NOT set the NA value – sorry for the confusion. Thank you for your clarifications that this may not be mutate()’s problem. This thread is now closed from my end. Thanks, Pradip Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rock

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread William Dunlap
> Would you like to bring to Hadley's attention that mutate does > set the NA value for the new column? This may not be mutate()'s problem. The Date class is messed up with regard to NA's and Inf's. E.g., what gets printed as NA does not correspond to what is.na() returns and its range() method

[R] Remove from listserv

2014-11-10 Thread Emma Gerald Boyer
Hello Is there any way that I can be removed from the list-serv? Let me know if I need to do anything. Thanks so much [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

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

2014-11-10 Thread Alexandr M
Hello everybody, I am working with the package bnlear, but, probably, error is caused not by the package itself. There is a function cpquery() to which I pass argument str2: str2="(lag1=='s')" prob.s = cpquery(fitted1, event=eval(parse(text="(M=='s')")),

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Mark, Thank you very much for further looking into this issue. So, the "ugly" solution is better! Would you like to bring to Hadley's attention that mutate does set the NA value for the new column? Regards, Pradip Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rockville

Re: [R] MAd and trim-and-fill plot in R meta-analysis

2014-11-10 Thread huang jialin
Thank you for your response. I apologize for cross posting. I will try the way you suggested. Thanks again. On Mon, Nov 10, 2014 at 11:08 AM, Michael Dewey wrote: > > > On 10/11/2014 14:20, huang jialin wrote: > >> Hi, >> >> I am planning to use BHHR method to conduct a meta-analysis, including

[R] Help on CHAID info

2014-11-10 Thread Marcelo L. Arruda
Dear friends, I am analyzing a big dataset via CHAID and the resulting tree has dozens of terminal nodes. My question is: since I want to use these categories in further analysis, how can I get a summarized listing (preferably in a vector format) about the content of each category. For ex

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread Mark Sharp
Pradip, For some reason mutate is not setting the is.NA value for the new column. Note the output below using your data structures. > ## It looks at first as if the second element of both columns are NA. > data2$mrjdate[2] [1] NA > data2$oiddate[2] [1] NA > ## for convenience > mrj <- data2$mrjd

Re: [R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-10 Thread Jeff Newmiller
1. There is no built-in function to do that, but it can be done if you learn the basics of R [1]. For one thing, there is no assurance that all files in a directory will fit into vectors.. Most data fit better into data frames, and some data like XML need to be stored in lists of lists. So your

Re: [R] MAd and trim-and-fill plot in R meta-analysis

2014-11-10 Thread Michael Dewey
On 10/11/2014 14:20, huang jialin wrote: Hi, I am planning to use BHHR method to conduct a meta-analysis, including calculation of a summary effect size and subgroup analysis. Meanwhile, I need to draw a trim-and-fill plot of all the effect sizes. However, MAd package cannot achieve the goal,

[R] Revolutions blog: October roundup

2014-11-10 Thread David Smith
Revolution Analytics staff and guests write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello Arun, Thank you so much for your help. Regards, Pradip Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Monday, November 10, 2014 11:3

Re: [R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread arun
Try range(data2$oiddate[complete.cases(data2$oiddate) & is.finite(data2$oiddate)]) #[1] "2006-09-01" "2011-11-04" If you look at the `dput` output, it is `Inf` for oiddate dput(data2$oiddate) structure(c(14078, -Inf, 15260, 13796, 13392, 15252, 15282), class = "Date") A.K. On Monday, Nov

[R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-10 Thread Aditya Singh
Hi, I have 2 queries: 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric? As a help to others, I figured out to use setwd("C:/") to set working directory! Aditya [[alternative HTML version

[R] range () does not remove NA's with complete.cases() for dates (dplyr/mutate)

2014-11-10 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, The range() with complete.cases() removes NA's for the date variables that are read from a data frame. However, the issue is that the same function does not remove NA's for the other date variable that is created using the dplyr/mutate(). The console and the reproducible example are gi

Re: [R] Counting within groups / means by groups

2014-11-10 Thread David L Carlson
In addition to Jeff's recommendation, you need to read a basic introduction to R. Your data frame is probably not what you think it is: > group<-c("A", "A", "A", "B", "B", "B", "B", "C") > value<-c(1,3,2,2,2,4,4,1) > df<-as.data.frame(cbind(group, value)) > str(df) 'data.frame': 8 obs. of 2 va

Re: [R] Counting within groups / means by groups

2014-11-10 Thread Jeff Newmiller
Help file ?ave should apply here. Please read the Posting Guide mentioned in the footer of every email on this list and on the list manager page for this mailing list. It warns you to read the archives before posting and to post in plain text format rather than HTML format.

[R] Counting within groups / means by groups

2014-11-10 Thread David Studer
Hi everyone! I have problems finding a solution to the following two problems: My sample-dataframe consists of two variables "group" and "value": group<-c("A", "A", "A", "B", "B", "B", "B", "C") value<-c(1,3,2,2,2,4,4,1) df<-as.data.frame(cbind(group, value)) Problem 1: ** Now I'd like

[R] MAd and trim-and-fill plot in R meta-analysis

2014-11-10 Thread huang jialin
Hi, I am planning to use BHHR method to conduct a meta-analysis, including calculation of a summary effect size and subgroup analysis. Meanwhile, I need to draw a trim-and-fill plot of all the effect sizes. However, MAd package cannot achieve the goal, while meta and metafor do. But it seems meta

Re: [R] Compressing code help in a loop

2014-11-10 Thread Wush Wu
Dear Francesca, Is this what you want? ```r index <- c(406, 107, 207, 307, 407, 108, 208, 308, 408, 109, 209, 309, 409, 110, 210, 310, 410, 111, 211) p_m <- match( p_int$p_made, index) dim(p_m) <- c(dim(p_int)[1],1) ``` Best, Wush PhD Student Graduate Institute of Electrical Engineering, Nationa

Re: [R] which LETTERS?

2014-11-10 Thread Ivan Calandra
Hi Charles, I think you're looking for %in%: which(LETTERS %in% c("A", "B", "C")) See ?"%in%" for details Basically, with "==", the vector c("A","B") or c("A","B","C") will be recycled and compared with LETTERS, which is not what you want. You want to match() LETTERS with the vector. Maybe

Re: [R] which LETTERS?

2014-11-10 Thread Duncan Murdoch
On 10/11/2014 7:50 AM, Charles Stangor wrote: I'm confused: Thanks in advance. > which(LETTERS == c("A")) This computes LETTERS == c("A") then returns the indices where it is TRUE. Since LETTERS has 26 elements, but "A" has only one, the "A" is repeated 26 times. Only the first one matc

[R] which LETTERS?

2014-11-10 Thread Charles Stangor
I'm confused: Thanks in advance. > which(LETTERS == c("A")) [1] 1 > which(LETTERS == c("A","B")) [1] 1 2 > which(LETTERS == c("A","B","C")) [1] 1 2 3 Warning message: In LETTERS == c("A", "B", "C") : longer object length is not a multiple of shorter object length Charles Stangor Professor Dep

[R] Compressing code help in a loop

2014-11-10 Thread Francesca
Dear Contributors I have a problem with a loop. I needed to create a variable that takes values 1,2.. to 19 corresponding to the value of a variable in a data.frame whose name is p_int$p_made and which takes values from 406 to 211. The problem is that this values come ordered in the wrong way

Re: [R] Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)

2014-11-10 Thread Mark Sharp
Pradip, mutate() works on the entire column as a vector so that you find the maximum of the entire data set. I am almost certain there is some nice way to handle this, but the sapply() function is a standard approach. max() does not want a dataframe thus the use of unlist(). Using your defini

Re: [R] Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)

2014-11-10 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Mark, Your code has also given me the results I expected. Thank you so much for your help. Regards, Pradip Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 -Original Message- From: Mark Sharp [mailto:msh..

[R] [R-pkgs] anim.plots - simple animated plots for R

2014-11-10 Thread David Hugh-Jones
Announcing the first release of anim.plots, a package for simple animated plots in R, using Yihui Xie's animation package. http://cran.r-project.org/web/packages/anim.plots/index.html Functions are very similar to basic R graphics. Currently the package includes animated versions of plot, barplot

[R] 答复: the bug of function base::order

2014-11-10 Thread 岳�S
Oh, Thank you! I made a stupid mistake! -邮件原件- 发件人: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] 发送时间: 2014年11月10日 16:03 收件人: 岳�S; r-help@r-project.org 主题: RE: [R] the bug of function base::order No that is not a bug. You are confusing order() with sort(). Please do read the helpf

Re: [R] the bug of function base::order

2014-11-10 Thread ONKELINX, Thierry
No that is not a bug. You are confusing order() with sort(). Please do read the helpfiles. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht