inst/doc/sjukhus.R

## -----------------------------------------------------------------------------
library(decoder)

## ---- echo = FALSE, message=FALSE---------------------------------------------
library(decoder)
suppressPackageStartupMessages(library(dplyr))

sjukhus_all <-
  suppressWarnings(
    bind_rows(
      rockan = as_tibble(sjukhus),
      inca   = as_tibble(sjukhus_inca),
      par    = as_tibble(sjukhus_par),
      .id    = "source"
    )
  )

key_n_sources <- 
  sjukhus_all %>% 
  count(key, sort = TRUE)

## ---- echo = FALSE, message = FALSE-------------------------------------------

key_n_sources <- 
  sjukhus_all %>% 
  count(key, sort = TRUE)
in3 <- key_n_sources %>% filter(n == 3)

sjukhus_all %>% 
  inner_join(in3, "key") %>% 
  arrange(key) %>% 
  tidyr::spread(source, value) %>% 
  select(-n) %>% 
  knitr::kable()

Try the decoder package in your browser

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

decoder documentation built on April 22, 2020, 5:07 p.m.