1
Dimnames not displaying names of lists
Post Body
Hi there-
I'm fairly new to R and am following a tutorial from my uni. The test code they gave us is as follows:
visits <- data.frame(bee= c(25,55,25,68),butterfly= c(5,43,24,20))
dimnames(visits) <- list(plant=c("jewelweed","ironweed","JoePyeWeed", "BlackEyedSusan"), visitor=c("bee","butterfly"))
When visits is called again, it is supposed to print out something like this
However, instead, R is printing out the chart except without the visitor and plant labels. Is there any way to fix this or is this just a difference between versions of R? Just making sure I'm not doing anything wrong
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/RStudio/com...