Description Usage Arguments Details Examples
To be used as a parameter inside boot::boot
, which 'generates
bootstrap replicates of a statistic', the statistic in this case is the mean
zipf_rtg in the dataframe of ratings returned by zipf_hcp.
1 | mean_rating(data, index)
|
data |
dataframe |
index |
indexes |
The dataframe to be used is inside a list, so either extract the dataframe and give it its own name, or reference it using '$ratings'.
1 2 3 4 5 6 7 | ## Not run:
library(boot)
# assume we have called zipf_hcp and the returned list is called "zipf"
# to use the mean_rating within boot::boot function:
boot(data = zipf$ratings, statistic = mean_rating, R = 1000)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.