Displaying 4 results from an estimated 4 matches for "collapse_snp_ids".
2020 May 23
0
paste(character(0), collapse="", recycle0=FALSE) should be ""
...ay, May 22, 2020, 6:16:45 PM EDT, Herv? Pag?s <hpages at fredhutch.org> wrote:
>
> Gabe,
>
> It's the current behavior of paste() that is a major source of bugs:
>
>?? ## Add "rs" prefix to SNP ids and collapse them in a
>?? ## comma-separated string.
>?? collapse_snp_ids <- function(snp_ids)
>?????? paste("rs", snp_ids, sep="", collapse=",")
>
>?? snp_groups <- list(
>???? group1=c(55, 22, 200),
>???? group2=integer(0),
>???? group3=c(99, 550)
>?? )
>
>?? vapply(snp_groups, collapse_snp_ids, character(1...
2020 May 22
5
paste(character(0), collapse="", recycle0=FALSE) should be ""
Gabe,
It's the current behavior of paste() that is a major source of bugs:
## Add "rs" prefix to SNP ids and collapse them in a
## comma-separated string.
collapse_snp_ids <- function(snp_ids)
paste("rs", snp_ids, sep="", collapse=",")
snp_groups <- list(
group1=c(55, 22, 200),
group2=integer(0),
group3=c(99, 550)
)
vapply(snp_groups, collapse_snp_ids, character(1))
# group1...
2020 May 24
0
paste(character(0), collapse="", recycle0=FALSE) should be ""
...,
On Fri, May 22, 2020 at 3:16 PM Herv? Pag?s <hpages at fredhutch.org> wrote:
> Gabe,
>
> It's the current behavior of paste() that is a major source of bugs:
>
> ## Add "rs" prefix to SNP ids and collapse them in a
> ## comma-separated string.
> collapse_snp_ids <- function(snp_ids)
> paste("rs", snp_ids, sep="", collapse=",")
>
> snp_groups <- list(
> group1=c(55, 22, 200),
> group2=integer(0),
> group3=c(99, 550)
> )
>
> vapply(snp_groups, collapse_snp_ids, char...
2020 May 22
2
paste(character(0), collapse="", recycle0=FALSE) should be ""
I agree with Herve, processing collapse happens last so collapse=non-NULL
always leads to a single character string being returned, the same as
paste(collapse=""). See the altPaste function I posted yesterday.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, May 22, 2020 at 9:12 AM Herv? Pag?s <hpages at fredhutch.org> wrote:
> I think that
>
>