Tag: readLines()

Example 8.35: Grab true (not pseudo) random numbers; passing API URLs to functions or macros

Usually, we’re content to use a pseudo-random number generator. But sometimes we may want numbers that are actually random– an example might be for randomizing treatment status in a randomized controlled trial.The site Random.org provides truly rando…

Example 8.27: using regular expressions to read data with variable number of words in a field

A more or less anonymous reader commented on our last post, where we were reading data from a file with a varying number of fields. The format of the file was:1 Las Vegas, NV — 53.3 — — 12 Sacramento, CA — 42.3 — — 2The complication in the…