I have a data frame with numbers resembling:
df$X1 df$X2
.9 1.442
How could I use elements from this data frame to create labels for a confidence intervals that will be nicely formatted string:
(0.90, 1.42)
I’m lost somewhere between paste, as.character and c() and nothing seems to work :/
How about something like:
In your example, it looks like you might want to round your numbers, but the rounding is incorrect. Do you want a certain number of digits after the decimal point?
Also, “1” and “2” are frowned upon as names in a data.frame – see
?make.namesEDIT:
To round in cases like this, I like using
formatC():However, if there are values less than
.005, note that they will end up being0.00.