2 ms·
The variables are for use in the novels themselves. Mostly for aspects that won't change often: names, places, invented nouns, nick-names, character tics, vehic
by thangalin 5y ago
The variables are for use in the novels themselves. Mostly for aspects that won't change often: names, places, invented nouns, nick-names, character tics, vehicle velocities, dates (relative or otherwise), and so on. One of my favourite uses of R and variables is this piece of dialogue:
> Plus, we'll be about `r#cms(round.up(travel.time( v$location$protagonist$latitude$value, v$location$protagonist$longitude$value, v$location$proximal$latitude$value, v$location$proximal$longitude$value, v$location$proximal$travel$speed$value )))` minutes to the `r#x( v$location$proximal$name$short )` by `r#x( v$location$proximal$travel$mode )`
The preview panel shows:
> Plus, we'll be about thirty-five minutes to the redwoods by maglev.
This allows me to change the locations' latitude and longitude and not have to remember where that particular blurb was written: the travel time will be recomputed and the resulting number rewritten according to the Chicago Manual of Style (cms) rules. (What's more, the travel time is first computed by a REST call to a map API to get the distance by vehicle; failing that, it performs a Haversine distance calculation.)