How to Document a Function in Your R Package

  Рет қаралды 10,606

StatistikinDD

StatistikinDD

Күн бұрын

Пікірлер: 23
@oseifrancis9957
@oseifrancis9957 Жыл бұрын
Thank you very much for this tutorial. Very usefull
@davidfreedman1552
@davidfreedman1552 2 жыл бұрын
Thanks. Very helpful
@farnooshsheikhi
@farnooshsheikhi 10 ай бұрын
Hi this is really helpful, I was able to follow everything but when documenting the functions I got an error on "sew" in package knir . the man file wasn't created. I have 3 functions in one script
@StatistikinDD
@StatistikinDD 10 ай бұрын
Can you post the full error message? At what exact moment does it appear?
@nickportugal95
@nickportugal95 2 жыл бұрын
it's a good tutorial guys!
@LisaMok-w8k
@LisaMok-w8k Жыл бұрын
Thanks this is great! Would you know what the problem is with Error in .get_package_metadata(pkgdir) : Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing
@StatistikinDD
@StatistikinDD Жыл бұрын
Do you have a DESCRIPTION text file at the top level of the package? Did you create the package using RStudio - New Project - Package?
@LisaMok-w8k
@LisaMok-w8k Жыл бұрын
@@StatistikinDD Thanks for your prompt reply! yes i do have a DESCRIPTION text file at the top level and I am creating the package using RStudio - New Project - Package.
@StatistikinDD
@StatistikinDD Жыл бұрын
@@LisaMok-w8k Looks like a known issue. github.com/rstudio/rstudio/issues/12945 github.com/r-lib/devtools/issues/2512 Maybe try updating as much as possible, e. g. RStudio, devtools, pkgbuild
@LisaMok-w8k
@LisaMok-w8k Жыл бұрын
@@StatistikinDD Thank you!
@lahaale5840
@lahaale5840 2 жыл бұрын
it's nice but why do not you build upon the last project and create a project for each tutorial?
@StatistikinDD
@StatistikinDD 2 жыл бұрын
Thanks for your feedback! No deep reason, I just had self-contained videos in mind.
@fmri4301
@fmri4301 2 жыл бұрын
Do you know how to best convert an existing project into a project? Is there some usethis chain that helps?
@StatistikinDD
@StatistikinDD 2 жыл бұрын
You mean from project to package? I'd create a new package in a new folder and import the R scripts. I'd feel safer to keep the original project protected "as-is". When you're happy with the package, you still have enough time to delete the old project, if needed. Some steps will have to be manual, like filling in the documentation. Note that you can create a package from a markdown document. I haven't tried that out yet, but I know it was recommended at thinkr, a place of very able R programmers. rtask.thinkr.fr/fusen-create-a-package-from-a-single-rmarkdown-file/
@huiqiao5251
@huiqiao5251 11 ай бұрын
Thank you so much for loading the videos, they have been super helpful! I tried Build -> More -> Load All and got this error message. The folder did have the processx and processx.rdb files, so I'm not sure what the error means. Could you please advise? Error in gzfile(file, "rb") : cannot open the connection In addition: Warning message: In gzfile(file, "rb") : cannot open compressed file '\\mypackages/processx/R/processx.rdx', probable reason 'No such file or directory' Error: unable to load R code in package ‘processx’meaasge
@StatistikinDD
@StatistikinDD 11 ай бұрын
Hi, I'm on holidays, just a quick idea: maybe an invalid file path? I think I got similar problems when my file path contained spaces.
@shaimasoltane8445
@shaimasoltane8445 2 жыл бұрын
❤❤❤❤❤❤👌👌👌👌👌👌 thank you
@shaimasoltane8445
@shaimasoltane8445 2 жыл бұрын
How can i published my package for all users R. Thanks again.
@StatistikinDD
@StatistikinDD 2 жыл бұрын
The easier way is on github. Installation via remotes::install_github("yourgithubusername/package"). There are similar services such as gitlab or bitbucket. Harder way is on CRAN. Takes patience and time. r-pkgs.org/release.html cran.r-project.org/doc/manuals/r-release/R-exts.html
@olofjosefsson4424
@olofjosefsson4424 3 жыл бұрын
Hi! How do you write the same type of documentation but for the whole package instead?
@StatistikinDD
@StatistikinDD 3 жыл бұрын
Good question! I plan to do a video on that as well. My preferred way would be vignettes. There can be one or several. The dplyr and data.table packages are good examples, see help(package = "dplyr") or help(package = "data.table") and click on the link "User guides, package vignettes and other documentation". Vignettes are R Markdown documents, but with a special Yaml header. To get startet, you can use the usethis package (which is loaded alongside devtools): usethis::use_vignette("Name of vignette"). This sets up the basic infrastructure and a skeleton of the vignette, which you can fill in. (It works only inside an RStudio project of type R Package.) Note that vignettes are not installed by default when you use "Install and Restart" from the Build tab. You can install from github, if you host your package there, and set the build_vignettes parameter to TRUE. Or use Build - More - Build Source Package, then use Packages - Install - from Package Archive - and browse to the source package (file type .tar.gz).
@StatistikinDD
@StatistikinDD 2 жыл бұрын
The video about how to include a vignette in your R package is here: kzbin.info/www/bejne/aX-TnJ-GgrOsgrs
How to Include Data in Your R Package
16:00
StatistikinDD
Рет қаралды 9 М.
Why and How to Include a Vignette in Your R Package
12:30
StatistikinDD
Рет қаралды 6 М.
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 47 МЛН
How to Create Your Own Package in RStudio
15:22
Dr. Bharatendra Rai
Рет қаралды 13 М.
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 68 М.
Mastering {dplyr}: 50+ Data Wrangling Techniques!
17:35
yuzaR Data Science
Рет қаралды 4,8 М.
How to set up Automated Tests for Your R Package using testthat
17:51
Creating Your First R Package in 2 Minutes in RStudio!
8:56
StatistikinDD
Рет қаралды 22 М.
ChatGPT in RStudio with gptstudio - Better than GitHub Copilot?
11:33
R advanced functions that will make your life easier
9:47
Mario Castro
Рет қаралды 17 М.