Displaying 4 results from an estimated 4 matches for "charlist".
2008 Jun 05
1
Space character introduced bu paste
Dear R-Users,
I am trying to use paste to paste the character ' around a character
vector.
Paste appears to place spaces (" ") around this. Anyway this can be done
without the unintended introduction of space characters ?
Please see example below.
Many thanks,
Tolga
> charlist<-c("a","b","c")
> lapply(charlist, function (y) paste("'",y,"'"))
[[1]]
[1] "' a '"
[[2]]
[1] "' b '"
[[3]]
[1] "' c '"
There is a space character around "a", "b&...
2017 Jun 27
0
paste strings in C
...an example below using the S4Vectors
package.
foo2 <- function(mymat, colnms, tilde=FALSE) {
chars <- colnms[col(mymat)]
lowerChars <- if (tilde) paste0("~", chars) else tolower(chars)
chars <- ifelse(mymat==1L, lowerChars, chars)
keep <- mymat > 0L
charList <- split(chars[keep], row(chars)[keep])
S4Vectors::unstrsplit(charList, "*")
}
Or perhaps more efficient using the compressed lists of IRanges:
foo3 <- function(mymat, colnms, tilde=FALSE) {
mymat <- t(mymat)
chars <- colnms[row(mymat)]
lowerChars <- if (t...
2002 Dec 27
1
Wine Problems
When i run make, in the wine directory, i have the followin errors:
gcc -c -I. -I. -I../../include -I../../include -g -O2 -Wall
-mpreferred-stack-boundary=2 -fPIC -D__WINE__ -D_REENTRANT -o
riched32.dll.dbg.o riched32.dll.dbg.c
ld -r charlist.o reader.o text-writer.o richedit.o riched32.dll.dbg.o -o
riched32.dll.tmp.o
strip --strip-unneeded riched32.dll.tmp.o
LD_LIBRARY_PATH="../../library:../../unicode:$LD_LIBRARY_PATH"
../../tools/winebuild/winebuild -fPIC -D__WINE__ -o riched32.spec.c --spec
./riched32.spec riched32.dll....
2017 Jun 27
2
paste strings in C
Dear R-devs,
Below is a small example of what I am trying to achieve, that is trivial in
R and I would like to learn how to do in C, for very large matrices:
> (mymat <- matrix(c(1,0,0,2,2,1), nrow = 2))
[,1] [,2] [,3]
[1,] 1 0 2
[2,] 0 2 1
And I would like to produce:
[1] "a*C" "B*c"
Which can be trivially done in R via something like:
foo