/
LiveStock.R
executable file
·160 lines (160 loc) · 9.62 KB
/
LiveStock.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#' @title LiveStock data from Pakistan Social and Living Standard Measures 2015
#' @name LiveStock
#' @docType data
#' @keywords datasets
#' @usage data(LiveStock)
#' @description \code{LiveStock} data from Pakistan Social and Living Standard Measures 2015.
#' @format A \code{data.table} and \code{data.frame} with 3771 observations of 116 variables.
#' \describe{
#' \item{\code{hhcode}}{Household 10 digits code.}
#' \item{\code{Province}}{Province of Pakistan}
#' \item{\code{Region}}{Region of Pakistan (Rural/Urban)}
#' \item{\code{PSU}}{primary sampling unit 8 digits code}
#' \item{\code{S7bc1.151}}{Cattle's present value (Rs.)}
#' \item{\code{S7bc2.151}}{Cattle's last year value (Rs.)}
#' \item{\code{S7bc3.151}}{Cattle's value sold in last year (Rs.)}
#' \item{\code{S7bc4.151}}{Cattle's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.151}}{Cattle's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.151}}{Given away/lost cattle's value (Rs.)}
#' \item{\code{S7bc1.152}}{Buffalo's present value (Rs.)}
#' \item{\code{S7bc2.152}}{Buffalo's last year value (Rs.)}
#' \item{\code{S7bc3.152}}{Buffalo's value sold in last year (Rs.)}
#' \item{\code{S7bc4.152}}{Buffalo's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.152}}{Buffalo's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.152}}{Given away/lost Buffalo's value (Rs.)}
#' \item{\code{S7bc1.153}}{Camel's present value (Rs.)}
#' \item{\code{S7bc2.153}}{Camel's last year value (Rs.)}
#' \item{\code{S7bc3.153}}{Camel's value sold in last year (Rs.)}
#' \item{\code{S7bc4.153}}{Camel's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.153}}{Camel's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.153}}{Given away/lost camel's value (Rs.)}
#' \item{\code{S7bc1.154}}{Sheep's present value (Rs.)}
#' \item{\code{S7bc2.154}}{Sheep's last year value (Rs.)}
#' \item{\code{S7bc3.154}}{Sheep's value sold in last year (Rs.)}
#' \item{\code{S7bc4.154}}{Sheep's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.154}}{Sheep's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.154}}{Given away/lost sheep's value (Rs.)}
#' \item{\code{S7bc1.155}}{Goat's present value (Rs.)}
#' \item{\code{S7bc2.155}}{Goat's last year value (Rs.)}
#' \item{\code{S7bc3.155}}{Goat's value sold in last year (Rs.)}
#' \item{\code{S7bc4.155}}{Goat's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.155}}{Goat's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.155}}{Given away/lost goat's value (Rs.)}
#' \item{\code{S7bc1.156}}{Horse's present value (Rs.)}
#' \item{\code{S7bc2.156}}{Horse's last year value (Rs.)}
#' \item{\code{S7bc3.156}}{Horse's value sold in last year (Rs.)}
#' \item{\code{S7bc4.156}}{Horse's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.156}}{Horse's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.156}}{Given away/lost horse's value (Rs.)}
#' \item{\code{S7bc1.157}}{Asse's present value (Rs.)}
#' \item{\code{S7bc2.157}}{Asse's last year value (Rs.)}
#' \item{\code{S7bc3.157}}{Asse's value sold in last year (Rs.)}
#' \item{\code{S7bc4.157}}{Asse's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.157}}{Asse's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.157}}{Given away/lost asse's value (Rs.)}
#' \item{\code{S7bc1.158}}{Mule's present value (Rs.)}
#' \item{\code{S7bc2.158}}{Mule's last year value (Rs.)}
#' \item{\code{S7bc3.158}}{Mule's value sold in last year (Rs.)}
#' \item{\code{S7bc4.158}}{Mule's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.158}}{Mule's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.158}}{Given away/lost mule's value (Rs.)}
#' \item{\code{S7bc1.159}}{Poultry's present value (Rs.)}
#' \item{\code{S7bc2.159}}{Poultry's last year value (Rs.)}
#' \item{\code{S7bc3.159}}{Poultry's value sold in last year (Rs.)}
#' \item{\code{S7bc4.159}}{Poultry's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.159}}{Poultry's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.159}}{Given away/lost poultry's value (Rs.)}
#' \item{\code{S7bc1.160}}{Other animal's present value (Rs.)}
#' \item{\code{S7bc2.160}}{Other animal's last year value (Rs.)}
#' \item{\code{S7bc3.160}}{Other animal's value sold in last year (Rs.)}
#' \item{\code{S7bc4.160}}{Other animal's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.160}}{Other animal's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.160}}{Given away/lost other animal's value (Rs.)}
#' \item{\code{S7bc1.165}}{Total animal's present value (Rs.)}
#' \item{\code{S7bc2.165}}{Total animal's last year value (Rs.)}
#' \item{\code{S7bc3.165}}{Total animal's value sold in last year (Rs.)}
#' \item{\code{S7bc4.165}}{Total animal's value received as gift/inheritance (Rs.)}
#' \item{\code{S7bc5.165}}{Total animal's paiment, purchased in last year (Rs.)}
#' \item{\code{S7bc6.165}}{Total given out/lost animal's value (Rs.)}
#' \item{\code{S7bc1.166}}{Monthly value of eggs produced (Rs.)}
#' \item{\code{S7bc2.166}}{No. of months eggs produced (Rs.)}
#' \item{\code{S7bc3.166}}{Total value of eggs produced (Rs.)}
#' \item{\code{S7bc1.167}}{Monthly value of milk produced (Rs.)}
#' \item{\code{S7bc2.167}}{No. of months milk produced (Rs.)}
#' \item{\code{S7bc3.167}}{Total value of milk produced (Rs.)}
#' \item{\code{S7bc1.168}}{Monthly value of milk products produced (Rs.)}
#' \item{\code{S7bc2.168}}{No. of months milk products produced (Rs.)}
#' \item{\code{S7bc3.168}}{Total value of milk products produced (Rs.)}
#' \item{\code{S7bc3.169}}{Total value of honey produced (Rs.)}
#' \item{\code{S7bc3.170}}{Total value of forset products produced (Rs.)}
#' \item{\code{S7bc3.171}}{Total value of fish catches (Rs.)}
#' \item{\code{S7bc3.172}}{Total value of dung cakes produced (Rs.)}
#' \item{\code{S7bc3.173}}{Total value of wool produced (Rs.)}
#' \item{\code{S7bc3.174}}{Total value of other items produced (Rs.)}
#' \item{\code{S7bc3.175}}{Total value of all other items produced (Rs.)}
#' \item{\code{S7bc3.180}}{Total value of all items produced (Rs.)}
#' \item{\code{S7bc1.181}}{Fodder green purchased (Rs.)}
#' \item{\code{S7bc2.181}}{Fodder green own produced and consumed (Rs.)}
#' \item{\code{S7bc1.182}}{Fodder dry purchased (Rs.)}
#' \item{\code{S7bc2.182}}{Fodder dry own produced and consumed (Rs.)}
#' \item{\code{S7bc1.183}}{Grazing purchased (Rs.)}
#' \item{\code{S7bc2.183}}{Grazing own produced and consumed (Rs.)}
#' \item{\code{S7bc1.184}}{Oil cakes/seed purchased (Rs.)}
#' \item{\code{S7bc2.184}}{Oil cakes/seed own produced and consumed (Rs.)}
#' \item{\code{S7bc1.185}}{Poultry feed purchased (Rs.)}
#' \item{\code{S7bc2.185}}{Poultry feed own produced and consumed (Rs.)}
#' \item{\code{S7bc1.186}}{fishing purchased (Rs.)}
#' \item{\code{S7bc2.186}}{fishing own produced and consumed (Rs.)}
#' \item{\code{S7bc1.187}}{Medicines purchased (Rs.)}
#' \item{\code{S7bc2.187}}{Medicines own produced and consumed (Rs.)}
#' \item{\code{S7bc1.188}}{Veterinary charges (Rs.)}
#' \item{\code{S7bc2.188}}{Veterinary own services charges (Rs.)}
#' \item{\code{S7bc1.189}}{Labour charges (Rs.)}
#' \item{\code{S7bc2.189}}{Own labour services charges (Rs.)}
#' \item{\code{S7bc1.190}}{All other items purchased (Rs.)}
#' \item{\code{S7bc2.190}}{All other items own produced and consumed (Rs.)}
#' \item{\code{S7bc1.195}}{Total items purchased (Rs.)}
#' \item{\code{S7bc2.195}}{Total items own produced and consumed (Rs.)}
#' \item{\code{S7bc1.196}}{Rent out agricultural equipment status}
#' \item{\code{S7bc1.197}}{Rent received in an year (Rs.)}
#' \item{\code{S7bc1.198}}{Sold agricultural equipment value (Rs.)}
#' \item{\code{S7bc2.198}}{Value of agricultural equipment received as gift/inheritance (Rs.)}
#' \item{\code{S7bc3.198}}{Paiment of purchased agricultural equipment (Rs.)}
#' \item{\code{S7bc4.198}}{Value of agricultural equipment given away/lost (Rs.)}
#' }
#' @author \enumerate{
#' \item Muhammad Yaseen (\email{myaseen208@gmail.com})
#' \item Muhammad Arfan Dilber (\email{pbsfsd041@gmail.com})
#' }
#' @references \enumerate{
#' \item Pakistan Bureau of Statistics, Micro data (\url{http://www.pbs.gov.pk/content/microdata}).
#' }
#'
#' @seealso
#' \code{\link{Employment}}
#' , \code{\link{Education}}
#' , \code{\link{Expenditure}}
#' , \code{\link{HHRoster}}
#' , \code{\link{Housing}}
#' , \code{\link{ICT}}
#' , \code{\link{Agriculture}}
#'
#' @importFrom magrittr %>%
#' @importFrom dplyr group_by summarise
#' @importFrom ggplot2 ggplot
#'
#'
#' @examples
#' # library(PSLM2015)
#' # data("LiveStock")
#' # library(dplyr)
#' # TotalValue <- LiveStock %>%
#' # group_by(Province, Region) %>%
#' # summarise(TotalValue = sum(S7bc3.165, na.rm = TRUE))
#' #
#' # library(ggplot2)
#' # ggplot(data = TotalValue, mapping = aes(x = Province, y = TotalValue)) +
#' # geom_col() +
#' # labs(y = "Total Value of Owned Animals") +
#' # facet_grid(. ~ Region)
NULL