## 
## Attaching package: 'DataProduct'
## The following object is masked from 'package:datasets':
## 
##     cars
figcap <- paste("This figure uses DataProduct version", packageVersion("DataProduct"))
tabcap <- paste("This table uses DataProduct version", packageVersion("DataProduct"))

Here you can show uses worked up examples for your package. The easiest way to make a new package is to use usethis::use_vignette("nameofvignette").

Let’s make a plot

library(ggplot2)
ggplot(cars, aes(x=hp, y=mpg, col=cyl)) + geom_point()
This figure uses DataProduct version 1.0

This figure uses DataProduct version 1.0

Let’s make a table

library(knitr)
library(dplyr)
kable(
  iris2 %>% 
    group_by(Species) %>% 
    summarize(
      mean = mean(Sepal.Length), 
      var = var(Sepal.Length),
      min = min(Sepal.Length),
      max = max(Sepal.Length)), caption=tabcap)
This table uses DataProduct version 1.0
Species mean var min max
setosa 5.006 0.1242490 4.3 5.8
versicolor 5.936 0.2664327 4.9 7.0
virginica 6.588 0.4043429 4.9 7.9