r - Error in as.character(split) : cannot coerce type 'closure' to vector of type 'character' -


i totally newbie r programming , here stuck.

i trying extract characters in first column of table "|" in each row following code;

library(limma)  temp<- read.delim("c:/users/doe/desktop/work/colon_expression/results.txt", sep ="\t", header = t) temp  temp<-limma::strsplit2(temp,split,"|")[,1] temp 

rstudio gives error;

error in as.character(split) : cannot coerce type 'closure' vector of type 'character'

how can fix coercion problem code ?

try:

limma::strsplit2(temp, "|")[,1] 

you can strsplit2 documentation ?strsplit2

which gives function strsplit2 requires 2 arguments:

  • xcharacter vector. here provided temp.
  • split character split. here wrote split.

so need provide character split (ie., replace split "|").


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -