inst/doc/remap.R

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

## ----map1---------------------------------------------------------------------
library(rio)
export(list("mtcars" = mtcars, "iris" = iris), "example.xlsx")
import("example.xlsx", which = "mtcars")

## ----map2---------------------------------------------------------------------
import("example.xlsx", sheet = "mtcars")

## ----map3---------------------------------------------------------------------
## n_max is an argument of readxl::read_xlsx
import("example.xlsx", sheet = "iris", n_max = 10)

## ----map4---------------------------------------------------------------------
import("example.xlsx", sheet = "iris", n_max = 10, pizza = "pineapple")

## ----map5, error = TRUE, echo = FALSE-----------------------------------------
R.utils::withOptions({
    import("example.xlsx", sheet = "iris", n_max = 10, pizza = "pineapple")
}, rio.ignoreunusedargs = FALSE)

## ----echo = FALSE, results = 'hide'-------------------------------------------
unlink("example.xlsx")

Try the rio package in your browser

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

rio documentation built on Sept. 19, 2023, 5:06 p.m.