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

Commit9e82eb8

Browse files
committed
Addwrite_xlsx() function (closes#45)
1 parentdccccd0 commit9e82eb8

File tree

5 files changed

+69
-1
lines changed

5 files changed

+69
-1
lines changed

‎DESCRIPTION‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Imports:
4444
plyr,
4545
testthat,
4646
utils,
47-
progress
47+
progress,
48+
writexl
4849
Suggests:
4950
httptest,
5051
spelling,
@@ -85,5 +86,6 @@ Collate:
8586
'tests.R'
8687
'utils-pipe.R'
8788
'utils.R'
89+
'write_xlsx.R'
8890
VignetteBuilder: knitr
8991
biocViews: ThirdPartyClient, BiomedicalInformatics, GenomeWideAssociation, SNP

‎NAMESPACE‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export(union)
3131
export(variant_to_association)
3232
export(variant_to_study)
3333
export(variant_to_trait)
34+
export(write_xlsx)
3435
exportClasses(associations)
3536
exportClasses(studies)
3637
exportClasses(traits)

‎R/write_xlsx.R‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#' Export a GWAS Catalog object to xlsx
2+
#'
3+
#' This function exports a GWAS Catalog object to Microsoft Excel xlsx file.
4+
#' Each table (slot) is saved in its own sheet.
5+
#'
6+
#' @param x A \linkS4class{studies}, \linkS4class{associations},
7+
#' \linkS4class{variants} or \linkS4class{traits} object.
8+
#' @param file A file name to write to.
9+
#'
10+
#' @return Although this function is run for its side effect of writing an xlsx
11+
#' file, the path to the exported file is returned.
12+
#'
13+
#' @examples
14+
#' # Initial setup
15+
#' .old_wd <- setwd(tempdir())
16+
#'
17+
#' # Save an `associations` object, e.g. `associations_ex01`, to xlsx.
18+
#' write_xlsx(associations_ex01, "associations.xlsx")
19+
#'
20+
#' # Cleanup
21+
#' unlink("associations.xlsx")
22+
#' setwd(.old_wd)
23+
#'
24+
#' @export
25+
write_xlsx<-function(x,file= stop('`file` must be specified')) {
26+
lst<- s4_to_list(x)
27+
writexl::write_xlsx(lst,path=file)
28+
}

‎inst/WORDLIST‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,6 @@ Magno's
129129
ABHD
130130
pkgdown
131131
precompiled
132+
fns
133+
png
134+
xlsx

‎man/write_xlsx.Rd‎

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp