Have no idea if my code does what I want it do

The point of the code is to isolate specific populations from a large database of enteries. Where do I go to get help with that? Sorry for the noob post

Getting there depends a lot on your source data. I'm going to illustrate with an example of a CSV (comma separated value) file, which is one of the Save as options in Excel.


suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(knitr))
suppressPackageStartupMessages(library(kableExtra))

library(tidyverse)
library(knitr)
library(kableExtra)
knitr::opts_chunk$set(echo = TRUE)

converter <-  read.csv("https://gist.githubusercontent.com/technocrat/93470bf9abead06ef926/raw/f652f8171374e7808455f42167f5480ea15f7f4e/state_fips_postal.csv", header = FALSE, stringsAsFactors = FALSE)
converter <-  rename(converter, NAME = V1, geoid = V2, id = V3)
states_key <- as.tibble(converter) %>% filter(id != 'DC') 

kable(converter, format.args = list(big.mark = ","), caption = "State Postal Abbreviations with FIPS Codes")  %>% kable_styling(bootstrap_options = "striped", full_width = F)

which will get you to:

filtered <- converter %>% filter(NAME == "Wyoming" | geoid == 23)
kable(filtered, format.args = list(big.mark = ","), caption = "Selected State Postal Abbreviations with FIPS Codes") %>% 
kable_styling(bootstrap_options = "striped", full_width = F)

as shown here:

Illustration.pdf (49.9 KB)

3 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.