Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Martin J Frigaard mjfrigaard

🏠
Working from home
View GitHub Profile
View Welcome file.md

Welcome to StackEdit!

Hi! I'm your first Markdown file in StackEdit. If you want to learn about StackEdit, you can read me. If you want to play with Markdown, you can edit me. Once you have finished with me, you can create new files by opening the file explorer on the left corner of the navigation bar.

Files

StackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessible offline!

Create files and folders

@mjfrigaard
mjfrigaard / advR-03-subsetting-notes.md
Created Mar 5, 2021
advanced R (meetup for RIP course)
View advR-03-subsetting-notes.md

Notes from Advanced R, 2nd Ed, 3: Subsetting

Types of subsetting

We can use [[]], [] and $.

If we have a data.frame we get the following output:

View gh-issue.R
#=====================================================================#
# This is code to create: gh-issue.R
# Authored by and feedback to: mjfrigaard
# Last updated:
# MIT License
# Version: 1.0
#=====================================================================#
# I’ve got a random R question. I’m playing with the gh library, which provides access to the github API. Consider this function:
# dataframe <- gh("/users/:username/repos", username = "cahoover")
@mjfrigaard
mjfrigaard / 38-rolling-averages-wrangle.R
Created Jun 22, 2020
Wrangle covid-19 data for rolling averages
View 38-rolling-averages-wrangle.R
#=====================================================================#
# This is code to create: 38-rolling-averages-wrangle.R
# Authored by and feedback to: @mjfrigaard
# MIT License
# Version: 1.1
#=====================================================================#
# Download files into COVID-19/ folder from:
# https://github.com/CSSEGISandData/COVID-19
@mjfrigaard
mjfrigaard / jupyter-install-pkgs.R
Created Dec 15, 2019
Packages for installing R in jupyter notebooks
View jupyter-install-pkgs.R
#=====================================================================#
# This is code to create: jupyter-install-pkgs.R
# Authored by and feedback to: @mjfrigaard
# MIT License
# Version: 1.0
#=====================================================================#
# packages ----------------------------------------------------------------
install.packages(c('rzmq','repr','IRkernel','IRdisplay'),
@mjfrigaard
mjfrigaard / 34.0-gglm_Diagnose.R
Last active Nov 26, 2019
Diagnose linear regression model objects in R
View 34.0-gglm_Diagnose.R
#=====================================================================#
# This is code to create: 34.0-gglm_Diagnose.R
# Authored by and feedback to: mjfrigaard@gmail.com
# MIT License
# Version: 1.0
# Share: http://bit.ly/gglm_Diagnose
#=====================================================================#
require(ggplot2)
require(gridExtra)
require(hrbrthemes)
@mjfrigaard
mjfrigaard / 34.0-animate-norm-vars.R
Last active Nov 25, 2019
Animate normal distributions with different means and standard deviations.
View 34.0-animate-norm-vars.R
#=====================================================================#
# This is code to create: 34.0-animate-norm-vars.R
# Authored by and feedback to: mjfrigaard@gmail.com
# MIT License
# Version: 1.0
# Share: http://bit.ly/gganimate-gif
#=====================================================================#
library(ggplot2)
library(gganimate)
@mjfrigaard
mjfrigaard / rayshader-error.md
Created Oct 11, 2019
error on rayshader package
View rayshader-error.md
#=====================================================================#
# This is code to create: rayshader error
# Authored by and feedback to: mjfrigaard
# MIT License
# Version: 1.0
#=====================================================================#


# error -------------------------------------------------------------------
@mjfrigaard
mjfrigaard / download-youtube-data.md
Last active Sep 30, 2019
This gist shows how to download and wrangle YouTube meta data in R
View download-youtube-data.md
@mjfrigaard
mjfrigaard / readxl_errror-2018-11-06.md
Created Nov 6, 2018
readxl error on iteration for importing many sheets into .csv files
View readxl_errror-2018-11-06.md

Hi #rstats and #tidyverse folks!

I was hoping someone could help me with the error I am seeing when trying to get the functions from the excellent examples on readxl?

I have multiple sheets in an .xlsx file I want to read into data frames and write (a few) of them as .csv files.

Unfortunately I keep seeing this error: