How do I extract an analysis dataset in R so that I can describe the data extraction process
Maybe others will understand your question better than I do.
What do you mean by "extract an analysis data set"? In what kind of object is the data set stored and into what do you want to move it?
Do you mean something like this?
DT <- structure(list(census = c(1900L, 1910L, 1920L, 1930L, 1940L,
1950L, 1960L, 1970L, 1980L, 1990L, 2000L, 2010L, 2020L), pop = c(368L,
1407L, 2408L, 2130L, 2027L, 2136L, 2861L, 3075L, 3081L, 3351L,
2972L, 2825L, 2477L)), class = "data.frame", row.names = c(NA,
-13L))
ct <- with(DT,cor.test(census, pop))
str(ct)
ct[1]
ct[2]