tidyxl: Read Untidy Excel Files

> library(tidyxl)

バージョン: 0.2.1


関数名 概略
tidy_xlsx Import xlsx (Excel) spreadsheet data and formatting into tidy structures.

contents

Arguments

  • path
  • sheets
> examples <- system.file("extdata/examples.xlsx", package = "tidyxl")
> l <- tidy_xlsx(examples, 2)
> l$data
$`1~`!@#$%^&()_-+={}|;"'<,>.£¹÷¦°`
# A tibble: 2 × 20
  address   row   col content formula formula_type formula_ref
    <chr> <int> <int>   <chr>   <chr>        <chr>       <chr>
1      B2     2     2      30    <NA>         <NA>        <NA>
2      B6     6     2      31    <NA>         <NA>        <NA>
# ... with 13 more variables: formula_group <int>, type <chr>,
#   data_type <chr>, error <chr>, logical <lgl>, numeric <dbl>,
#   date <dttm>, character <chr>, comment <chr>, height <dbl>,
#   width <dbl>, style_format <chr>, local_format_id <int>
> str(tidy_xlsx(examples, "Sheet1")$data)
List of 1
 $ Sheet1:Classes 'tbl_df', 'tbl' and 'data.frame':    183 obs. of  20 variables:
  ..$ address        : chr [1:183] "A1" "B1" "A2" "B2" ...
  ..$ row            : int [1:183] 1 1 2 2 3 3 4 4 5 5 ...
  ..$ col            : int [1:183] 1 2 1 2 1 2 1 2 1 2 ...
  ..$ content        : chr [1:183] "#DIV/0!" "57" "1" "55" ...
  ..$ formula        : chr [1:183] "1/0" NA NA NA ...
  ..$ formula_type   : chr [1:183] NA NA NA NA ...
  ..$ formula_ref    : chr [1:183] NA NA NA NA ...
  ..$ formula_group  : int [1:183] NA NA NA NA NA NA NA NA NA NA ...
  ..$ type           : chr [1:183] "e" "s" "b" "s" ...
  ..$ data_type      : chr [1:183] "error" "character" "logical" "character" ...
  ..$ error          : chr [1:183] "#DIV/0!" NA NA NA ...
  ..$ logical        : logi [1:183] NA NA TRUE NA FALSE NA ...
  ..$ numeric        : num [1:183] NA NA NA NA NA ...
  ..$ date           : POSIXct[1:183], format: NA ...
  ..$ character      : chr [1:183] NA "Error" NA "Boolean (true)" ...
  ..$ comment        : chr [1:183] NA NA NA NA ...
  ..$ height         : num [1:183] 14.2 14.2 14.2 14.2 14.2 ...
  ..$ width          : num [1:183] 19.4 68 19.4 68 19.4 ...
  ..$ style_format   : chr [1:183] "Normal" "Normal" "Normal" "Normal" ...
  ..$ local_format_id: int [1:183] 1 1 1 1 1 1 1 1 5 1 ...