Remove quotes from a character vector in R

前端 未结 10 2282
盖世英雄少女心
盖世英雄少女心 2020-11-29 01:06

Suppose you have a character vector:

char <- c(\"one\", \"two\", \"three\")

When you make reference to an index value, you get the follo

10条回答
  •  臣服心动
    2020-11-29 01:37

    nump function :)

    > nump <- function(x) print(formatC(x, format="fg", big.mark=","), quote=FALSE)
    

    correct answer:

    x <- 1234567890123456

    > nump(x)
    
    [1] 1,234,567,890,123,456 
    

提交回复
热议问题