The R Strata function was not found (Ubuntu)

2

Good afternoon, I am studying R in Ubuntu (16.04 LTS). When trying to use the strata function through the command below:

amostra = strata(infert, c("education"), size = c(5, 48, 47), method = "srswor")

The error below occurs:

Error in strata (infert, c ("education"), size = c (5, 48, 47), method="srswor"):   could not find strata function

R version in Ubuntu R version 3.4.2 (2017-09-28) - "Short Summer"

    
asked by anonymous 19.11.2017 / 17:32

1 answer

5

Some functions we use in R are not associated with base package . So we should install the package that developed the function we want using install.packages("nome do package") and then call the package using library(nome do package) .

If you do not know the name of the package, you can use the findFn() function of package sos .

install.packages("sos") # se ainda não instalou o package
library(sos)

findFn("strata", maxPages = 1)

EDITED :

According to Rui Barradas, the package is probably sampling .

    
19.11.2017 / 17:52