Introduction
Welcome to our online code documentation page. On this webpage, you’ll find everything you need to know about our R codebase, including updates (news), vignettes, code examples and function documentation. If you have a suggestion, found a bug or have an improvement, please notify us by raising an issue on our github page.
Happy coding!
Gradient Dev Team
Packages
Over the years, we have build a collection of packages, where each package has one dedicated purpose. The biggest rationale behind creating many individual packages, is that often you don’t need the full suite of tools that we have available. E.g. if you just need the theme_g6tr() function for your newest plot creation, you don’t need to load all of the other dependencies that come with our analytical tools. Each package comes with it’s own documentation, which you’ll find in the Packages dropdown, available in our menu at the top right.
The packages are further categorized in three sections:
- Individual Packages: Non-analytical packages with a wide range of purposes
- Analytical Packages: Packages that make our analytical functions available for a given methodology (e.g., conjoint)
- Project Packages: Packages that store the code for our client or internal projects in vignettes.
For more information on each of our packages, please navigate to it’s documentation and consult the articles and references.
Installation
Stable versions
You can install the stable versions of our packages from our internal CRAN, which is hosted on an AWS S3 bucket. If you’re working in our monorepo and workbench, by default, you should get the right credentials in your .Rprofile. If not, please run the snippet below to set your options correctly;
options(repos = c(
CRAN = ifelse(
R.version$os == "linux-gnu",
"https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
"https://cran.rstudio.com"
),
G6TR = "https://g6tr-cran.s3.amazonaws.com",
CLOUDYR = "http://cloudyr.github.io/drat",
STAN = "https://mc-stan.org/r-packages"
))
options(HTTPUserAgent = paste(
paste0(
"R/", getRversion(), ' R (',
getRversion(), " ",
R.version$platform, " ",
R.version$arch, " ",
R.version$os, ")"
),
"127a2ec00989b9f7faf671ed470be7f8"
))You can then install any package with install.packages()
install.packages('g6tr.analytics')Manual installation
You can install g6tr.xx packages through the following steps:
- clone the current version of the g6tr repository
- switch to the
masterbranch - make sure that
remotespackage is installed - Use
install_localfunction from this package to install a package from local source, e.g.remotes::install_local("packages/g6tr")
