0
votes

I'm trying to load the dataset life.expectancy.1971 , but seem to have trouble loading it. I'm inputting

data(life.expectancy.1971)
life.expectancy.1971

and keep getting the following error:

data set �life.expectancy.1971� not foundError: object 'life.expectancy.1971' not found.

I'm still pretty new to R so it could be a simple error on my part, but I haven't been able to figure out what's wrong since that has worked for loading other datasets. Can anyone help me figure out what I'm missing?

1
Have you installed the package cluster.datasets and load it? For me, it is working correctly after loading the package. library(cluster.datasets); data(life.expectancy.1971); life.expectancy.1971# country year m0 m25 m50 m75 f0 f25 f50 f75 1 Algeria 1965 63 51 30 13 67 54 34 15akrun
Jesus, yeah it really was that simple. I completely overlooked installing cluster.datasets first. Thanks!Joe C.

1 Answers

2
votes

Pasting the answers from the comments to an answer so that the question can be closed.

Install the package and its dependencies

install.packages(c("cluster.datasets"), dependencies = TRUE)

load

library(cluster.datasets)

load the dataset life.expectancy.1971,

data(life.expectancy.1971)

look at the dataset life.expectancy.1971,

life.expectancy.1971
#>                    country year m0 m25 m50 m75 f0 f25 f50 f75
#> 1                  Algeria 1965 63  51  30  13 67  54  34  15
#> 2                 Cameroon 1964 34  29  13   5 38  32  17   6
#> 3               Madagascar 1966 38  30  17   7 38  34  20   7
#> 4                Mauritius 1966 59  42  20   6 64  46  25   8
#> 5                  Reunion 1963 56  38  18   7 62  46  25  10
#> 6               Seychelles 1960 62  44  24   7 69  50  28  14
#> 7  South Africa (Nonwhite) 1961 50  39  20   7 55  43  23   8
#> 8     South Africa (White) 1961 65  44  22   7 72  50  27   9
#> 9                  Tunisia 1960 56  46  24  11 63  54  33  19
#> 10                  Canada 1966 69  47  24   8 75  53  29  10
#> 11              Costa Rica 1966 65  48  26   9 68  50  27  10
#> 12      Dominican Republic 1966 64  50  28  11 66  51  29  11
#> 13             El Salvador 1961 56  44  25  10 61  48  27  12
#> 14               Greenland 1960 60  44  22   6 65  45  25   9
#> 15                 Grenada 1961 61  45  22   8 65  49  27  10
#> 16               Guatemala 1964 49  40  22   9 51  41  23   8
#> 17                Honduras 1966 59  42  22   6 61  43  22   7
#> 18                 Jamaica 1963 63  44  23   8 67  48  26   9
#> 19                  Mexico 1966 59  44  24   8 63  46  25   8
#> 20               Nicaragua 1965 65  48  28  14 68  51  29  13
#> 21                  Panama 1966 65  48  26   9 67  49  27  10
#> 22                Trinidad 1962 64  43  21   7 68  47  25   9
#> 23                Trinidad 1967 64  43  21   6 68  47  24   8
#> 24                      US 1966 67  45  23   8 74  51  28  10
#> 25           US (Nonwhite) 1966 61  40  21  10 67  46  25  11
#> 26              US (White) 1966 68  46  23   8 75  52  29  10
#> 27                      US 1967 67  45  23   8 74  51  28  10
#> 28               Argentina 1964 65  46  24   9 71  51  28  10
#> 29                   Chile 1967 59  43  23  10 66  49  27  12
#> 30                Columbia 1965 58  44  24   9 62  47  25  10
#> 31                 Ecuador 1965 57  46  25   9 60  49  28  11