Description Usage Arguments Details Value Author(s) References Examples
This function calculates the desirable dietary pattern (DDP).
1 |
data |
A data set of (n x 218) (see Details). |
wilayah |
An origin of the responden residence. (see Details). |
baseline |
A baseline value of personal calory required. |
The data set is an n x 218 data frame. The first column is
the name of the respondent. wilayah
argument has "Indonesia" as the
default, meaning that the DPP are calculated based on the national (Indonesia)
baseline. The other possible inputs for wilayah
are "Aceh", "Sumut",
"Sumbar", "Riau", "KepRiau", "Jambi", "Sumsel", "Babel", "Bengkulu",
"Lampung", "Jakarta", "Jabar", "Banten", "Jateng", "DIY", "Jatim", "Bali",
"NTB", "NTT", "Kalbar", "Kalteng", "Kalsel", "Kaltim", "Kalut", "Sulut",
"Sulteng", "Sultra", "Sulsel", "Gorontalo", "Sulbar", "Maluku", "Malut",
"Papua", "Papbar". For baseline
argument, it is 2000 as the default
value because the minimal calory required in Indonesia is 2000 calory.
Function returns a vector with n length indicates the index/ indices of the DDP per peson.
Weksi Budiaji
Contact: budiaji@untirta.ac.id
BKP, Kementan. 2017. Aplikasi Harmonisasi Analisis PPH Data Susenas 2017. Badan Ketahanan Pangan Kementrian Pertanian.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #data simulation of 10 person
set.seed(2020)
n <- 10
matsim <- matrix(0, n, 218)
datsim <- as.data.frame(matsim)
datsim$V1 <- LETTERS[1:n]
#calory for boiled rice
datsim$V2 <- rnorm(n, 200, 50)
#calory for boiled egg
datsim$V73 <- rnorm(n, 60, 5)
#calory for fresh milk
datsim$V79 <- rnorm(n, 100, 10)
#calory for tomato
datsim$V93 <- rnorm(n, 19, 2)
#caloty for pineapple
datsim$V134 <- rnorm(n, 20, 2)
skorpph(datsim)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.