inst/doc/Tips-tricks.R

## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE
  # , comment = "#>"
)

## ----results='asis', message=FALSE--------------------------------------------
library(surveytable)
set_survey(namcs2019sv)
tab_subset("AGER", "SPECCAT", test = "65-74 years")

## ----echo=FALSE---------------------------------------------------------------
version = packageVersion("surveytable")

## ----results='asis', message=FALSE--------------------------------------------
library(surveytable)
set_survey(namcs2019sv)

## ----echo=FALSE---------------------------------------------------------------
set_opts(output = "raw")
print( tab("SPECCAT", test = TRUE), destination = "")
set_opts(reset = TRUE)

## ----results='asis', message=FALSE--------------------------------------------
library(surveytable)
set_survey(namcs2019sv)

## ----results='asis'-----------------------------------------------------------
tab_subset("NUMMED", "AGER")

## ----results='asis'-----------------------------------------------------------
newsurvey = survey_subset(namcs2019sv, NUMMED > 0
  , label = "NAMCS 2019 PUF: NUMMED 1+")
set_survey(newsurvey)

## ----results='asis'-----------------------------------------------------------
tab_subset("NUMMED", "AGER")

Try the surveytable package in your browser

Any scripts or data that you put into this service are public.

surveytable documentation built on Aug. 26, 2025, 1:07 a.m.