Activate daRkStudio

activate(path = NULL, backup = TRUE, type = NULL)

Arguments

path

character: Path to RStudio's index.htm. Useful for times when the default installation method cannot successfully locate the file.

backup

logical: TRUE or FALSE. Copies the default index.htm file to index.htm.pre-ds. Defaults to TRUE.

type

character: Accepts 'user' or NULL. If 'user', activate() will look for RStudio in /Users/xxx/Applications instead of /Applications on macOS.

daRkStudio modifies index.htm, a file used by RStudio to construct it's DOM (Document Object Model).

The only change to index.htm the inclusion of a <link> element near the end of the file, which tells RStudio to load darkstudio.css.

daRkStudio creates a directory, "darkstudio", inside the www folder, which is found at /Applications/RStudio.app/Contents/Resources/www on macOS, and C:\Program Files\RStudio\www on Windows.

activate() will create a backup of index.htm at www/darkstudio/index.htm.pre-ds. www/darkstudio is also where you will find darkstudio.css, which is the bread and butter of this package.

On Windows, you will likely need Administrator Privileges if you've installed RStudio to the default location, C:\Program Files\RStudio.

Value

TRUE

Returns TRUE if the operation is successful.

Examples

if (FALSE) { # Default: activate() # macOS: path_index <- "/Applications/RStudio.app/Contents/Resources/www/index.htm" activate(path = path_index, backup = TRUE) # Windows: path_index <- "C:/Program Files/RStudio/www/index.htm" activate(path = path_index, backup = TRUE) }