search for: copysubstitute

Displaying 3 results from an estimated 3 matches for "copysubstitute".

2013 Dec 17
3
In-string variable/symbol substitution: What formats/syntax is out there?
...should also be *in-string* substitution out of the box, so sub(), sprintf() and friends does not count. Thanks Henrik PS. The following is on the borderline because it does not do automatic variable look up, but since others may bring it up and/or know of a neater approach, I mention it too: ** copySubstitute() in the 'Biobase' package (with some efforts), e.g. > bbsubst <- function(fmt, ...) { args <- lapply(list(...), FUN=as.character) in <- textConnection(fmt) out <- textConnection("res", open="w") on.exit({ close(in); close(out) }) copySubstitute(...
2010 Jul 19
3
"ACCTGMX" to "1223400" in R?
...ke M and X). I use the Bioconductor package in R. Currently I need to convert a string of the form "ACCTGMX" to "1223400" i.e. A is replaced by 1, C with 2, T with 3, G with 4 and any other character with a 0. I checked with 'replace' and also with a function called 'copySubstitute' found in the Biobase package but this is only for files. The data here is a string ("ACCTGMX" ) and we need to convert it to yet another string ("1223400"). Now I use the strsplit function to split "ACCTGM" into "A" "C" "C" "T&q...
2005 May 07
4
string syntactic sugar in R? - long post
Currently in R, constructing a string containing values of variables is done using 'paste' and can be an error-prone and traumatic experience. For example, when constructing a db query we have to write, paste("SELECT " value " FROM table where date ='",cdate,"'") we are getting null result from it, because without (forgotten...)