Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

121 req add guidance for installing packages hosted on GitHub in new versions of rstudio desktop #122

Conversation

JFix89
Copy link
Contributor

@JFix89 JFix89 commented Oct 10, 2024

Pull Request Details

Issue Number: #121

Type: Documentation

Description of the Change

Add instructions on installing packages from GitHub for users of the newest version of RStudio Desktop.

Verification Process

Tested personally and with one other user in the pilot group.

Additional Work Required

NA

Release Notes

Add instructions on installing packages from GitHub for users of the newest version of RStudio Desktop.

@JFix89
Copy link
Contributor Author

JFix89 commented Oct 10, 2024

Hi all, I've just drafted these instructions today after trying to troubleshoot the issues we've been having with the latest version of RStudio Desktop. DaS are going to make separate changes that will get around not being able to install from CRAN, although the issues with GitHub are still being investigated. In the meantime, these instructions should help users install packages from GitHub where necessary.

Copy link
Member

@Moohan Moohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless the fix for CRAN has broken it... would it be worthwhile adding a note that PHS packages (phsmethods etc.) can be installed with install.packages("phsmethods", repos = "https://ppm.publichealthscotland.org/all-r/latest") this is a much simpler process (I think) and also means people should get a more properly versioned package (rather than just the latest commit).

It might also be good to add a final line noting that you can check the installed version of a package with packageVersion("RDCOMClient") which might be useful for comparing with colleagues (although when installing from GitHub you will likely end up with x.x.x.9000 where any small changes won't change the version number...

@@ -0,0 +1,34 @@
# How to install packages hosted on GitHub in RStudio Desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make clear that this is a 'workaround' and not expected to be permanent.

#### 4. Install the package in RStudio Desktop
Open RStudio Desktop and run the following code, replacing 'ldap_username' with your own LDAP username and 'folder_name' (2x) with the name of the unzipped folder in Downloads:

```devtools::install("C:/Users/ldap_username/Downloads/folder_name/folder_name")```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{remotes} is a better option than {devtools} as it's much more lightweight (no dependencies) and doesn't require completion (no requirement for RTools).

Suggested change
```devtools::install("C:/Users/ldap_username/Downloads/folder_name/folder_name")```
```remotes::install_local("C:/Users/<USERNAME>/Downloads/<package>-main.zip")```

Comment on lines +26 to +30
#### 3. Extract all files
Open your local 'Downloads' folder in Windows Explorer. Right-click on the zipped folder and select 'Extract All' from the menu, then 'Extract' on the subsequent popout window. This will unzip the folder into 'Downloads'.

#### 4. Install the package in RStudio Desktop
Open RStudio Desktop and run the following code, replacing 'ldap_username' with your own LDAP username and 'folder_name' (2x) with the name of the unzipped folder in Downloads:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure if this applies to {devtools} (but I suspect it does), and if following my suggestion on using {remotes}, then there is no need to unzip the folder as install_local() can take the zip file directly and deal with it from there.

Suggested change
#### 3. Extract all files
Open your local 'Downloads' folder in Windows Explorer. Right-click on the zipped folder and select 'Extract All' from the menu, then 'Extract' on the subsequent popout window. This will unzip the folder into 'Downloads'.
#### 4. Install the package in RStudio Desktop
Open RStudio Desktop and run the following code, replacing 'ldap_username' with your own LDAP username and 'folder_name' (2x) with the name of the unzipped folder in Downloads:
#### 3. Install the package in RStudio Desktop
Open RStudio Desktop and run the following code, replacing `<USERNAME>` with your own LDAP username and `<package>` with the name of the zipped file in Downloads:


```devtools::install("C:/Users/ldap_username/Downloads/folder_name/folder_name")```

The package will then be installed to the R library, and a message in the console will confirm this. The zipped and unzipped folders in 'Downloads' can then be deleted. To update or reinstall the package at any point in the future, these steps will need to be repeated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The package will then be installed to the R library, and a message in the console will confirm this. The zipped and unzipped folders in 'Downloads' can then be deleted. To update or reinstall the package at any point in the future, these steps will need to be repeated.
The package will then be installed in the R library, and a message in the console will confirm this. The files in 'Downloads' can then be deleted. To update or reinstall the package at any point in the future, these steps will need to be repeated.

@JFix89
Copy link
Contributor Author

JFix89 commented Oct 14, 2024

Thanks for reviewing @Moohan! Having a meeting this afternoon to discuss next steps with Desktop so will hold off making any changes until we know what's happening next. It might not be relevant if DaS have come up with a solution in the meantime.

@JFix89
Copy link
Contributor Author

JFix89 commented Oct 16, 2024

Closing for now as this guidance will hopefully be redundant once DaS package a newer version of RStudio Desktop with dedicated .Renviron and .Rprofile files.

@JFix89 JFix89 closed this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REQ - Add guidance for installing packages hosted on GitHub in new versions of RStudio Desktop
2 participants