Why won't "fdeaths/mdeaths" datasets load?

Was just trying to work my way through the new (very promising) fable package, and wanted to reproduce the example here, that uses monthly UK lung deaths. The "tsibbledata" package shown in the linked page doesn't seem to exist, but the "datasets" package has datasets called "fdeaths" and "mdeaths" that I thought I could use instead. What could be simpler?

I have loaded the datasets package, and when I run data(), both show up in the list. Yet, if I try to load them, e.g., "data(fdeaths)" plus literally every possible variation on that I can think of, I get an error:

data(fdeaths) 
Warning message: In data(fdeaths) : data set ‘fdeaths’ not found

Whyeeeeee? I'm baffled. I know I could just move on and pick from many other time series datasets, but I have to figure it out.

Sorry in advance for whichever of the question-asking infractions I've committed. Happy to amend in any way that will be productive, but I really didn't think this needed actual code or a reprex. Imagine every possible way you would try to load that dataset, and I've probably tried it and gotten the exact same error.

Thanks!

Try loading data from base datasets.

datasets::fdeaths
#>       Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
#> 1974  901  689  827  677  522  406  441  393  387  582  578  666
#> 1975  830  752  785  664  467  438  421  412  343  440  531  771
#> 1976  767 1141  896  532  447  420  376  330  357  445  546  764
#> 1977  862  660  663  643  502  392  411  348  387  385  411  638
#> 1978  796  853  737  546  530  446  431  362  387  430  425  679
#> 1979  821  785  727  612  478  429  405  379  393  411  487  574
datasets::mdeaths
#>       Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
#> 1974 2134 1863 1877 1877 1492 1249 1280 1131 1209 1492 1621 1846
#> 1975 2103 2137 2153 1833 1403 1288 1186 1133 1053 1347 1545 2066
#> 1976 2020 2750 2283 1479 1189 1160 1113  970  999 1208 1467 2059
#> 1977 2240 1634 1722 1801 1246 1162 1087 1013  959 1179 1229 1655
#> 1978 2019 2284 1942 1423 1340 1187 1098 1004  970 1140 1110 1812
#> 1979 2263 1820 1846 1531 1215 1075 1056  975  940 1081 1294 1341

Created on 2018-12-28 by the reprex package (v0.2.1)

1 Like

Thanks! I found it also works to do data(UKLungDeaths), but I still don't understand why that doesn't autocomplete like all other datasets. I had tried it, but waved off when it didn't show up. Weird, but I'm sure there's a reason.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.