![]() ![]() The % character has special meaning in R parsing, since it signifies the beginning of a user defined infix operator. To put parens around the pct-sign: expression(Blah*"(%)") To get a percent sign unsubscripted just: ggplot(dat, aes(x=x,y=y)) + That "joins" or "ligates" a pure numeric literal with a legal R symbol or token. ![]() So you get around that limitation by either quoting or by separating 1 and d by a non-space separator, the * operator. Tokens (or "names" or "symbols") in R are not supposed to start with digits. I think either is a better way than using paste: ggplot(dat, aes(x=x,y=y)) + It would be possible to either break it into valid R tokens and "connect" with non-space operators, backtick it, or use ordinary quotes. The string or token 1d is not a valid R token (or symbol). The reason the last one fails is that the arguments to expression get run through the R parser and an error is returned when they fail the test of whether they could possibly be correct R syntax. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |