Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Not Being Able to Access 'caret' in 'diamonds' [R, object 'caret' not found] [closed]

$
0
0

I'm learning R for the first time and I am working with boxplots. I want to have some of the box plots filled if they meet a condition. I am using 'diamonds' a general dataset from base R to generate these box plots.

I'm having difficulties accessing the 'caret' element of the dataset 'diamonds' in the following code.

diamonds %>% 
  ggplot(mapping = aes(x = color, y = price)) + 
  geom_boxplot(mapping = aes(fill = caret > median(caret))) +
  facet_grid(clarity ~ cut) +
  theme(legend.position = "top")

The error message I am receiving is the following:

Error in FUN(X[[i]], ...) : object 'caret' not found

If anyone knows more about R and can show me why caret is not found, I would really appriciate it! Thank you!


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>