usethis | Set up commonly used 📦 components | BPM library
kandi X-RAY | usethis Summary
kandi X-RAY | usethis Summary
usethis is a workflow package: it automates repetitive tasks that arise during project setup and development, both for R packages and non-package projects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of usethis
usethis Key Features
usethis Examples and Code Snippets
Community Discussions
Trending Discussions on usethis
QUESTION
I'm trying to install R
packages using pak
R
package as follows:
ANSWER
Answered 2022-Feb-24 at 16:59I resolved it removing pak and reinstalling it with
install.packages("pak", type = "source")
QUESTION
Since a few months, ggplot2 started to save png files with a transparent background. The code output in Rstudio and when saved as pdf looks great. It happens mainly with the use of themes when I omit the gray panel background. I tested it on my macbook with "Preview" and on a Windows Computer with the "foto viewer" there.
...ANSWER
Answered 2021-Nov-11 at 14:11Maybe indeed worth an answer for posterity...
Specify ggsave("test.png", dpi = 300, bg = "white")
Background (pun intended): the argument will be passed to grDevices::png
via the ...
argument. bg
controls the background of the device.
QUESTION
I used the pkgdown package to create a new website of my package that will be hosted on Github.
I ran the following codes:
ANSWER
Answered 2021-Nov-04 at 01:48For reasons I don't totally understand, by default use_pkgdown()
adds the docs/ folder to the .gitignore file. That's why it's not showing up in your commit panel. Open up the .gitignore file and delete the reference to docs (should be at the bottom), the docs folder should now appear in your .gitignore and you can commit and push it to your repo.
Perhaps someone from pkgdown
can explain why the docs folder is ignored when the instructions say to use it as the GitHub pages source?
QUESTION
salesforce/handlebars is a PHP parser and renderer for Javascript Handlebars templating. The latter provides two kind of helpers, roughly:
...ANSWER
Answered 2021-Nov-01 at 23:51Looks like there are not.
On the other hand, the syntax for a {{nonblock helper}}
is very similar to that for a {{variable}}
.
So in Handlebars/Template.php
, in
QUESTION
I recently got a new laptop with Windows 11 (despite my sessionInfo()
stating Windows 10) and I'm trying to build a pkgdown
site for an R package that I'm developing. This is not an issue that I have encountered in the past. Running the command pkgdown::build_site()
does not correctly link my custom logo to the HTML sites for this R package.
Custom logo png below, for posterity: brConnectR logo
The man/figures/logo.png
file was generated with usethis::use_logo("path/to/logo.png")
and the favicons were generated as part of the pkgdown::build_site()
process, however, the resulting docs/index.html
fails to capture any logo. Below is my sessionInfo()
:
ANSWER
Answered 2021-Oct-29 at 22:06I resolved this issue following the Package Logo section of the pkgdown::build_home()
reference page:
If you have a package logo, you can include it at the top of your README in a level-one heading:
# pkgdown
init_site() will also automatically create a favicon set from your package logo.
In addition to the above, I installed the development version of pkgdown
and this fixed a cryptic warning that I was getting when running pkgdown::build_site()
("WARNING Deprecated: markdown_github. Use gfm").
To install the dev version from GitHub: devtools::install_github("r-lib/pkgdown")
QUESTION
I currently have a data_prep.R file that I use to pull in data using SQL queries and then wrangle the data into suitable data frames for use within my {golem} package. At the end of this script I have
usethis::usedata(df, overwrite = T)
From research it seems that this file should go into the /data-raw folder as you are not supposed to execute code in the /R folder. When ran, it constructs my data frames and then places them within the /data folder. However, this script does not seem to get ran whenever I run the application, moreover, the data frames will remain unchanged until I manually run the data_prep.R script again.
My application relies on the new data coming in and as such I would need this data_prep.R file to run whenever the app is launched.
Is there something that I am missing?
...ANSWER
Answered 2021-Oct-13 at 15:12The call of usethis::usedata(df, overwrite = T)
create you a dataset you can load when your package is in use.
You should load explicitly the dataset in your app using data(df)
in the piece of code where the data is needed.
QUESTION
I am trying to get documentation to show up for an actual package (not its functions, since that's done automatically when documentating the package) through the help()
or ?
functions.
For example, using the following:
...ANSWER
Answered 2021-Oct-10 at 22:33Since you're using usethis
, you can do usethis::use_package_doc()
. See docs here.
You could also read Hadley's book on R packages which explains what this is doing.
QUESTION
I have been trying to start using github actions for continuous integrations in my packages, however,even though I am using the premade functions of usethis package it is not working, and the runners stop immediately.
I have tried with the following functions:
...ANSWER
Answered 2021-Sep-15 at 12:02Notice this part in error message:
QUESTION
While developping an R package, I'm trying to use the function usethis::use_import_from()
to import in the package a single function from another package but the function is not available whatever way I'm trying : loading usethis
or devtools
or explicitly writing the name with ::
. It is not available in the help either. However, it is well documented here and I can see it in the source code here:
ANSWER
Answered 2021-Sep-13 at 11:36The usethis::use_import_from()
function is not in the released version 2.0.1 of usethis, it's in the development version on Github. Usually the online help page would indicate that, but in this case they've forgotten to flag it, so the page shows version 2.0.1.9000 (where the 9000 signals a development version in the scheme they use), but calls it a "Released version".
If you want to use it anyway, you can install directly from Github instead of from CRAN using
QUESTION
Hi I'm just about finished up using GitHub actions to add CI / CD steps to deploy an R Shiny app I have. The problem I'm having is there is a file in R called .Renviron
that I use to store credentials to access a SQL DB of mine in the R script. Normally I deploy my app locally and this file is included when I use the rsconnect package, but now that I'm using GitHub actions I believe I have to make this .Renviron file manually myself in a bash script step.
Below is what my github workflow code looks like as of right now. The problem I'm having issues with is the Create and populate .Renviron file
part.
ANSWER
Answered 2021-Aug-30 at 08:08You are correct, you can't use ${{ secrets.my_secret }}
in the bash scripts.
That won’t work, because “${{ }}” and the “secrets” variable are GitHub Actions constructs that Bash doesn’t understand. You’ll have to pass the secret to your step as an environment variable:
However, you may also use env mapping like you have in your last step. It would be like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install usethis
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page