FAQ

General

Which R Version should I use for a project?

We recommend always use the latest patch version of the second last minor version. For example, if the latest R version is 4.2.1, the latest patch version of the second last minor version would be 4.1.3. We also like to call this version the “current LTS” (longterm support) version. The reasoning behind this suggestion is that one does not have to upgrade to the next patch release of a minor version immediately after its release (as the “LTS” is always the last patch version of its respective minor release branch). The project can be started (and continued) with one specific R minor version.

Which method is the best one to install R packages?

The three most popular ways to install R packages are:

We recommend to use renv::install() by default. renv::install() works inside and outside (with renv >= 0.16.0) {renv} projects. The function can make use of the global shared {renv} cache of the workbench installation and hence reduce redundant package downloads. If the specific package version has already been installed for a particular R version, the package is copied from the global cache into the user library.

Alternatively, pak::pkg_install() is a fast way to install packages. Due to its concurrent package download, the pak approach shines most when it can use multiple cores.

install.packages() out of base R is the slowest of the three alternative. The traditional way of installing packages does not support concurrent downloads and does not make use of existing packages.

Note that the Workbench graphical user interface (GUI) always uses install.packages().

What purpose does the rsw-deps repo in getOption("repos") have?

When opening the dialog to create a new .Rmd file in the Workbench GUI, Workbench needs at least {rmarkdown} 2.10 (released 2021-08-06). The usage of fixed Package Manager snapshots relative to the respective R version does not fulfill this requirement for R versions < 4.1.1. Therefore all R versions older than 4.1.1 have the rsw-deps repo attached so that Workbench is able to find the required package versions. Hereby it is important to know that Workbench only searches in a repo option named "CRAN", which is why the additional repo is named like this.

Here is an example for R 4.1.0:

> getOption("repos")
                                                                RSPM
"https://packagemanager.posit.co/cran/__linux__/focal/2021-05-18"
                                                              cynkra
             "https://rspm.cynkra.com/cynkra/__linux__/focal/latest"
                                                                CRAN
           "https://rspm.cynkra.com/rsw-deps/__linux__/focal/latest"

How can I override the repositories used by install.packages()?

Redfine the getOption("repos") option in either ~/Rprofile.site (user level) or .Rprofile in your project root directory:

options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/__linux__/focal/latest')

It is important to use the correct identifier for the underlying operating system, here e.g., “focal” which represents Ubuntu 20.04.

How can I add a new team member to Connect or Workbench?

Both Connect and Workbench are connected to Active Directory or the Single-Sign-On method your organization uses. This means if an internal account exists for the new team member, the user can just login with the respective credentials. Depending on the configuration within your organization, the user might need to be a member of a specific group to be able to access the Posit applications. Your local IT should know if there is a group in place.

After the initial configuration of the products, cynkra cannot help to onboard users. If issues occur during login of a new team member, your local IT should be contacted first.

Git Providers (GitHub, GitLab, Bitbucket, Gitea)

Which git protocol (SSH, HTTPS) should we use?

While SSH is preferred in general due to its security and convenience, HTTPS is often the only option in corporate environments. SSH is often blocked by firewalls and proxies. When using HTTPS, ensure to configure a git credential cache to avoid entering your password every time you push or pull.

Should we use git via the built-in UI in Workbench or via the command-line?

This is totally up to your personal preference. Both ways do the same behind the scenes. The built-in method abstracts the git commands and provides a more user-friendly interface which might be more suited for beginners.

Kubernetes

Workbench: When inspecting the node resources, it seems that I have more resources available than initially assigned?

Every pod gets placed on a node with specific resources (e.g. 2 CPU, 16 GB) which can fulfill the respective session requests (e.g. 1 CPU, 8 GB). One node can potentially accomondate multiple sessions. Running htop or other process viewers, one always sees the full node resources and not the limited resources of the specific sessions. These are defined in the cgroups values of the pod and can be queried via cat /sys/fs/cgroup/memory/memory.limit_in_bytes (memory in bytes) and cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us (CPU; 100000 = 1 CPU) from the terminal.

Workbench: Why do I have to wait ‘longer than usual’ before my session starts (auto join)?

Our configuration of the cluster make sure that there is always room for (at least) 1-2 default Workbench sessions. If one requests a higher amount of resources than currently available for a session within the cluster, the cluster needs to provision a new node to provide the respective resources. Provisioning a new node and starting a session takes around 1.5 - 2 minutes.

Connect: Can I control app resource requests at the user level?

Currently the required resources of an app running on a Connect Kubernetes instance can not be configured. This feature will be added in an upcoming Connect release.

renv

How does the shared {renv} cache work?

See section “Shared {renv} cache configuration”.

Should I use {renv} for all of my projects?

We at cynkra recommend using {renv} for every project, a collaborative one or not.

Using {renv} is a choice. It allows to control the package environment (and R version) used in a project. This improves reproducibility and simplifies collaboration with others as collaborators can restore and work on on package set without introducing conflicts.

Using the global shared {renv} cache in Workbench installations by cynkra simplifies usage even more as package installation is almost instance (if the cache has already been filled). Nevertheless, {renv} is not required for projects, it will always be optional.

How can I install project’s or package’s dependencies outside of an renv project to make use of the global cache?

You can use renv::hydrate() - it works in the same way as remotes::install_dev_deps() or pak::local_install_dev_deps().

UI

How can I automatically switch between light and dark themes in the workbench?

The Workbench does not provide such an option natively. However, the {rsthemes} packages can be used to achieve this. A manual tweak in ~/.Rprofile is required to make this work via rsthemes::use_theme_auto().

The following code makes use of {later} (for a scheduled, reoccuring execution) and {ipapi} and {suncalc} (behind the scences) to automatically check every minute whether the selected light or dark theme should be applied (source: ?rsthemes::use_theme_auto()).

if (
  interactive() &&
  requireNamespace("rsthemes", quietly = TRUE) &&
  requireNamespace("later", quietly = TRUE) &&
  requireNamespace("ipapi", quietly = TRUE) # hrbrmstr/ipapi
) {
  later::later(function() {
    rsthemes::set_theme_light("Textmate (default)")  # light theme
    rsthemes::set_theme_dark("Dracula") # dark theme

    # uses IP geolocation (via {hrbmstr/ipapi}) and lat/lon (via {suncalc}) information
    rsthemes::use_theme_auto()

  }, delay = 60)
}

To manually check the current sunset/sunrise times, one can use

suncalc::getSunlightTimes(as.Date(format(Sys.time(), "%Y-%m-%d")), lat = 47, lon = 8)
        date lat lon           solarNoon               nadir             sunrise
1 2024-11-05  47   8 2024-11-05 11:12:53 2024-11-04 23:12:53 2024-11-05 06:18:08
               sunset          sunriseEnd         sunsetStart                dawn
1 2024-11-05 16:07:39 2024-11-05 06:21:32 2024-11-05 16:04:15 2024-11-05 05:45:57
                 dusk        nauticalDawn        nauticalDusk            nightEnd
1 2024-11-05 16:39:50 2024-11-05 05:09:44 2024-11-05 17:16:03 2024-11-05 04:34:14
                night       goldenHourEnd          goldenHour
1 2024-11-05 17:51:32 2024-11-05 07:03:01 2024-11-05 15:22:45

Can I use Workbench as a standalone desktop app?

Yes, there are multiple ways how this can be achieved. The official way is to use the licensed version of the RStudio Desktop Pro.

Yet there are also free alternatives. Chromium-based browsers like Brave allow to convert a website into a standalone Electron-based desktop app via an icon in the URL bar.

The nativefier project provides a generalized solution for the mentioned Electron-based appraoch. It is open-source and free of cost.

Last, there are operating specific so-called SBB (site-specific browser) apps which aim to provide a professional solution for squashing websites into standalone apps. Unite and/or Coherence X for macOS is one of these solutions and requires a one-time payment.

Databases

There are multiple drivers for Microsoft SQL Server. Which one should I use?

Depending on your specific image configuration, multiple SQL Server drivers are available. You can check for them in /etc/odbcinst.ini or in R via odbc::odbcListDrivers():

Name Location Source
SQLServer /opt/rstudio-drivers/sqlserver/bin/lib/libsqlserverodbc_sb64.so RStudio Professional Drivers
SQL Server Driver /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so FreeTDS
ODBC Driver 17 for SQL Server /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.1.1 Microsoft ODBC

Only the SQLServer driver is capable of using UID and PWD from a DSN definition in odbc.ini. For the other drivers, UID and PWD need to be specified in the connection string.

Package Manager

How can we add a new R package to be served by the Package Manager?

The process requires manual CLI commands within the Package Manager container. Hence it must be done by cynkra as normal users do not have access to the Package Manager container. Please drop us a message with the package name and the git repository URL.

Posit Licenses

We hit the user limit on our Workbench installation. What next?

The user limit note on Workbench is not a hard lock, i.e. everyone can continue to work and you can even add more users. However, the overprovisoning of users should be addressed by

  • adding more license seats
  • deactivating inactive users (must be done by cynkra as admin priviliges are required)

During the license year, the license seats can only be increased in batches of 5. During the yearly license renewal, increases by 1 are possible. If you want to increase the license seats, please contact us.

When adding new license seats, the billing period does not change.

A message appeared that the license is about to expire. What should I do and it is urgent?

We are tracking the expiration date of the license and will start an internal renewal process with Posit and your organization about 2 months before the expiration date. The message starts appearing two weeks before the expiration date. You can ignore the message and trust us, that we are aware of the situation and will take care of it.

Even if the date passes, the Posit applications will continue to work as usual and there will be no hard interruption of the service.

Update Process

How often do you update the Posit applications?

Our update interval is ~ every 3 months or once per quarter.

How do you test the new versions of the Posit applications?

We built new (internal) images and deploy these in our own environment. Based on the changelog provided by Posit we test new features and changes. However, since we are not the developers of the applications, we cannot guarantee that every detail will work the same way as before. In every environment, users work with different settings and restrictions which we cannot always mirror in our own setup. Rest assured that we’re trying our best though and aim for a smooth update experience for everyone!

Can we test a new version of application x before you update it?

This is only possible if you have more than one license for the product. If not, we cannot (and are not allowed) to deploy a second instance running a different version of the application.

How often do you update the R versions?

We include new R versions as they come out. These are released ~ every 3-4 months. Depenending when your next update is scheduled, you will be able to use it shortly after the release date or up to a few months later.

What happens if a major update for the container OS is scheduled?

The only user-facing effect is that all R packages needs to be re-installed. This is because the R package binaries and related system libraries are built for a specific OS version. If the OS version changes, the old binaries are not compatible anymore. In this case, we will inform you and your team about this required action. Long story short: deleting the R/ directory and installing packages is all that needs to be done.

Support & Troubleshooting

What is the process if we encounter an issue?

While we are working on an internal ticketing system, the current process is to send an email to one of these email addresses:

  • posit@cynkra.com
  • infra@cynkra.com

Or alternatively, send a mail to your dedicated contact person at cynkra. However, we strive to centralize support requests and would welcome if you could use one of the above email addresses.