This document provides guidelines for maintaining high-quality Rust code. These rules MUST be followed by all AI coding agents and contributors.
All code you write MUST be fully optimized.
"Fully optimized" includes:
| library(tidyverse) | |
| #Wind speeds from the percentile bands in | |
| #https://weatherspark.com/y/23912/Average-Weather-in-New-York-City-New-York-United-States-Year-Round | |
| #https://weatherspark.com/y/14091/Average-Weather-in-Chicago-Illinois-United-States-Year-Round | |
| #weather.gov wind chill chart at https://www.weather.gov/safety/cold-wind-chill-chart | |
| get_wind_chill = function(temp,wind){ | |
| 35.74 + .6251*temp - 35.75 * wind^.16 + .4275 * temp * wind^.16 | |
| } |
| library(tidyverse) | |
| CELSIUS = FALSE | |
| heat_index16term = function(T, RH) { | |
| retval = 16.923 + 1.85212 * 1e-1 * T + 5.37941 * RH - 1.00254 * 1e-1 * T * | |
| RH + | |
| 9.41695 * 1e-3 * T ^ 2 + 7.28898 * 1e-3 * RH ^ 2 + 3.45372 * 1e-4 * | |
| T ^ 2 * RH - 8.14971 * 1e-4 * T * RH ^ 2 + | |
| 1.02102 * 1e-5 * T ^ 2 * RH ^ 2 - 3.8646 * 1e-5 * T ^ 3 + 2.91583 * |
| snippet drillodbcdistributed | |
| library(DBI) | |
| library(odbc) | |
| library(tidyverse) | |
| DBI::dbConnect( | |
| odbc::odbc(), | |
| driver = "/Library/mapr/drill/lib/libdrillodbc_sbu.dylib", | |
| ConnectionType = "Zookeeper", | |
| AuthenticationType = "No Authentication", |
| #' --- | |
| #' title: "" | |
| #' author: "" | |
| #' date: "" | |
| #' output: | |
| #' html_document: | |
| #' keep_md: true | |
| #' theme: simplex | |
| #' highlight: monochrome | |
| #' --- |
| license: MIT |
| # An example of spatial analysis with R that involves grabbing data | |
| # from a PostGIS database, joining to tabular data, projecting | |
| # simplifying and creating an interactive map. | |
| # This data is publicly available but requires some processing | |
| # if you want the county boundaries you can find them here: | |
| # cftp://ftp2.census.gov/geo/tiger/TIGER2016/COUNTY/ | |
| # The tabular data requires some processing but the raw data |
| library(tidycensus) | |
| library(plotly) | |
| library(ggplot2) # devtools::install_github("tidyverse/ggplot2") | |
| library(crosstalk) | |
| # Set your Census API key with `census_api_key()` if not already installed | |
| tx <- get_acs(geography = "county", | |
| variables = c(pctcollege = "DP02_0067P", | |
| hhincome = "DP03_0062"), | |
| state = "TX", |
| library(tidycensus) | |
| library(leaflet) | |
| library(sf) | |
| library(viridis) | |
| options(tigris_use_cache = TRUE) | |
| il1 <- get_acs(geography = "county", | |
| variables = c(hhincome = "B19013_001"), | |
| state = "IL", | |
| geometry = TRUE) %>% |