Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create Table Summaries and Export Neat Tables to Excel

License

NotificationsYou must be signed in to change notification settings

NHilder/xlr

Repository files navigation

R-CMD-check

xlr

xlr is designed to help build summary tables with complex survey data,and export data toExcel. It includes functions to easily makecross-tabulations, work with multiple response data, and questionblocks. It supports labelled data that can be generated from the popularsurvey platform Qualtrics.

It makes exporting data fromExcel easier. It is a easier to use wrapperaroundopenxlsx. It supports tableswith footnotes, headers, and generating table of contents inExceldocuments. It is not fully featured, but designed to be used when youare moving either statistical summaries or tables from R intoExcel.

This package is designed to work seamlessly withtidyverse family of functions.

It is currently experimental and subject to change based on peoplesfeedback.

Installation

# To install via CRANinstall.packages("xlr")

You can install the development version of xlr fromGitHub with:

# install.packages("pak")pak::pak("NHilder/xlr")

Example

This is a example of how to create a two-way table, fix the formattingfor that table, and then export that table toExcel.

library(xlr)library(dplyr)#>#> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#>#>     filter, lag#> The following objects are masked from 'package:base':#>#>     intersect, setdiff, setequal, union# create a summary tabletwo_way_table<- build_table(mtcars,c(cyl,gear))two_way_table#> # A xlr_table: 8 x 4#>       cyl    gear       N Percent#>   <x_dbl> <x_dbl> <x_int> <x_pct>#> 1    4.00    3.00       1      9%#> 2    4.00    4.00       8     73%#> 3    4.00    5.00       2     18%#> 4    6.00    3.00       2     29%#> 5    6.00    4.00       4     57%#> 6    6.00    5.00       1     14%#> 7    8.00    3.00      12     86%#> 8    8.00    5.00       2     14%# make the percentage have two decimal places using dplyrtwo_way_table<-two_way_table|>   mutate(Percent= xlr_percent(Percent,dp=2))# write the data to an xlsx filewrite_xlsx(two_way_table,"example.xlsx","an example")#> ℹ Appending file: 'example.xlsx'

Check out the vignettes for more information on how to use the package.

About

Create Table Summaries and Export Neat Tables to Excel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp