How to install miniconda on MacOS

source: https://docs.anaconda.com/free/miniconda/ # create parent directory miniconda3 mkdir -p ~/miniconda3 # download curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh # execute installation and updates bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 # remove setup…

Github: resolving conflict

Conflict 1: hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and integrate the remote changes hint: (e.g. 'git pull…

R – here package

https://here.r-lib.org/articles/here.html it is a useful package to set project root directory # my project structure is following: #> /home/sunny/work/myproject #> ├── data_proc #> │ └── mycode.R #> ├── analysis #>…

How to create a website from Quarto

source: https://quarto.org/docs/publishing/github-pages.html Download and install Quarto CLI from https://quarto.org/docs/download/ Open your terminal and go to your working directory (e.g. ~/projects/sunny-bak/) Create a quarto scaffolding for your project (template) called funsite;…

Useful R codes

How to get min and max value and the associated year that min and max values occurred previous <- dfile %>%filter(YearLabel == "Previous") %>%group_by(MonthName) %>%summarize(min_extent = min(extent_mil),max_extent = max(extent_mil),year_min =…

Creating htmlwidget in RStudio

To set up required packages to create htmlwidget install.packages("htmlwidgets") install.packages("devtools") Scaffolding will provide a template (basic structure) for a widget development library(devtools) create("my_widget") htmlwidgets::scaffoldWidget("my_widget") document() # Update documentation build() #…

R data wrangling

This code snippet has nice examples of data wrangling From https://www.jumpingrivers.com/blog/r-d3-intro-r2d3/ scoobydoo = tuesdata$scoobydoo # wrangling data into nice shape monsters_caught = scoobydoo %>% select(date_aired, starts_with("caught")) %>% mutate(across(starts_with("caught"), ~ as.logical(.)))…