I hereby claim:
- I am jhollist on github.
- I am jhollist (https://keybase.io/jhollist) on keybase.
- I have a public key whose fingerprint is D3F0 73AF 7C80 CAAA B965 4E0B 98E3 5E1B 139B 2FEF
To claim this, I am signing this object:
| library(purrr) | |
| library(jsonlite) | |
| library(dplyr) | |
| library(usethis) | |
| # The Data.gov API requires a key and has a 1000 request/hour limit | |
| # Get Key from https://api.data.gov/signup/ | |
| # Save key in r environ | |
| usethis::edit_r_environ() | |
| # Add DATAGOV_KEY=YOURKEYGOESHERE to the file. Save and restart R |
| library(USAboundaries) | |
| library(sf) | |
| library(dplyr) | |
| library(elevatr) | |
| library(raster) | |
| # Get map of lower 48 states | |
| usa_l48 <- us_boundaries() %>% | |
| filter(state_abbr != "HI" & | |
| state_abbr != "AK" & |
| library(sf) | |
| #What I have | |
| l1 <- st_linestring(matrix(c(1,1,2,2,3,1),ncol = 2, byrow = T)) | |
| l2 <- st_linestridng(matrix(c(3,1,3,2,4,2),ncol = 2, byrow = T)) | |
| l3 <- st_linestring(matrix(c(4,2,5,1,6,1),ncol = 2, byrow = T)) | |
| all_lines <- st_sfc(l1,l2,l3) | |
| all_lines | |
| #What I want |
| #' Generate a bibliography of packages | |
| #' | |
| #' This function creates an output bibliography from an input character vector | |
| #' of package names. The primary use case for this function is when working | |
| #' with other authors and you need to provide a reference list of packages used. | |
| #' | |
| #' @param pkgs A character vector of packages | |
| #' @param csl A csl file used to format the output bibliography. Good place to | |
| #' look for these is \url{https://github.com/citation-style-language/styles} | |
| #' @param append_bib Existing \code{.bib} file to append package citations to. |
I hereby claim:
To claim this, I am signing this object:
| library(dplyr) | |
| iris2 <- iris %>% | |
| mutate(sp_abbr = case_when(Species == "virginica" ~ "vir", | |
| Species == "setosa" ~ "set", | |
| Species == "versicolor" ~ "vers")) | |
| iris2 |
| library(gh) | |
| library(dplyr) | |
| library(lubridate) | |
| library(purrr) | |
| usepa_members <- unlist(lapply(gh("/orgs/usepa/members", .limit = Inf), | |
| function(x) x$login)) | |
| # Get all usepa repos, grab commits for each repo, filter for user and count | |
| usepa_repos <- unlist(lapply(gh("/orgs/usepa/repos", type = "all", .limit = Inf), | |
| function(x) x$name)) |
| # Got too many private repos in a GitHub Organization? | |
| # This will list all of the private repos you have access to and rank them by | |
| # days since last push and total number of commits. | |
| # Add PAT to .Renviron - mine is obscured | |
| # cat("GITHUB_PAT=yourowngithubpatgoeshere\n", | |
| # file=file.path(normalizePath("~/"), ".Renviron"), | |
| # append=TRUE) |
| # http://api.census.gov/data/2010/sf1?get=P0010001,P0030001&for=block:1000&in=state:44+county:003+tract:020101 | |
| getCensus(name = "sf1",vintage = 2010, key = Sys.getenv("CENSUS_API_KEY"), | |
| vars = "P0010001", region = "block:1000", regionin = "state:44+county:003+tract:020101") | |
| # Throws error | |
| # Error in data[, c(which(sapply(data, class) != "numeric"), which(sapply(data, : | |
| # incorrect number of dimensions |