I've done a bunch of calculations in R, and now need to turn my data.frame into a table of mean +/- SD in MS Word (that's the required format). But, I have no idea how to get a "+/-" symbol; it seems like there ought to be a way to do this that does not involve inserting the symbol manually into each cell of the table in Word.
Here's an example using the mtcars data:
require(reshape2) test_avg <- dcast(mtcars, cyl+gear ~ ., value.var = "mpg", fun.aggregate = mean) test_sd <- dcast(mtcars, cyl+gear ~ ., value.var = "mpg", fun.aggregate = sd) testtable <- cbind(test_avg[ , 1:2], paste(as.matrix(round(test_avg, 1)), as.matrix(round(test_sd, 1)), sep="+/-")) write.csv(testable, file="Table.csv")
One can then open "Table.csv" in Excel, and copy, paste special into Word and get a nice table. This is great, but would be much better if I could put something in the "sep = " argument that would give me a "+/-" symbol in Word. Any ideas?