Commit 2f1bee08 authored by Knut Wenzig's avatar Knut Wenzig
Browse files

back-to-office

parent 8b76a545
......@@ -32,6 +32,7 @@
\definecolor{DIWanthrazit}{cmyk}{0.5,0.1,0,0.45}
\definecolor{DIWdunkelrot2}{cmyk}{0.4,0.9,0.6,0}
\definecolor{SOEPtitlered}{cmyk}{0.12,0,0,0.17}
\definecolor{SOEPhellblau}{cmyk}{.7,0,0,0}
\usepackage{xspace}
\usepackage{graphicx}
......@@ -178,12 +179,13 @@ LetterSpace = -5.0]{ScalaPro-}
\usepackage{floatrow}
\floatsetup[longtable]{font=sf}
\newcommand{\SPnumber}[1]{\rmfamily\bfseries\fontsize{123}{123}\selectfont\textcolor{DIWanthrazit}{#1}}
\newcommand{\SPseries}[1]{\sffamily\bfseries\fontsize{30}{30}\selectfont\textcolor{DIWanthrazit}{#1}}
\newcommand{\SPseriesname}[1]{\sffamily\bfseries\fontsize{15}{15}\selectfont\textcolor{DIWanthrazit}{#1}}
\newcommand{\SPnumber}[1]{\rmfamily\bfseries\fontsize{123}{123}\addfontfeatures{LetterSpace=-4}\selectfont\textcolor{DIWdunkelblau}{#1}}
\newcommand{\SPyear}[1]{\sffamily\bfseries\fontsize{21}{21}\selectfont\textcolor{DIWdunkelblau}{#1}}
\newcommand{\SPseries}[1]{\sffamily\bfseries\fontsize{30}{30}\selectfont\textcolor{SOEPhellblau}{#1}}
\newcommand{\SPseriesname}[1]{\sffamily\bfseries\fontsize{15}{15}\selectfont\textcolor{SOEPhellblau}{#1}}
\newcommand{\SPsoepline}[1]{\sffamily\bfseries\fontsize{8}{8}\selectfont\textcolor{DIWanthrazit}{#1}}
\newcommand{\SPtitle}[1]{\sffamily\bfseries\fontsize{32}{32}\selectfont\textcolor{DIWdunkelrot2}{#1}}
\newcommand{\SPauthor}[1]{\sffamily\bfseries\fontsize{11}{11}\selectfont\textcolor{DIWanthrazit}{#1}}
\newcommand{\SPauthor}[1]{\sffamily\fontsize{11}{11}\selectfont\textcolor{DIWanthrazit}{#1}}
%\defaultfontfeatures{Mapping=tex-text, Numbers=Lining, Ligatures=NoCommon} % http://www.mrunix.de/forums/showpost.php?p=291333&postcount=9
%
......@@ -232,21 +234,16 @@ LetterSpace = -5.0]{ScalaPro-}
\BookmarkAtEnd {\bookmark[uri={http://www.diw.de/soepsurveypapers},level=0,color=blue]{SOEP Survey Papers}}
\begin{titlepage}
%\ThisLRCornerWallPaper{1}{titel_mit_beispieltext.pdf}
\ThisLRCornerWallPaper{1}{titel_blanco.pdf}
\ThisLRCornerWallPaper{1}{Vorlage_KnW_2021.pdf}
%\XeTeXinterchartokenstate=1%
\begin{textblock*}{80cm}(130mm,38mm)
\SPnumber{\StrSubstitute{\paperno}{1}{\XeTeXglyph466{}}}
% Number+year
\begin{textblock*}{10cm}(96mm,30mm)
\raggedleft\SPnumber{\strut\StrSubstitute{\paperno}{1}{\XeTeXglyph466{}}}\raisebox{2mm}{\rotatebox{90}{\SPyear{\paperyear}}}
\end{textblock*}%\XeTeXinterchartokenstate=0
\begin{textblock*}{20cm}(20mm,77mm)
\SPseries{\paperseries}
\end{textblock*}
\begin{textblock*}{20cm}(20mm,89mm)
\SPseriesname{\paperseriesname}
\end{textblock*}
\begin{textblock*}{17.5cm}(20mm,190mm)
\SPsoepline{SOEP --- The German Socio-Economic Panel study at DIW Berlin \hfill \paperyear}
\end{textblock*}
\begin{textblock*}{\TitleWidthOnCover}(20mm,203mm)
\begin{textblock*}{\TitleWidthOnCover}(20.5mm,200.0mm)
\SPtitle{\papertitle}
\end{textblock*}
\begin{textblock*}{18cm}(20mm,258mm)
......@@ -287,13 +284,13 @@ Dr. Jan Goebel, DIW Berlin
Prof. Dr. Stefan Liebig, DIW Berlin and Freie Universität Berlin
Dr. David Richter, DIW Berlin
Prof. Dr. David Richter, DIW Berlin and Freie Universität Berlin
Prof. Dr. Carsten Schröder, DIW Berlin and Freie Universität Berlin
Prof. Dr. Jürgen Schupp, DIW Berlin and Freie Universität Berlin
Dr. Sabine Zinn, DIW Berlin
Prof. Dr. Sabine Zinn, DIW Berlin and Humboldt-Universität zu Berlin
\vspace{2\baselineskip}
......
......@@ -49,8 +49,10 @@ codebookcsvpath <- "~/DIW/SOEP/git/dortools/documeta/datasets/studies/"
codebookcsvpath <- "~/DIW/SOEP/git/dortools/documeta/datasets/questions/"
codebookcsvpath <- "~/DIW/SOEP/git/dortools/documeta/datasets/logical_datasets/"
codebookcsvpath <- "~/DIW/SOEP/git/isdatadoku/datasets/idrm_esm/"
codebookcsvpath <- "~/DIW/SOEP/git/core-doku/datasets/biol/"
codebookcsvpath <- "~/DIW/SOEP/git/core-doku/datasets/training/"
#modus <- "modul"
#modus <- ""
modus <- ""
# dataset.name <- "hbrutto"
# dataset.folder <- ""
# is.internal <- TRUE
......@@ -62,22 +64,23 @@ distribution <- "2015"
distribution <- "v4-0-0"
#distribution <- "2019"
#distribution <- "v37"
#distribution <- "v36"
distribution <- "2019"
distribution <- "v36"
#distribution <- "2019"
version <- "from codebook.csv"
study <- "from codebook.csv"
#language <- lang
language <- "de"
language <- "en"
#language <- "en"
allow.markdown <- FALSE
collapse.variable.groups <- TRUE
calc.abs.frequencies <- FALSE # TRUE: show only all value labels without frequencies
dta.available <- FALSE
calc.abs.frequencies <- TRUE # TRUE: show only all value labels without frequencies
omit.unlabeled.values <- TRUE # if only_labeled_vals==1
optimize.tables <- TRUE
restrict.questions <- TRUE # Anzeige der Fragen begrenzen (unique Fragen im letzten Jahr)
display.question.id <- TRUE
apply.checkl10n <- FALSE # falls nicht uebersetzt: _de nehmen und [de] einfuegen, überflüssige en löschen
apply.checkl10n <- TRUE # falls nicht uebersetzt: _de nehmen und [de] einfuegen, überflüssige en löschen
do.xelatex <- TRUE # LaTeX-Lauf starten
rename.pdf <- TRUE # pdf>questionnaire umbenennen do.xelatex=T
......@@ -119,12 +122,13 @@ datapath <- "~/DIW/SOEP/VDIdata/"
datapath <- "~/DIW/diwtmp/twinlife/"
datapath <- "~/DIW/SOEP/git/dortools/documeta/meta/dtas/"
datapath <- "~/DIW/diwtmp/finaldata/DE/"
datapath <- "~/DIW/diwtmp/v36codebookdata/"
if(modus=="is2019") {
#datapath <- paste0("//hume/rdc-prod/distribution/soep-core/soep.v35/stata_en/",dataset.folder)
datapath <- paste0("~/DIW/diwtmp/finaldata/DE/",dataset.folder,"/")
#codebookcsvpath <- paste0("D:/lokal/core-doku/datasets/",dataset.name ,"/")
codebookcsvpath <- paste0("~/DIW/SOEP/git/isdatadoku/datasets/",dataset.name ,"/")
codebookcsvpath <- paste0("~/DIW/SOEP/git/isdatadoku/datasets/",dataset.name ,"/2019/")
distribution <- "2019"
version <- "2019"
language <- c("en","de")[is.internal+1]
......@@ -153,7 +157,7 @@ if(modus=="is2019") {
if(modus=="v36") {
#datapath <- paste0("//hume/rdc-prod/distribution/soep-core/soep.v35/stata_en/",dataset.folder)
datapath <- paste0("~/DIW/SOEP/data/v36_VDI_knut/",dataset.folder)
datapath <- paste0("~/DIW/diwtmp/v36codebookdata/",dataset.folder)
#codebookcsvpath <- paste0("D:/lokal/core-doku/datasets/",dataset.name ,"/")
codebookcsvpath <- paste0("~/DIW/SOEP/git/core-doku/datasets/",dataset.name ,"/")
distribution <- "v36"
......@@ -323,29 +327,34 @@ if (allow.markdown) {
scipen.orig <- getOption("scipen")
options(scipen=999)
# dataset wird aus den tatsächlichen Datensätzen gewonnen. Das Objekt dient als
# Referenz für variablennamen und ihre tatsaechliche Reihenfolge.
#dta <- read.dta(paste0(datapath,dataset.name,".dta"), convert.factors = FALSE)
dta <- haven::read_dta(paste0(datapath,dataset.name,".dta"))
# Workoround für kaputtes microm-Files
if(dataset.name=="mircom"){
dta$ha_id[dta$hid=="3774864" & dta$syear=="2017"] <- "knut"
if(dta.available){
# dataset wird aus den tatsächlichen Datensätzen gewonnen. Das Objekt dient als
# Referenz für variablennamen und ihre tatsaechliche Reihenfolge.
#dta <- read.dta(paste0(datapath,dataset.name,".dta"), convert.factors = FALSE)
dta <- haven::read_dta(paste0(datapath,dataset.name,".dta"))
# Workoround für kaputtes microm-Files
if(dataset.name=="mircom"){
dta$ha_id[dta$hid=="3774864" & dta$syear=="2017"] <- "knut"
}
dataset <- names(dta)
dataset <- as.data.frame(cbind(dataset, 1:length(dataset)),
stringsAsFactors=FALSE)
names(dataset) <- c("variable", "order")
dataset$study <- study
dataset$dataset <- dataset.name
dataset$distribution <- distribution
dataset$version <- version
} else {
dataset <- CSVopen(paste0(codebookcsvpath,version,"/variables.csv"))
dataset <- dataset[,c("variable","study","dataset","version")]
dataset$order <- 1:nrow(dataset)
dataset$distribution <- distribution
}
dataset <- names(dta)
dataset <- as.data.frame(cbind(dataset, 1:length(dataset)),
stringsAsFactors=FALSE)
names(dataset) <- c("variable", "order")
dataset$study <- study
dataset$dataset <- dataset.name
dataset$distribution <- distribution
dataset$version <- version
# Variablenlisten
dvars <- dataset$variable
......@@ -405,6 +414,10 @@ if(length(cplusvars)>0){
variables.csv <- multiCSVopen(type="variables",
path=variables.csv.path, root="", standardize = TRUE)
if(language=="en" & apply.checkl10n){
variables.csv <- checkl10n(csv=variables.csv, csv.name="variables")
}
variable_categories.csv <- multiCSVopen(type="variable_categories",
path=v_c.csv.path, root="", standardize = TRUE)
......@@ -681,7 +694,7 @@ VariableLaTeX <- function(variable) {
# Originalinhalt der Wertelabels
categories.frequencies <- variable_categories.csv[variable_categories.csv$variable==variable, ]
categories.frequencies$frequency <- ""[nrow(categories.frequencies)>0]
if(calc.abs.frequencies){
if(calc.abs.frequencies & dta.available){
tab <- table(dta[,variable], useNA="ifany")
value <- names(tab)
value[is.na(value)] <- "<NA>"
......@@ -719,15 +732,22 @@ VariableLaTeX <- function(variable) {
cat.latex$label <- TeXifyStr(cat.latex$label)
# Sortierung der Wertelabels nach gültig (>=0) und ungültig (<0)
# unterschiedlich für numerische und string-Variablen
if(class(dta[[variable]])!="character"){
if(dta.available){
if(class(dta[[variable]])!="character"){
# numerisch
cat.latex$vz <- as.numeric(as.numeric(cat.latex$value)<0)
cat.latex$abs <- abs(as.numeric(cat.latex$value))
} else {
# string
cat.latex$vz <- 1
cat.latex$abs <- order(cat.latex$value)
}
} else {
# numerisch
cat.latex$vz <- as.numeric(as.numeric(cat.latex$value)<0)
cat.latex$abs <- abs(as.numeric(cat.latex$value))
} else {
# string
cat.latex$vz <- 1
cat.latex$abs <- order(cat.latex$value)
}
cat.latex <- cat.latex[order(cat.latex$vz, cat.latex$abs),
c("value", "label", "frequency")]
if(optimize.tables){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment