Furthermore, there are options for y-scaling that include centering
the glyph vertically on the station location.
-These rescaling past examples have all been made with global
rescaling enabled (default) which results in the glyphs being
differently sized according to their values relative to each other.
Turning off global rescaling allows all glpyhs to rescale within their
own individual values and produce glyphs that sized more evenly.
-This is another example that shows flight cancellations from the airports that have the most flight cancellations:
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 79646b4..4f4c6bf 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.1.0
pkgdown_sha: ~
articles:
GeomSegmentGlyph: GeomSegmentGlyph.html
-last_built: 2024-08-22T01:19Z
+last_built: 2024-08-22T03:41Z
urls:
reference: https://knicey.github.io/stglyphs/reference
article: https://knicey.github.io/stglyphs/articles
diff --git a/docs/reference/figures/README-unnamed-chunk-2-1.png b/docs/reference/figures/README-unnamed-chunk-2-1.png
new file mode 100644
index 0000000..0b8cc39
Binary files /dev/null and b/docs/reference/figures/README-unnamed-chunk-2-1.png differ
diff --git a/docs/reference/figures/README-unnamed-chunk-4-1.png b/docs/reference/figures/README-unnamed-chunk-4-1.png
new file mode 100644
index 0000000..fd60c8c
Binary files /dev/null and b/docs/reference/figures/README-unnamed-chunk-4-1.png differ
diff --git a/docs/search.json b/docs/search.json
index 18558f4..4613267 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"geomsegmentglyph","dir":"Articles","previous_headings":"","what":"GeomSegmentGlyph","title":"GeomSegmentGlyph","text":"Glyph Maps allow data visualized across geographic regions different periods time (see cubble information). Line Segment Glyphs extend adding options visualize multivariate spatio-temporal data. aesthetics similar geom_segment x y major variables order designate glyph placement.","code":""},{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"monthly-temperatures-across-the-us","dir":"Articles","previous_headings":"","what":"Monthly Temperatures Across the US","title":"GeomSegmentGlyph","text":"National Oceanica Atmosphere Administration (NOAA) provides weather data stations US. stations dataset contains climate variables prerciptation, temperature, elevation 10 different weather stations every day 2020 2023. example, interesting finding average minimum maximum temperature per month across days years per station. using dplyr functions group_by summarise default rescaling parameters, resulting geom segment glyph along geom_point help illustrate station location segment glyph corresponds . GeomSegmentGlyph additionally offers ways rescale glyphs. , can specify rescale11x preferred rescaling x center glyph station. Furthermore, options y-scaling include centering glyph vertically station location. rescaling past examples made global rescaling enabled (default) results glyphs differently sized according values relative . Turning global rescaling allows glpyhs rescale within individual values produce glyphs sized evenly.","code":"stations #> # A tibble: 43,551 × 12 #> id long lat elev name wmo_id date prcp tmax tmin month year #> #> 1 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-01 0 -1.1 -8.9 1 2020 #> 2 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-02 0 2.2 -8.9 1 2020 #> 3 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-03 356 8.3 1.1 1 2020 #> 4 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-04 178 7.8 1.7 1 2020 #> 5 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-05 3 1.7 -10.6 1 2020 #> 6 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-06 0 -0.6 -10 1 2020 #> 7 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-07 51 1.1 -7.2 1 2020 #> 8 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-08 76 -1.1 -9.4 1 2020 #> 9 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-09 0 -1.1 -8.9 1 2020 #> 10 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-10 5 2.8 -2.8 1 2020 #> # ℹ 43,541 more rows grouped <- stations |> group_by(month, name, long, lat) |> summarise( avgmin = mean(tmin, na.rm = TRUE), avgmax = mean(tmax, na.rm = TRUE) ) #> `summarise()` has grouped output by 'month', 'name', 'long'. You can override #> using the `.groups` argument. ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( width = 0.4, height = 0.1, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, width = 2, height = 0.1, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale01y, width = 2, height = 3, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale11y, global_rescale = FALSE, width = 2, height = 3, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) #> Warning: Unknown or uninitialised column: `linewidth`. #> Warning: Unknown or uninitialised column: `size`."},{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"observations-and-insights","dir":"Articles","previous_headings":"","what":"Observations and Insights","title":"GeomSegmentGlyph","text":"Line Segment Glyphs offer unique insights seasonal temperature trends across US. Turning global rescaling shows stations generally followed curvature trends relative lowest temperatures. However factoring global rescaling, certain locations show much less total variation temperature California Florida.","code":""},{"path":"https://knicey.github.io/stglyphs/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nathan Yang. Author, maintainer.","code":""},{"path":"https://knicey.github.io/stglyphs/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Yang N (2024). stglpyhs: Add Spatio Temporal Glyphs. R package version 0.0.0.9000, https://knicey.github.io/stglyphs/.","code":"@Manual{, title = {stglpyhs: Add Spatio Temporal Glyphs}, author = {Nathan Yang}, year = {2024}, note = {R package version 0.0.0.9000}, url = {https://knicey.github.io/stglyphs/}, }"},{"path":"https://knicey.github.io/stglyphs/index.html","id":"stglpyhs","dir":"","previous_headings":"","what":"Add Spatio Temporal Glyphs","title":"Add Spatio Temporal Glyphs","text":"goal stglpyhs introduce new ways visualizing spatio-temporal data particular analyzing across multivariate seasonal data. existing cubble package implements glyph maps form line graphs. project seeks expand functionality segment plots visualize multivariable data better analyze seasonal trends.","code":""},{"path":"https://knicey.github.io/stglyphs/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Add Spatio Temporal Glyphs","text":"can install development version stglpyhs GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"Knicey/stglyphs\")"},{"path":"https://knicey.github.io/stglyphs/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Add Spatio Temporal Glyphs","text":"example displays seasonal mins maxes temperature NOAA across US: another example shows flight cancellations airports flight cancellations:","code":"library(stglpyhs) library(dplyr) #> #> Attaching package: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union library(ggplot2) library(lubridate) #> #> Attaching package: 'lubridate' #> The following objects are masked from 'package:base': #> #> date, intersect, setdiff, union stations_grouped <- stations |> group_by(month, name, long, lat) |> summarise( avgmin = mean(tmin, na.rm = TRUE), avgmax = mean(tmax, na.rm = TRUE) ) |> ungroup() #> `summarise()` has grouped output by 'month', 'name', 'long'. You can override #> using the `.groups` argument. #TODO: Accommodate for xend aesthetic (required in geom_segment) ggplot(data = stations_grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale11y, global_rescale = FALSE, width = 2, height = 3, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) #> Warning: Unknown or uninitialised column: `linewidth`. #> Warning: Unknown or uninitialised column: `size`. flights_grouped <- flights |> mutate( month = month(FL_DATE), year = year(FL_DATE) ) |> group_by(ORIGIN, month, year, longitude, latitude) |> summarise( total_flights = n() ) |> group_by(ORIGIN, month, longitude, latitude) |> summarise( max = max(total_flights), min = min(total_flights), ) #> `summarise()` has grouped output by 'ORIGIN', 'month', 'year', 'longitude'. You #> can override using the `.groups` argument. #> `summarise()` has grouped output by 'ORIGIN', 'month', 'longitude'. You can #> override using the `.groups` argument. ggplot(data = flights_grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = longitude, y = latitude)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale01y, global_rescale = FALSE, width = 1.5, height = 3, aes( x_major = longitude, y_major = latitude, x_minor = month, y_minor = min, yend_minor = max) ) #> Warning: Unknown or uninitialised column: `linewidth`. #> Warning: Unknown or uninitialised column: `size`."},{"path":"https://knicey.github.io/stglyphs/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 stglpyhs authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":null,"dir":"Reference","previous_headings":"","what":"Flight Cancellation Data from 2019-2023 — flights","title":"Flight Cancellation Data from 2019-2023 — flights","text":"list canceled flights originated top 10 airports canceled flights. included airports DEN, MCO, SEA, ATL, DFW, ORD, LAS, LAX, PHX.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flight Cancellation Data from 2019-2023 — flights","text":"","code":"flights"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":"flights","dir":"Reference","previous_headings":"","what":"flights","title":"Flight Cancellation Data from 2019-2023 — flights","text":"data frame 989355 rows 45 columns: FL_DATE date flight ORIGIN origin airport flight","code":""},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"GeomSegmentGlyph — geom_segment_glyph","title":"GeomSegmentGlyph — geom_segment_glyph","text":"GeomSegmentGlyph","code":""},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GeomSegmentGlyph — geom_segment_glyph","text":"","code":"geom_segment_glyph( mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", ..., x_major = NULL, x_minor = NULL, y_major = NULL, y_minor = NULL, yend_minor = NULL, width = ggplot2::rel(2.1), height = ggplot2::rel(2.1), a_x = 0.15, a_y = 0.08, show.legend = NA, inherit.aes = TRUE )"},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GeomSegmentGlyph — geom_segment_glyph","text":"description","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"GeomSegmentGlyph — geom_segment_glyph","title":"GeomSegmentGlyph — geom_segment_glyph","text":"Create segment plot glyph ggplot2","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GeomSegmentGlyph — geom_segment_glyph","text":"","code":"geom_segment_glyph( mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", ..., x_major = NULL, x_minor = NULL, y_major = NULL, y_minor = NULL, yend_minor = NULL, width = 0.1, x_scale = identity, y_scale = identity, height = 0.1, global_rescale = TRUE, show.legend = NA, inherit.aes = TRUE )"},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GeomSegmentGlyph — geom_segment_glyph","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer. using geom_*() function construct layer, stat argument can used override default coupling geoms stats. stat argument accepts following: Stat ggproto subclass, example StatCount. string naming stat. give stat string, strip function name stat_ prefix. example, use stat_count(), give stat \"count\". information ways specify stat, see layer stat documentation. position position adjustment use data layer. can used various ways, including prevent overplotting improving display. position argument accepts following: result calling position function, position_jitter(). method allows passing extra arguments position. string naming position adjustment. give position string, strip function name position_ prefix. example, use position_jitter(), give position \"jitter\". information ways specify position, see layer position documentation. ... arguments passed layer()'s params argument. arguments broadly fall one 4 categories . Notably, arguments position argument, aesthetics required can passed .... Unknown arguments part 4 categories ignored. Static aesthetics mapped scale, fixed value apply layer whole. example, colour = \"red\" linewidth = 3. geom's documentation Aesthetics section lists available options. 'required' aesthetics passed params. Please note passing unmapped aesthetics vectors technically possible, order required length guaranteed parallel input data. constructing layer using stat_*() function, ... argument can used pass parameters geom part layer. example stat_density(geom = \"area\", outline.type = \"\"). geom's documentation lists parameters can accept. Inversely, constructing layer using geom_*() function, ... argument can used pass parameters stat part layer. example geom_area(stat = \"density\", adjust = 0.5). stat's documentation lists parameters can accept. key_glyph argument layer() may also passed .... can one functions described key glyphs, change display layer legend. x_major, x_minor, y_major, y_minor, yend_minor name variable (string) major minor x y axes. x_major y_major specify longitude latitude map x_minor, y_minor, yend_minor provide structure glyph. y_scale, x_scale scaling function applied set minor values within grid cell. default identity produces result without scaling. height, width height width glyph. global_rescale Determines whether rescaling performed globally separately individual glyph. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GeomSegmentGlyph — geom_segment_glyph","text":"ggplot object","code":""},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":null,"dir":"Reference","previous_headings":"","what":"rnaturalearth Mainland US Map Shapefile — mainland_us","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"shapefile rnatural earth contiguous United States. shapefile also simplified rmapshaper using ms_simplify.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"","code":"mainland_us"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":"mainland-us","dir":"Reference","previous_headings":"","what":"mainland_us","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"data frame 49 rows 122 columns: postal state abbreviation name_sv name state geometry polygon representing shape tsate","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale01x — rescale01x","title":"rescale01x — rescale01x","text":"Rescale x-axis 0,1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale01x — rescale01x","text":"","code":"rescale01x(x, xlim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale01x — rescale01x","text":"x input array rescaled xlim limit rescaling. NULL, range x used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale01x — rescale01x","text":"rescaled array based input array provided limit provides values 0 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale01y — rescale01y","title":"rescale01y — rescale01y","text":"Rescale y-axis 0,1 rescaling works differently x rescaling y y end need rescaled together","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale01y — rescale01y","text":"","code":"rescale01y(y, yend, ylim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale01y — rescale01y","text":"y, yend input arrays rescaled ylim limit rescaling. NULL, maximum value y yend used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale01y — rescale01y","text":"list two rescaled arrays based input array provided limit provides values 0 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale11x — rescale11x","title":"rescale11x — rescale11x","text":"Rescale x-axis -1,1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale11x — rescale11x","text":"","code":"rescale11x(x, xlim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale11x — rescale11x","text":"x input array rescaled xlim limit rescaling. NULL, range x used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale11x — rescale11x","text":"rescaled array based input array provided limit provides values -1 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale11y — rescale11y","title":"rescale11y — rescale11y","text":"Rescale y-axis -1,1 rescaling works differently x rescaling y y end need rescaled together","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale11y — rescale11y","text":"","code":"rescale11y(y, yend, ylim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale11y — rescale11y","text":"y, yend input arrays rescaled ylim limit rescaling. NULL, maximum value y yend used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale11y — rescale11y","text":"list two rescaled arrays based input array provided limit provides values -1 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":null,"dir":"Reference","previous_headings":"","what":"NOAA Weather Station Data — stations","title":"NOAA Weather Station Data — stations","text":"subset data NOAA weather stations United States. Selected stations include: MIAMI BEACH, MT LECONTE, RALEIGH AP, KANSAS CITY INTL AP, MCCARRAN INTL AP, CHEYENNE, NY CITY CNTRL PARK SANTA MONICA MUNI AP SEATTLE TACOMA AP","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"NOAA Weather Station Data — stations","text":"","code":"stations"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"stations","dir":"Reference","previous_headings":"","what":"stations","title":"NOAA Weather Station Data — stations","text":"data frame 17,253 rows 12 columns: name Station Location tmin, tmax minimum maximum temperatures prcp Percepitation","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"NOAA Weather Station Data — stations","text":"https://www.ncei.noaa.gov/access/search/data-search/daily-summaries","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a string — str_split_one","title":"Split a string — str_split_one","text":"Split string","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a string — str_split_one","text":"","code":"str_split_one(string, pattern, n = Inf)"},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a string — str_split_one","text":"string character vector , , one element. pattern Pattern look . default interpretation regular expression, described vignette(\"regular-expressions\"). Use regex() finer control matching behaviour. Match fixed string (.e. comparing bytes), using fixed(). fast, approximate. Generally, matching human text, want coll() respects character matching rules specified locale. Match character, word, line sentence boundaries boundary(). empty pattern, \"\", equivalent boundary(\"character\"). n Maximum number pieces return. Default (Inf) uses possible split positions. str_split(), determines maximum length element output. str_split_fixed(), determines number columns output; input short, result padded \"\".","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a string — str_split_one","text":"character vector.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a string — str_split_one","text":"","code":"x <- \"alfa,bravo,charlie,delta\" str_split_one(x, pattern = \",\") #> [1] \"alfa\" \"bravo\" \"charlie\" \"delta\" str_split_one(x, pattern = \",\", n = 2) #> [1] \"alfa\" \"bravo,charlie,delta\" y <- \"192.168.0.1\" str_split_one(y, pattern = stringr::fixed(\".\")) #> [1] \"192\" \"168\" \"0\" \"1\""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a glyph map — st_glyph","title":"Create a glyph map — st_glyph","text":"Create glyph map","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a glyph map — st_glyph","text":"","code":"st_glyph(data)"},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a glyph map — st_glyph","text":"data Default dataset use plot. already data.frame, converted one fortify(). specified, must supplied layer added plot. string dataframe fields: name, month, avgmin, avgmax.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a glyph map — st_glyph","text":"ggplot object.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a glyph map — st_glyph","text":"","code":"data <- tribble( ~name, ~month, ~avgmin, ~avgmax, \"A\", 1, 0.5, 1.5, \"A\", 2, 0.6, 1.6, \"A\", 3, 0.7, 1.7, ) #> Error in tribble(~name, ~month, ~avgmin, ~avgmax, \"A\", 1, 0.5, 1.5, \"A\", 2, 0.6, 1.6, \"A\", 3, 0.7, 1.7, ): could not find function \"tribble\" st_glyph(data) #> Error in ggplot2::ggplot(data): `data` cannot be a function. #> ℹ Have you misspelled the `data` argument in `ggplot()`"}]
+[{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"geomsegmentglyph","dir":"Articles","previous_headings":"","what":"GeomSegmentGlyph","title":"GeomSegmentGlyph","text":"Glyph Maps allow data visualized across geographic regions different periods time (see cubble information). Line Segment Glyphs extend adding options visualize multivariate spatio-temporal data. aesthetics similar geom_segment x y major variables order designate glyph placement.","code":""},{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"monthly-temperatures-across-the-us","dir":"Articles","previous_headings":"","what":"Monthly Temperatures Across the US","title":"GeomSegmentGlyph","text":"National Oceanica Atmosphere Administration (NOAA) provides weather data stations US. stations dataset contains climate variables prerciptation, temperature, elevation 10 different weather stations every day 2020 2023. example, interesting finding average minimum maximum temperature per month across days years per station. using dplyr functions group_by summarise default rescaling parameters, resulting geom segment glyph along geom_point help illustrate station location segment glyph corresponds . GeomSegmentGlyph additionally offers ways rescale glyphs. , can specify rescale11x preferred rescaling x center glyph station. Furthermore, options y-scaling include centering glyph vertically station location. rescaling past examples made global rescaling enabled (default) results glyphs differently sized according values relative . Turning global rescaling allows glpyhs rescale within individual values produce glyphs sized evenly.","code":"stations #> # A tibble: 43,551 × 12 #> id long lat elev name wmo_id date prcp tmax tmin month year #> #> 1 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-01 0 -1.1 -8.9 1 2020 #> 2 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-02 0 2.2 -8.9 1 2020 #> 3 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-03 356 8.3 1.1 1 2020 #> 4 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-04 178 7.8 1.7 1 2020 #> 5 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-05 3 1.7 -10.6 1 2020 #> 6 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-06 0 -0.6 -10 1 2020 #> 7 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-07 51 1.1 -7.2 1 2020 #> 8 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-08 76 -1.1 -9.4 1 2020 #> 9 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-09 0 -1.1 -8.9 1 2020 #> 10 USC0… -83.4 35.7 1979. MT L… \"\" 2020-01-10 5 2.8 -2.8 1 2020 #> # ℹ 43,541 more rows grouped <- stations |> group_by(month, name, long, lat) |> summarise( avgmin = mean(tmin, na.rm = TRUE), avgmax = mean(tmax, na.rm = TRUE) ) #> `summarise()` has grouped output by 'month', 'name', 'long'. You can override #> using the `.groups` argument. ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( width = 0.4, height = 0.1, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, width = 2, height = 0.1, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) ggplot(data = grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale11y, global_rescale = FALSE, width = 2, height = 3, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) )"},{"path":"https://knicey.github.io/stglyphs/articles/GeomSegmentGlyph.html","id":"observations-and-insights","dir":"Articles","previous_headings":"","what":"Observations and Insights","title":"GeomSegmentGlyph","text":"Line Segment Glyphs offer unique insights seasonal temperature trends across US. Turning global rescaling shows stations generally followed curvature trends relative lowest temperatures. However factoring global rescaling, certain locations show much less total variation temperature California Florida.","code":""},{"path":"https://knicey.github.io/stglyphs/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nathan Yang. Author, maintainer.","code":""},{"path":"https://knicey.github.io/stglyphs/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Yang N (2024). stglpyhs: Add Spatio Temporal Glyphs. R package version 0.0.0.9000, https://knicey.github.io/stglyphs/.","code":"@Manual{, title = {stglpyhs: Add Spatio Temporal Glyphs}, author = {Nathan Yang}, year = {2024}, note = {R package version 0.0.0.9000}, url = {https://knicey.github.io/stglyphs/}, }"},{"path":"https://knicey.github.io/stglyphs/index.html","id":"stglpyhs","dir":"","previous_headings":"","what":"Add Spatio Temporal Glyphs","title":"Add Spatio Temporal Glyphs","text":"goal stglpyhs introduce new ways visualizing spatio-temporal data particular analyzing across multivariate seasonal data. existing cubble package implements glyph maps form line graphs. project seeks expand functionality segment plots visualize multivariable data better analyze seasonal trends.","code":""},{"path":"https://knicey.github.io/stglyphs/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Add Spatio Temporal Glyphs","text":"can install development version stglpyhs GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"Knicey/stglyphs\")"},{"path":"https://knicey.github.io/stglyphs/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Add Spatio Temporal Glyphs","text":"example displays seasonal mins maxes temperature NOAA across US: another example shows flight cancellations airports flight cancellations:","code":"library(stglpyhs) library(ggplot2) library(dplyr, warn.conflicts = FALSE) stations_grouped <- stations |> group_by(month, name, long, lat) |> summarise( avgmin = mean(tmin, na.rm = TRUE), avgmax = mean(tmax, na.rm = TRUE) ) ggplot(data = stations_grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = long, y = lat)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale11y, global_rescale = FALSE, width = 2, height = 3, aes( x_major = long, y_major = lat, x_minor = month, y_minor = avgmin, yend_minor = avgmax) ) library(lubridate, warn.conflicts = FALSE) flights_grouped <- flights |> mutate( month = month(FL_DATE), year = year(FL_DATE) ) |> group_by(ORIGIN, month, year, longitude, latitude) |> summarise( total_flights = n() ) |> group_by(ORIGIN, month, longitude, latitude) |> summarise( max = max(total_flights), min = min(total_flights), ) ggplot(data = flights_grouped) + geom_sf(data = mainland_us, color = \"white\") + ggthemes::theme_map() + geom_point(aes(x = longitude, y = latitude)) + geom_segment_glyph( x_scale = rescale11x, y_scale = rescale01y, global_rescale = FALSE, width = 1.5, height = 3, aes( x_major = longitude, y_major = latitude, x_minor = month, y_minor = min, yend_minor = max) )"},{"path":"https://knicey.github.io/stglyphs/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 stglpyhs authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":null,"dir":"Reference","previous_headings":"","what":"Flight Cancellation Data from 2019-2023 — flights","title":"Flight Cancellation Data from 2019-2023 — flights","text":"list canceled flights originated top 10 airports canceled flights. included airports DEN, MCO, SEA, ATL, DFW, ORD, LAS, LAX, PHX.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flight Cancellation Data from 2019-2023 — flights","text":"","code":"flights"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/flights.html","id":"flights","dir":"Reference","previous_headings":"","what":"flights","title":"Flight Cancellation Data from 2019-2023 — flights","text":"data frame 989355 rows 45 columns: FL_DATE date flight ORIGIN origin airport flight","code":""},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"GeomSegmentGlyph — geom_segment_glyph","title":"GeomSegmentGlyph — geom_segment_glyph","text":"GeomSegmentGlyph","code":""},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GeomSegmentGlyph — geom_segment_glyph","text":"","code":"geom_segment_glyph( mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", ..., x_major = NULL, x_minor = NULL, y_major = NULL, y_minor = NULL, yend_minor = NULL, width = ggplot2::rel(2.1), height = ggplot2::rel(2.1), a_x = 0.15, a_y = 0.08, show.legend = NA, inherit.aes = TRUE )"},{"path":"https://knicey.github.io/stglyphs/reference/geom_segment_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GeomSegmentGlyph — geom_segment_glyph","text":"description","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"GeomSegmentGlyph — geom_segment_glyph","title":"GeomSegmentGlyph — geom_segment_glyph","text":"Create segment plot glyph ggplot2","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GeomSegmentGlyph — geom_segment_glyph","text":"","code":"geom_segment_glyph( mapping = NULL, data = NULL, stat = \"identity\", position = \"identity\", ..., x_major = NULL, x_minor = NULL, y_major = NULL, y_minor = NULL, yend_minor = NULL, width = 0.1, x_scale = identity, y_scale = identity, height = 0.1, global_rescale = TRUE, show.legend = NA, inherit.aes = TRUE )"},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GeomSegmentGlyph — geom_segment_glyph","text":"mapping Set aesthetic mappings created aes(). specified inherit.aes = TRUE (default), combined default mapping top level plot. must supply mapping plot mapping. data data displayed layer. three options: NULL, default, data inherited plot data specified call ggplot(). data.frame, object, override plot data. objects fortified produce data frame. See fortify() variables created. function called single argument, plot data. return value must data.frame, used layer data. function can created formula (e.g. ~ head(.x, 10)). stat statistical transformation use data layer. using geom_*() function construct layer, stat argument can used override default coupling geoms stats. stat argument accepts following: Stat ggproto subclass, example StatCount. string naming stat. give stat string, strip function name stat_ prefix. example, use stat_count(), give stat \"count\". information ways specify stat, see layer stat documentation. position position adjustment use data layer. can used various ways, including prevent overplotting improving display. position argument accepts following: result calling position function, position_jitter(). method allows passing extra arguments position. string naming position adjustment. give position string, strip function name position_ prefix. example, use position_jitter(), give position \"jitter\". information ways specify position, see layer position documentation. ... arguments passed layer()'s params argument. arguments broadly fall one 4 categories . Notably, arguments position argument, aesthetics required can passed .... Unknown arguments part 4 categories ignored. Static aesthetics mapped scale, fixed value apply layer whole. example, colour = \"red\" linewidth = 3. geom's documentation Aesthetics section lists available options. 'required' aesthetics passed params. Please note passing unmapped aesthetics vectors technically possible, order required length guaranteed parallel input data. constructing layer using stat_*() function, ... argument can used pass parameters geom part layer. example stat_density(geom = \"area\", outline.type = \"\"). geom's documentation lists parameters can accept. Inversely, constructing layer using geom_*() function, ... argument can used pass parameters stat part layer. example geom_area(stat = \"density\", adjust = 0.5). stat's documentation lists parameters can accept. key_glyph argument layer() may also passed .... can one functions described key glyphs, change display layer legend. x_major, x_minor, y_major, y_minor, yend_minor name variable (string) major minor x y axes. x_major y_major specify longitude latitude map x_minor, y_minor, yend_minor provide structure glyph. y_scale, x_scale scaling function applied set minor values within grid cell. default identity produces result without scaling. height, width height width glyph. global_rescale Determines whether rescaling performed globally separately individual glyph. show.legend logical. layer included legends? NA, default, includes aesthetics mapped. FALSE never includes, TRUE always includes. can also named logical vector finely select aesthetics display. inherit.aes FALSE, overrides default aesthetics, rather combining . useful helper functions define data aesthetics inherit behaviour default plot specification, e.g. borders().","code":""},{"path":"https://knicey.github.io/stglyphs/reference/glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GeomSegmentGlyph — geom_segment_glyph","text":"ggplot object","code":""},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":null,"dir":"Reference","previous_headings":"","what":"rnaturalearth Mainland US Map Shapefile — mainland_us","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"shapefile rnatural earth contiguous United States. shapefile also simplified rmapshaper using ms_simplify.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"","code":"mainland_us"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/mainland_us.html","id":"mainland-us","dir":"Reference","previous_headings":"","what":"mainland_us","title":"rnaturalearth Mainland US Map Shapefile — mainland_us","text":"data frame 49 rows 122 columns: postal state abbreviation name_sv name state geometry polygon representing shape tsate","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale01x — rescale01x","title":"rescale01x — rescale01x","text":"Rescale x-axis 0,1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale01x — rescale01x","text":"","code":"rescale01x(x, xlim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale01x — rescale01x","text":"x input array rescaled xlim limit rescaling. NULL, range x used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01x.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale01x — rescale01x","text":"rescaled array based input array provided limit provides values 0 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale01y — rescale01y","title":"rescale01y — rescale01y","text":"Rescale y-axis 0,1 rescaling works differently x rescaling y y end need rescaled together","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale01y — rescale01y","text":"","code":"rescale01y(y, yend, ylim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale01y — rescale01y","text":"y, yend input arrays rescaled ylim limit rescaling. NULL, maximum value y yend used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale01y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale01y — rescale01y","text":"list two rescaled arrays based input array provided limit provides values 0 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale11x — rescale11x","title":"rescale11x — rescale11x","text":"Rescale x-axis -1,1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale11x — rescale11x","text":"","code":"rescale11x(x, xlim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale11x — rescale11x","text":"x input array rescaled xlim limit rescaling. NULL, range x used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11x.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale11x — rescale11x","text":"rescaled array based input array provided limit provides values -1 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":null,"dir":"Reference","previous_headings":"","what":"rescale11y — rescale11y","title":"rescale11y — rescale11y","text":"Rescale y-axis -1,1 rescaling works differently x rescaling y y end need rescaled together","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"rescale11y — rescale11y","text":"","code":"rescale11y(y, yend, ylim = NULL)"},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"rescale11y — rescale11y","text":"y, yend input arrays rescaled ylim limit rescaling. NULL, maximum value y yend used.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/rescale11y.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"rescale11y — rescale11y","text":"list two rescaled arrays based input array provided limit provides values -1 1","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":null,"dir":"Reference","previous_headings":"","what":"NOAA Weather Station Data — stations","title":"NOAA Weather Station Data — stations","text":"subset data NOAA weather stations United States. Selected stations include: MIAMI BEACH, MT LECONTE, RALEIGH AP, KANSAS CITY INTL AP, MCCARRAN INTL AP, CHEYENNE, NY CITY CNTRL PARK SANTA MONICA MUNI AP SEATTLE TACOMA AP","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"NOAA Weather Station Data — stations","text":"","code":"stations"},{"path":[]},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"stations","dir":"Reference","previous_headings":"","what":"stations","title":"NOAA Weather Station Data — stations","text":"data frame 17,253 rows 12 columns: name Station Location tmin, tmax minimum maximum temperatures prcp Percepitation","code":""},{"path":"https://knicey.github.io/stglyphs/reference/stations.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"NOAA Weather Station Data — stations","text":"https://www.ncei.noaa.gov/access/search/data-search/daily-summaries","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":null,"dir":"Reference","previous_headings":"","what":"Split a string — str_split_one","title":"Split a string — str_split_one","text":"Split string","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Split a string — str_split_one","text":"","code":"str_split_one(string, pattern, n = Inf)"},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Split a string — str_split_one","text":"string character vector , , one element. pattern Pattern look . default interpretation regular expression, described vignette(\"regular-expressions\"). Use regex() finer control matching behaviour. Match fixed string (.e. comparing bytes), using fixed(). fast, approximate. Generally, matching human text, want coll() respects character matching rules specified locale. Match character, word, line sentence boundaries boundary(). empty pattern, \"\", equivalent boundary(\"character\"). n Maximum number pieces return. Default (Inf) uses possible split positions. str_split(), determines maximum length element output. str_split_fixed(), determines number columns output; input short, result padded \"\".","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Split a string — str_split_one","text":"character vector.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/str_split_one.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Split a string — str_split_one","text":"","code":"x <- \"alfa,bravo,charlie,delta\" str_split_one(x, pattern = \",\") #> [1] \"alfa\" \"bravo\" \"charlie\" \"delta\" str_split_one(x, pattern = \",\", n = 2) #> [1] \"alfa\" \"bravo,charlie,delta\" y <- \"192.168.0.1\" str_split_one(y, pattern = stringr::fixed(\".\")) #> [1] \"192\" \"168\" \"0\" \"1\""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a glyph map — st_glyph","title":"Create a glyph map — st_glyph","text":"Create glyph map","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a glyph map — st_glyph","text":"","code":"st_glyph(data)"},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a glyph map — st_glyph","text":"data Default dataset use plot. already data.frame, converted one fortify(). specified, must supplied layer added plot. string dataframe fields: name, month, avgmin, avgmax.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a glyph map — st_glyph","text":"ggplot object.","code":""},{"path":"https://knicey.github.io/stglyphs/reference/st_glyph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a glyph map — st_glyph","text":"","code":"data <- tribble( ~name, ~month, ~avgmin, ~avgmax, \"A\", 1, 0.5, 1.5, \"A\", 2, 0.6, 1.6, \"A\", 3, 0.7, 1.7, ) #> Error in tribble(~name, ~month, ~avgmin, ~avgmax, \"A\", 1, 0.5, 1.5, \"A\", 2, 0.6, 1.6, \"A\", 3, 0.7, 1.7, ): could not find function \"tribble\" st_glyph(data) #> Error in ggplot2::ggplot(data): `data` cannot be a function. #> ℹ Have you misspelled the `data` argument in `ggplot()`"}]
diff --git a/man/figures/README-unnamed-chunk-2-1.png b/man/figures/README-unnamed-chunk-2-1.png
new file mode 100644
index 0000000..0b8cc39
Binary files /dev/null and b/man/figures/README-unnamed-chunk-2-1.png differ
diff --git a/man/figures/README-unnamed-chunk-4-1.png b/man/figures/README-unnamed-chunk-4-1.png
new file mode 100644
index 0000000..fd60c8c
Binary files /dev/null and b/man/figures/README-unnamed-chunk-4-1.png differ
diff --git a/vignettes/GeomSegmentGlyph.Rmd b/vignettes/GeomSegmentGlyph.Rmd
index 562c3b6..bbeb472 100644
--- a/vignettes/GeomSegmentGlyph.Rmd
+++ b/vignettes/GeomSegmentGlyph.Rmd
@@ -85,14 +85,14 @@ ggplot(data = grouped) +
Furthermore, there are options for y-scaling that include centering the glyph vertically on the station location.
-```{r}
+```{r, echo = FALSE}
ggplot(data = grouped) +
geom_sf(data = mainland_us, color = "white") +
ggthemes::theme_map() +
geom_point(aes(x = long, y = lat)) +
geom_segment_glyph(
x_scale = rescale11x,
- y_scale = rescale01y,
+ y_scale = rescale11y,
width = 2,
height = 3,
aes(
@@ -106,7 +106,8 @@ ggplot(data = grouped) +
These rescaling past examples have all been made with global rescaling enabled (default) which results in the glyphs being differently sized according to their values relative to each other. Turning off global rescaling allows all glpyhs to rescale within their own individual values and produce glyphs that sized more evenly.
-```{r}
+```{r, warning=FALSE}
+
ggplot(data = grouped) +
geom_sf(data = mainland_us, color = "white") +
ggthemes::theme_map() +