#If you are using R here’s how to get the data you want quickly loaded:
install.packages("jsonlite", repos="https://cran.rstudio.com/")
## Installing package into 'C:/Users/Sileshi Boru/OneDrive/Documents/R/win-library/4.1'
## (as 'lib' is unspecified)
## package 'jsonlite' successfully unpacked and MD5 sums checked
## Warning: cannot remove prior installation of package 'jsonlite'
## Warning in file.copy(savedcopy, lib, recursive = TRUE):
## problem copying C:\Users\Sileshi Boru\OneDrive\Documents\R\win-
## library\4.1\00LOCK\jsonlite\libs\x64\jsonlite.dll to C:\Users\Sileshi
## Boru\OneDrive\Documents\R\win-library\4.1\jsonlite\libs\x64\jsonlite.dll:
## Permission denied
## Warning: restored 'jsonlite'
##
## The downloaded binary packages are in
## C:\Users\Sileshi Boru\AppData\Local\Temp\RtmpCoMCII\downloaded_packages
library("jsonlite")
## Warning: package 'jsonlite' was built under R version 4.1.3
json_file <- 'https://datahub.io/core/employment-us/datapackage.json'
json_data <- fromJSON(paste(readLines(json_file), collapse=""))
## Warning in readLines(json_file): incomplete final line found on 'https://
## datahub.io/core/employment-us/datapackage.json'
#print(json_data)
# get list of all resources:
print(json_data$resources$name)
## [1] "validation_report" "aat1_csv" "aat1_json"
## [4] "employment-us_zip" "aat1"
# print all tabular data(if exists any)
for(i in 1:length(json_data$resources$datahub$type)){
if(json_data$resources$datahub$type[i]=='derived/csv'){
path_to_file = json_data$resources$path[i]
data <- read.csv(url(path_to_file))
print(data)
}
}
## year population labor_force population_percent employed_total
## 1 1941 99900 55910 56.0 50350
## 2 1942 98640 56410 57.2 53750
## 3 1943 94640 55540 58.7 54470
## 4 1944 93220 54630 58.6 53960
## 5 1945 94090 53860 57.2 52820
## 6 1946 103070 57520 55.8 55250
## 7 1947 106018 60168 56.8 57812
## 8 1947 101827 59350 58.3 57038
## 9 1948 103068 60621 58.8 58343
## 10 1949 103994 61286 58.9 57651
## 11 1950 104995 62208 59.2 58918
## 12 1951 104621 62017 59.2 59961
## 13 1952 105231 62138 59.0 60250
## 14 1953 107056 63015 58.9 61179
## 15 1954 108321 63643 58.8 60109
## 16 1955 109683 65023 59.3 62170
## 17 1956 110954 66552 60.0 63799
## 18 1957 112265 66929 59.6 64071
## 19 1958 113727 67639 59.5 63036
## 20 1959 115329 68369 59.3 64630
## 21 1960 117245 69628 59.4 65778
## 22 1961 118771 70459 59.3 65746
## 23 1962 120153 70614 58.8 66702
## 24 1963 122416 71833 58.7 67762
## 25 1964 124485 73091 58.7 69305
## 26 1965 126513 74455 58.9 71088
## 27 1966 128058 75770 59.2 72895
## 28 1967 129874 77347 59.6 74372
## 29 1968 132028 78737 59.6 75920
## 30 1969 134335 80734 60.1 77902
## 31 1970 137085 82771 60.4 78678
## 32 1971 140216 84382 60.2 79367
## 33 1972 144126 87034 60.4 82153
## 34 1973 147096 89429 60.8 85064
## 35 1974 150120 91949 61.3 86794
## 36 1975 153153 93774 61.2 85846
## 37 1976 156150 96158 61.6 88752
## 38 1977 159033 99008 62.3 92017
## 39 1978 161910 102250 63.2 96048
## 40 1979 164863 104962 63.7 98824
## 41 1980 167745 106940 63.8 99302
## 42 1981 170130 108670 63.9 100397
## 43 1982 172271 110204 64.0 99526
## 44 1983 174215 111550 64.0 100834
## 45 1984 176383 113544 64.4 105005
## 46 1985 178206 115461 64.8 107150
## 47 1986 180587 117834 65.3 109597
## 48 1987 182753 119865 65.6 112440
## 49 1988 184613 121669 65.9 114968
## 50 1989 186393 123869 66.5 117342
## 51 1990 189164 125840 66.5 118793
## 52 1991 190925 126346 66.2 117718
## 53 1992 192805 128105 66.4 118492
## 54 1993 194838 129200 66.3 120259
## 55 1994 196814 131056 66.6 123060
## 56 1995 198584 132304 66.6 124900
## 57 1996 200591 133943 66.8 126708
## 58 1997 203133 136297 67.1 129558
## 59 1998 205220 137673 67.1 131463
## 60 1999 207753 139368 67.1 133488
## 61 2000 212577 142583 67.1 136891
## 62 2001 215092 143734 66.8 136933
## 63 2002 217570 144863 66.6 136485
## 64 2003 221168 146510 66.2 137736
## 65 2004 223357 147401 66.0 139252
## 66 2005 226082 149320 66.0 141730
## 67 2006 228815 151428 66.2 144427
## 68 2007 231867 153124 66.0 146047
## 69 2008 233788 154287 66.0 145362
## 70 2009 235801 154142 65.4 139877
## 71 2010 237830 153889 64.7 139064
## employed_percent agrictulture_ratio nonagriculture_ratio unemployed
## 1 50.4 9100 41250 5560
## 2 54.5 9250 44500 2660
## 3 57.6 9080 45390 1070
## 4 57.9 8950 45010 670
## 5 56.1 8580 44240 1040
## 6 53.6 8320 46930 2270
## 7 54.5 8256 49557 2356
## 8 56.0 7890 49148 2311
## 9 56.6 7629 50714 2276
## 10 55.4 7658 49993 3637
## 11 56.1 7160 51758 3288
## 12 57.3 6726 53235 2055
## 13 57.3 6500 53749 1883
## 14 57.1 6260 54919 1834
## 15 55.5 6205 53904 3532
## 16 56.7 6450 55722 2852
## 17 57.5 6283 57514 2750
## 18 57.1 5947 58123 2859
## 19 55.4 5586 57450 4602
## 20 56.0 5565 59065 3740
## 21 56.1 5458 60318 3852
## 22 55.4 5200 60546 4714
## 23 55.5 4944 61759 3911
## 24 55.4 4687 63076 4070
## 25 55.7 4523 64782 3786
## 26 56.2 4361 66726 3366
## 27 56.9 3979 68915 2875
## 28 57.3 3844 70527 2975
## 29 57.5 3817 72103 2817
## 30 58.0 3606 74296 2832
## 31 57.4 3463 75215 4093
## 32 56.6 3394 75972 5016
## 33 57.0 3484 78669 4882
## 34 57.8 3470 81594 4365
## 35 57.8 3515 83279 5156
## 36 56.1 3408 82438 7929
## 37 56.8 3331 85421 7406
## 38 57.9 3283 88734 6991
## 39 59.3 3387 92661 6202
## 40 59.9 3347 95477 6137
## 41 59.2 3364 95938 7637
## 42 59.0 3368 97030 8273
## 43 57.8 3401 96125 10678
## 44 57.9 3383 97450 10717
## 45 59.5 3321 101685 8539
## 46 60.1 3179 103971 8312
## 47 60.7 3163 106434 8237
## 48 61.5 3208 109232 7425
## 49 62.3 3169 111800 6701
## 50 63.0 3199 114142 6528
## 51 62.8 3223 115570 7047
## 52 61.7 3269 114449 8628
## 53 61.5 3247 115245 9613
## 54 61.7 3115 117144 8940
## 55 62.5 3409 119651 7996
## 56 62.9 3440 121460 7404
## 57 63.2 3443 123264 7236
## 58 63.8 3399 126159 6739
## 59 64.1 3378 128085 6210
## 60 64.3 3281 130207 5880
## 61 64.4 2464 134427 5692
## 62 63.7 2299 134635 6801
## 63 62.7 2311 134174 8378
## 64 62.3 2275 135461 8774
## 65 62.3 2232 137020 8149
## 66 62.7 2197 139532 7591
## 67 63.1 2206 142221 7001
## 68 63.0 2095 143952 7078
## 69 62.2 2168 143194 8924
## 70 59.3 2103 137775 14265
## 71 58.5 2206 136858 14825
## unemployed_percent not_in_labor footnotes
## 1 9.9 43990 NA
## 2 4.7 42230 NA
## 3 1.9 39100 NA
## 4 1.2 38590 NA
## 5 1.9 40230 NA
## 6 3.9 45550 NA
## 7 3.9 45850 NA
## 8 3.9 42477 NA
## 9 3.8 42447 NA
## 10 5.9 42708 NA
## 11 5.3 42787 NA
## 12 3.3 42604 NA
## 13 3.0 43093 NA
## 14 2.9 44041 1
## 15 5.5 44678 NA
## 16 4.4 44660 NA
## 17 4.1 44402 NA
## 18 4.3 45336 NA
## 19 6.8 46088 NA
## 20 5.5 46960 NA
## 21 5.5 47617 1
## 22 6.7 48312 NA
## 23 5.5 49539 1
## 24 5.7 50583 NA
## 25 5.2 51394 NA
## 26 4.5 52058 NA
## 27 3.8 52288 NA
## 28 3.8 52527 NA
## 29 3.6 53291 NA
## 30 3.5 53602 NA
## 31 4.9 54315 NA
## 32 5.9 55834 NA
## 33 5.6 57091 1
## 34 4.9 57667 1
## 35 5.6 58171 NA
## 36 8.5 59377 NA
## 37 7.7 59991 NA
## 38 7.1 60025 NA
## 39 6.1 59659 1
## 40 5.8 59900 NA
## 41 7.1 60806 NA
## 42 7.6 61460 NA
## 43 9.7 62067 NA
## 44 9.6 62665 NA
## 45 7.5 62839 NA
## 46 7.2 62744 NA
## 47 7.0 62752 1
## 48 6.2 62888 NA
## 49 5.5 62944 NA
## 50 5.3 62523 NA
## 51 5.6 63324 1
## 52 6.8 64578 NA
## 53 7.5 64700 NA
## 54 6.9 65638 NA
## 55 6.1 65758 1
## 56 5.6 66280 NA
## 57 5.4 66647 NA
## 58 4.9 66836 1
## 59 4.5 67547 1
## 60 4.2 68385 1
## 61 4.0 69994 1
## 62 4.7 71359 NA
## 63 5.8 72707 NA
## 64 6.0 74658 1
## 65 5.5 75956 1
## 66 5.1 76762 1
## 67 4.6 77387 1
## 68 4.6 78743 1
## 69 5.8 79501 1
## 70 9.3 81659 1
## 71 9.6 83941 1
#install.packages("ggplot2")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.1.3
#Removing non-significant columns
data$population_percent <- NULL
data$employed_percent<- NULL
data$StandardHours <- NULL
data$unemployed_percent <- NULL
data$footnotes<- NULL
ggplot(data, aes(x = year, y = population, color = population)) + geom_line()+ geom_point() + ggtitle("Data since 1941")+
xlab("Year") +
ylab("population") +
theme(plot.title = element_text(hjust = 0.5), text = element_text(family = "Times New Roman", size= 14))
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
ggplot(data, aes(x = year, y = unemployed, color = unemployed)) + geom_line()+ geom_point() + ggtitle("Data since 1941")+
xlab("Year") +
ylab("unemployed") +
theme(plot.title = element_text(hjust = 0.5), text = element_text(family = "Times New Roman", size= 16))
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family not
## found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
ggplot(data, aes(x = year, y = employed_total, color = employed_total)) + geom_line()+ geom_point() + ggtitle("Data since 1941")+
xlab("Year") +
ylab("employed_total") +
theme(plot.title = element_text(hjust = 0.5), text = element_text(family = "Times New Roman", size= 16))
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
employment_rate <-(data$employed_total/data$population)*100
ggplot(data, aes(x = year, y = employment_rate, color = employment_rate)) + geom_line()+ geom_point() + ggtitle("Data since 1941")+
xlab("Year") +
ylab("employment_rate") +
theme(plot.title = element_text(hjust = 0.5), text = element_text(family = "Times New Roman", size= 16))
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
employment_ratio <-(data$employed_total/data$labor_force)*100
ggplot(data, aes(x = year, y = employment_ratio, color = employment_ratio)) + geom_line()+ geom_point() + ggtitle("Data since 1941")+
xlab("Year") +
ylab("employment_ratio") +
theme(plot.title = element_text(hjust = 0.5), text = element_text(family = "Times New Roman", size= 16))
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
This work is only to practice for my understanding of the subject.
1:The population is increasing may be exponentially in 1940 it was less than 100000,in 2000 is more than 24000 2:unemployed work force shows it is highly volatile it varies yearly.and total employed work force is increasing with the increase of population. 3.employment rate is not more than 60% for almost 60years. 4:employment ratio is between (90-98)% respect to work force.