Example of the use of the name keyword

Table of Contents

1. Inserting the results of a code block

## install.packages("dplyr")
library(dplyr)
airquality |>
  arrange (desc(Ozone)) |>
  head(n = 5)

R has a number of built-in datasets to work with, one of them is airquality which reports daily air quality measurements in New York, from May to September 1973. Variables measured include

  • Ozone: Mean ozone in parts per billion (ppb)
  • Solar.R: Solar radiation in Langleys (lang)
  • Wind: Average wind speed in miles per hour (mph)
  • Temp: Maximum daily temperature in degrees Fahrenheit (degrees F)
  • Month: Month (1-12)
  • Day: Day of month (5-9)

    The code above loads the dyplyr library and then works to select the top 5 days with the highest concentration of Ozone recorded in this period (This was done to reduce the number of rows , 153, in the unprocessed dataset). The results are shown below.

Table 1: airquality dataset
Ozone Solar.R Wind Temp Month Day
168 238 3.4 81 8 25
135 269 4.1 84 7 1
122 255 4 89 8 7
118 225 2.3 94 8 29
115 223 5.7 79 5 30

Note that these were inserted by calling the above code with the org-mode keyword #+RESULTS: AirQuality where AirQuality is the name given to the code block. As for the number of rows described above it was inserted using in-line code src_R{nrow(airquality)}.

Date: July 2025

Author: Saul SL

Created: 2025-07-24 Thu 16:42

Validate