Skip to content

Commit

Permalink
package list
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreutzmann committed Mar 19, 2018
1 parent 62e8a89 commit 559584a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 37 deletions.
Binary file added Spielplatz/Packages.RData
Binary file not shown.
8 changes: 4 additions & 4 deletions Spielplatz/compare_sae.R
Expand Up @@ -14,7 +14,7 @@ data(eusilcA_pop)
# Define Head Count Ratio (HCR) for the ebBHF function corresponding to HCR in
# emdi
povertyincidence <- function(y) {
result <- mean(y < 11161.44)
result <- mean(y < 10885.33)
return(result)
}

Expand All @@ -28,14 +28,14 @@ rownames(Xoutsamp_AuxVar) <- NULL
# Get EBP estimates using ebBHF function
set.seed(123)
EB <- ebBHF(eqIncome ~ cash, dom = district,
selectdom = provincelabels, Xnonsample = Xoutsamp_AuxVar, MC = 5000,
selectdom = provincelabels, Xnonsample = Xoutsamp_AuxVar, MC = 50000,
constant = 0, indicator = povertyincidence, data = eusilcA_smp)

# Get EBP estimates using ebp function
EBP <- ebp(eqIncome ~ cash, pop_data = eusilcA_pop, pop_domains = "district",
smp_data = eusilcA_smp, smp_domains = "district", transformation = "log",
threshold = 11161.44, seed = 123,
L = 5000)
threshold = 10885.33, seed = 123,
L = 50000)



Expand Down
51 changes: 18 additions & 33 deletions Spielplatz/update_packages.R
Expand Up @@ -20,59 +20,44 @@ install.packages("readODS", lib = .libPaths()[1])
devtools::install_github("soerenpannier/emdi")
#install.packages("emdi")
library(emdi)
library(xtable)

# The ggplot2 package is loaded additionally since we use theme_set for a better
# representation of the plots in the paper but it is otherwise not needed to
# load the package manually.
library(ggplot2)
# The laeken package is loaded since we estimate the poverty line in the
# application with the weightedMedian function from this package.
library(laeken)

installed.packages()

View(installed.packages(lib = .libPaths()[1]))
View(installed.packages(lib = .libPaths()[2]))

used_packages <- installed.packages(lib = .libPaths()[1])

used_packages_adj <- used_packages[, c("Package", "Version")]
rownames(used_packages_adj) <- NULL


library("xtable", lib = "C:/R-3.4.3/libBackup")
tex_packages <- xtable(used_packages_adj)
print(tex_packages, include.rownames = FALSE)

# Packages in Spielplatz/RepLib
used_packages <- installed.packages(lib = .libPaths()[1])
used_packages <- used_packages[, c("Package", "Version")]
rownames(used_packages) <- NULL

# Get latex table for packages in Spielplatz/RepLib
# Split table
used_packages_adj_split <- as.data.frame(used_packages_adj)

used_packages_split <- as.data.frame(used_packages)
used_packages_split <- data.frame(used_packages_split[1:40,],
used_packages_split[41:80,])

used_packages_adj_split <- data.frame(used_packages_adj_split[1:40,],
used_packages_adj_split[41:80,])



tex_packages_split <- xtable(used_packages_adj_split)
tex_packages_split <- xtable(used_packages_split)
print(tex_packages_split, include.rownames = FALSE)


# Abgleich packages
used_packages2 <- installed.packages(lib = .libPaths()[2])
used_packages2_adj_split <- as.data.frame(used_packages2)
dim(used_packages2_adj_split)
# Packages in C:/R-3.4.3/library
all_packages <- installed.packages(lib = .libPaths()[2])
all_packages <- as.data.frame(all_packages)
dim(all_packages)

used_packages2_adj_split <- used_packages2_adj_split[, c("Package", "Version")]
all_packages <- all_packages[, c("Package", "Version")]


compare_lib <- merge(used_packages2_adj_split, as.data.frame(used_packages_adj), by = "Package" ,
all = FALSE)
# Compare the versions of packages in Spielplatz/RepLib and C:/R-3.4.3/library
compare_lib <- merge(all_packages, used_packages, by = "Package", all = FALSE)

all.equal(as.character(compare_lib$Version.x), as.character(compare_lib$Version.y))

compare_lib$Version.x[as.character(compare_lib$Version.x) != as.character(compare_lib$Version.y)]



save("all_packages", "used_packages", file = "./Spielplatz/Packages.RData")

0 comments on commit 559584a

Please sign in to comment.