Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ME:
- x <- "x + b + (c2 -(d3 + wo22^0.2/3/123))"
- strsplit(gsub("\\(|\\)|\\s|[^a-zA-Z0-9](?:[+-\\*\\^\\/]{1})+[0-9.]","",x),"[^0-9a-zA-Z]")
- #[[1]]
- #[1] "x" "b" "c2" "d3" "wo22"
- # https://www.ptt.cc/bbs/R_Language/M.1544673627.A.D09.html from celestialgod
- all.vars(as.formula(paste0(x, "~1")))
- #[1] "x" "b" "c2" "d3" "wo22"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement