Learn R Programming

What is R Suite?

R Suite was developed by WLOG Solutions company to make their development and deployment process robust. R Suite gives answers to the following challenges for any R based software solution:

  • Isolated and reproducible projects with controlled dependencies and configuration.
  • Separation of business, infrastructural and domain logic.
  • Package based solution development.
  • Management of custom CRAN-alike repositories.
  • Automation of deployment package preparation.
  • Development process integrated with version control system (currently Git and SVN).
  • Working in internet-less environments.

How to use it

To create a project use

RSuite::prj_start(name = "myproject")

This will create an R Suite project folder structure under the myproject folder in your getwd. It will also register its contents under SVN or Git if R Suite detects that getwd is under version control.

Project folder structure is the following:

  • packages - your project R packages will go here
  • R - master scripts (scripts to run your solutions functionalities) will go here. Default master script is created for you: master.R
  • test - your integration tests will go here
  • deployment - project isolated environment will be created in libs sub folder here. Project packages built will go into intrepo sub folder.
  • logs - your solution logs will go here.
  • config_templ.txt - template for your solution configuration. It will be copied onto config.txt (if it does not exist) on the first run of any master script.
  • PARAMETERS - parameters of your project like project name and repositories it is used to collect the isolated project environment.

After creating the project setwd to anywhere inside it

To create a package inside your project simply run:

RSuite::prj_start_package(name = "mypackage")

A package will be created under the packages subfolder of the R Suite project folder (myproject/packages/mypackage). It has a standard structure except for some commonly used functionalities added for your convenience:

  • package_logger.R - initialization of logger for the package
  • package_validation.R - some utilities for arguments validation and assertions.
  • packages_imports.R - global imports which will be used by roxygen2 to add appropriate imports into package NAMESPACE.

As usual you can edit the package DESCRIPTION file in order to add some functionalities to your package.

Now you are ready to build your isolated project environment. First you have to collect dependencies of your project:

RSuite::prj_install_deps()

This will look onto dependencies of your project packages and library (or require) commands in your master scripts to detect all the 3rdparty dependencies of your project. It will also collect version requirements from the DESCRIPTION files of your project packages. After that it will detect packages (and their dependencies) in repositories provided in the PARAMETERS file of R Suite project (which satisfy version requirements) and install them into the deployment/libs subfolder. If everything goes well you are ready to build your project packages:

RSuite::prj_build()

It will build all packages in your R Suite project and install them into deployment/libs. If it succeeds your isolated project environment is ready.

Now work on your master scripts. We are convinced that the business logic of your solution should be enclosed in packages provided by the solution. Master scripts are required for "glue logic" like reading configuration parameters, setup connections and realize data flow between levels of solution functionality stack.

After all you can prepare your solution for deployment:

RSuite::prj_zip()

This will create zip bundle containing you isolated project environment together with your master scripts and configuration template. Just extract it on your production and run your master scripts (no package installation will be required in the production environment).

For more information check R Suite's official webpage!

How to install it

Just run

install.packages('RSuite')

Copy Link

Version

Install

install.packages('RSuite')

Monthly Downloads

32

Version

0.37-253

License

MIT + file LICENSE

Maintainer

Walerian Sokolowski

Last Published

June 10th, 2019

Functions in RSuite (0.37-253)

build_bash_script

Creates a bash script to update the system to satisfy project requirements.
prj_start

Creates project structure at the specified path.
rc_adapter_create_base

Creates the base presentation for the RC adapter to use by concrete implementations.
rc_adapter_get_version

Retrieves current RC version number for working copy at directory passed.
rsuite_get_os_info

Retrieves information on current OS.
prj_pack

Prepares project source pack tagged with version.
rsuite_get_ci_adapter_names

Gets all names of known CI (continuous integration) adapters.
rsuite_unregister_rc_adapter

Unregisters RC (revision control) adapter.
pkgzip_build_ext_packages

Builds PKGZIP out of passed external packages.
pkgzip_build_package_files

Builds PKGZIP out of passed package files.
pkgzip_build_prj_packages

Builds PKGZIP out of project packages.
prj_start_package

Creates package structure inside the project.
prj_unload

Unloads last loaded project.
prj_clean_deps

Uninstalls unused packages from the local project environment.
prj_lock_env

Locks the project environment.
prj_build

Builds project internal packages and installs them.
prj_load

Loads project into the environment so all master scripts can run.
pkg_inst_order

Detects order of installation of packages as a permutation of the input vector
pkgzip_build_bioc_package

Builds PKGZIP out of a package on Bioconductor
rc_adapter_is_under_control

Detects if dir is under adapter's managed version control.
pkgzip_build_github_package

Builds PKGZIP out of a package on GitHub.
repo_manager_destroy

Releases resources allocated to manage the repository.
repo_manager_get_info

Returns information on repo manager.
repo_upload_prj_packages

Builds and uploads project package(s) into the repository.
repo_upload_pkgzip

Uploads PKGZIP into the managed repository.
repo_adapter_create_base

Creates base presentation for repo adapter to use by concrete implementations.
rc_adapter_pkg_struct_add

Puts the package structure under RC adapter's managed version control.
rsuite_unregister_repo_adapter

Unegisters repository adapter.
prj_config_set_rversion

Updates project configuration to use specified R Version.
prj_zip

Prepares deployment zip tagged with version.
prj_unlock_env

Unlocks the project environment.
prj_config_set_repo_adapters

Updates project configuration to use only specified repository adapters.
rc_adapter_prj_struct_add

Puts project structure under RC adapter's managed version control.
repo_manager_upload

Adds packages to the managed repository.
rc_adapter_remove_admins

Remove all RC related administrative entries from folder tree at dir.
sysreqs_collect

Prints out all system requirements from dependencies and project packages.
sysreqs_install

Updates system to satisfy detected requirements.
rsuite_register_repo_adapter

Registers repository adapter to use for projects.
repo_upload_github_package

Loads package from the GitHub repository.
repo_mng_init

Initializes repository (creates its structure).
rsuite_unregister_ci_adapter

Unregisters CI (continuous integration) adapter.
repo_upload_package_files

Uploads package file(s) into the managed repository.
rsuite_register_ci_adapter

Registers CI (continuous integration) adapter to use for projects.
repo_manager_init

Initializes managed repository structure.
repo_manager_remove

Removes specified packages from the repository.
repo_upload_ext_packages

Uploads external packages into the managed repository.
repo_upload_bioc_package

Loads package from the Bioconductor repository.
prj_init

Loads project settings without loading them into the environment.
repo_adapter_get_info

Returns information about repository the adapter is working on.
prj_install_deps

Installs project dependencies and needed supportive packages.
rsuite_update

Updates RSuite to newest available version.
sysreqs_check

Checks for system requirements availability.
repo_adapter_create_manager

Creates repo manager to manage its repository.
rsuite_register_rc_adapter

Registers RC (revision control) adapter to use for projects.
tmpl_list_registered

Returns all available project/package templates
sysreqs_script

Creates a script to update the system to satisfy project requirements.
tmpl_start

Creates a new template with the specified name, in the specified path.
tmpl_register

Registers the template specified with the path argument.
repo_mng_start

Starts management over the repository.
repo_mng_stop

Stops management over the repository.
rsuite_get_rc_adapter_names

Gets all names of known RC (revision control) adapters.
rsuite_get_repo_adapter_names

Gets all names of known repository adapters.
repo_adapter_get_path

Returns the adapter path related to the project to use for dependencies resolution.
repo_mng_list

Retrieve the list of available packages in the repository.
repo_mng_remove

Removes packages from the repository.
rsuite_check_version

Checks if a newer version of RSuite is available.
rsuite_getLogger

Retrieves RSuite logger.
perform

Performs(runs) all recipes from the sysreqs_recipe object.
clean_prj_deps

Cleans installed packages that are not required from the local project environment.
get_version_numbers

Retrieves version numbers from the input version string e.g. 1.2.0 returns c(1, 2, 0)
ci_adapter_create_base

Creates the base presentation for the CI adapter to use by concrete implementations.
ci_adapter_is_building

Detects if build process triggered by CI is currently running.
ci_adapter_get_version

Retrieves current CI build number.
inst_wrap_zip

Wraps deployment zip into bash installer script.
build_win_script

Creates a cmd script to update the system to satisfy project requirements.
RSuite

Supports Developing, Building and Deploying R Solutions.