Russell Shean

@rshean.bsky.social

Computer and data stuff

Hi #rstats, any best practices for which environment files should be ignored for R projects? I noticed that the GitHub standard .gitignore template has .Renviron, but I want to make a pull request to add .env too. Is there a reason not to? Should I add anything else? github.com/github/gitig...

gitignore/R.gitignore at main · github/gitignore

A collection of useful .gitignore templates. Contribute to github/gitignore development by creating an account on GitHub.

github.com

For Windows This assumes no admin rights, if you have admin rights there are more options: superuser.com/a/1026940 1. Find your #Rstats executable 2. Create a new folder 3. Inside folder add a batch script to launch R with --no-save arg 4. Add folder to path gist: gist.github.com/Russell-Shea...

FIRST HALF

Here are some commands you can run in command prompt to 

1. create a new folder called "my_custom_bin"
2. create a batch script inside "my_custom_bin" with the following:

@echo off
"C:/Program Files/R/R-4.4.2/bin/r.exe" --no-save

These commands could be run individually in a command prompt window or as a batch script. These steps could also be done manually. Code is available as gist in link above. SECOND HALF

Here are some commands you can run in command prompt to 

1. create a new powershell script  
2. execute the powershell script to add "my_custom_bin" to the path

These commands should be run after the commands in the first screenshot. They could be run individually in a command prompt window or combined with the first screenshot as a batch script. The powershell script could also be run directly in powershell..... 
You can add to the path manually by going to "edit environmental variables for your account"  in control panel, then edit  "Path" under user variables and then add the full path to "my_custom_bin"

After you're finished setting all this up,  any time you type "R" in a terminal, windows will search the path, find the R.bat file in "my_custom_bin" and execute the batch script. The batch script will launch R with the --no-save option enabled. 

This may not work if R is already on your path?
Russell Shean@rshean.bsky.social · 2y ago

Ha! I figured out how to disable the "save workspace image ?" prompt when exiting #Rstats from a terminal Here's how I did it (in Ubuntu; I'm going to solve windows cmd tomorrow at work) Details in alt text! credit to this blog that I shamelessly copied from: www.r-bloggers.com/2009/03/r-ti...

To open and edit the bash profile file with nano, enter this command in a terminal:
nano ~/.bashrc

Add this to the file:
alias R='R --no-save'

To save (Ctrl + O is what ^O means)
Ctrl + O 

To exit nano 
Ctrl + X

Restart the terminal for the change to take effect. 
The option in the alt text assumes that R is already on your path as "R". The option in the image/blog link is probably safer because it checks the bin for R, but it's also waaay more typing :D .

Thanks @edenian-prince.bsky.social for inviting to help make this closeread...and for doing most of the work 😅 It's really cool how leaflet maps can be embedded directly into the html. Next time I want to try shinylive or something to embed a shiny instead of just using an iframe like we did here.

@edenian-prince.bsky.social · 2y ago

So excited! I submitted a quarto site for the closeread competition. It's a Quarto website that uses closeread (scrollytelling) and parallax effects to tell a story about bigfoot sightings data. note - it doesn't work well on mobile:( edenian-prince.github.io/bigfoot-clos... #quartopub #rstats