Re: [R] withr::set_makevars

2017-09-09 Thread Roy Mendelssohn - NOAA Federal
As a follow-up to this, thanks to Bill Dunlap I was able to resolve what was causing this problem (I still had problems with covr::package_coverage() - but of a different sort and not directly related to this report, I had an existing .R/Makevars file, created in Nov. 2014 related to the inst

Re: [R] list subselect by name ?

2017-09-09 Thread David Winsemius
> On Sep 9, 2017, at 11:45 AM, Andre Mikulec wrote: > > list subselect by name ? > - > > I have this 'list of two elements of named elements.' > >> list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] > > $letters > [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"

[R] list subselect by name ?

2017-09-09 Thread Andre Mikulec
list subselect by name ? - I have this 'list of two elements of named elements.' > list(letters=letters, LETTERS=LETTERS)[c("letters","LETTERS")] $letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" [20] "t" "u" "v" "w" "x" "y" "z" $L

Re: [R] nested loop

2017-09-09 Thread Ek Esawi
I would try fininterval as well. It should do what you have asked provided that you take care of the issue Ulrik pointed out. Best of luck--EK On Fri, Sep 8, 2017 at 6:15 AM, Hemant Sain wrote: > i have a vector containing values ranging from 0 to 24 > i want to create another variable which can

Re: [R] error with subtree()

2017-09-09 Thread Sarah Goslee
You appear to already have something named subtree in your environment: The following object is masked _by_ ‘.GlobalEnv’: subtree You could get rid of it, or you could specify that you want to use subtree from extracat hcs <- extracat::subtree(hc, k = 7) Sarah On Sat, Sep 9, 2017 at 8:58

[R] error with subtree()

2017-09-09 Thread Fix Ace via R-help
Dear R community, I would like to plot a partial hclust output, so I am looking for a subtree function that would return an tree structure I can plot. I ran the test code of subtree following the instruction on  http://finzi.psych.upenn.edu/library/extracat/html/subtree.html However, an error mess

Re: [R] Avoid duplication in dplyr::summarise

2017-09-09 Thread Lars Bishop
Exactly what I was looking for Eric, thanks! I agree on your second point. Best, Lars. On Sat, Sep 9, 2017 at 9:02 AM, Eric Berger wrote: > Hi Lars, > Two comments: > 1. You can achieve what you want with a slight modification of your > definition of s(), using the hint from the error message

Re: [R] Avoid duplication in dplyr::summarise

2017-09-09 Thread Eric Berger
Hi Lars, Two comments: 1. You can achieve what you want with a slight modification of your definition of s(), using the hint from the error message that you need an argument '.': s <- function(.) { dplyr::summarise(., x1m = mean(X1), x2m = mean(X2), x3m = mea

Re: [R] Avoid duplication in dplyr::summarise

2017-09-09 Thread Edjabou Vincent
Hi Lars I am not very sure what you really want. However, I am suggesting the following code that enables (1) to obtain the full summary of your data and (2) retrieve only mean of X values as function of factors f1 and f2. library(tidyverse) library(psych) df <- data.frame(matrix(rnorm(40), 10, 4

[R] Avoid duplication in dplyr::summarise

2017-09-09 Thread Lars Bishop
Dear group, Is there a way I could avoid the sort of duplication illustrated below? i.e., I have the same dplyr::summarise function on different group_by arguments. So I'd like to create a single summarise function that could be applied to both. My attempt below fails. df <- data.frame(matrix(rno