From aaeb13661fb775875182d6387be858bc1b38cd2f Mon Sep 17 00:00:00 2001 From: Alex Gebben Work Date: Mon, 8 Sep 2025 17:21:02 -0600 Subject: [PATCH] Working on slides --- Class4/Comp_Econ_Code/Code_Examples.r | 2 +- Class4/Slides/Best_Practice.tex | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Class4/Comp_Econ_Code/Code_Examples.r b/Class4/Comp_Econ_Code/Code_Examples.r index f23a5ca..1d83b3a 100644 --- a/Class4/Comp_Econ_Code/Code_Examples.r +++ b/Class4/Comp_Econ_Code/Code_Examples.r @@ -5,7 +5,7 @@ # so the results can reproduced more easily if the data changes. dir.create("Data",showWarnings = FALSE) dir.create("Data/Orig_Data",showWarnings = FALSE) - #Check if direjctory exits + #Check if directory exits dir.exists("Data/Orig_Data") # Help -------------------------------------------------------------------- diff --git a/Class4/Slides/Best_Practice.tex b/Class4/Slides/Best_Practice.tex index 7bb5b99..27df212 100644 --- a/Class4/Slides/Best_Practice.tex +++ b/Class4/Slides/Best_Practice.tex @@ -83,9 +83,9 @@ \end{frame} %%%%%%%%%%%%%% -\begin{frame}{R studio Projects} +\begin{frame}{Rstudio Projects} \only<1-5>{ - If you are using R studio it is best practice to create a project file. + If you are using Rstudio it is best practice to create a project file. \begin{itemize} \onslide<2->{\item Sets the working directory.} \onslide<3->{\item Allows all code to use relative paths.} @@ -124,7 +124,7 @@ \begin{frame}{File Management} \begin{itemize} \onslide<1->{\item Create directories for data} - \onslide<2->{\item Create Directories for scripts} + \onslide<2->{\item Create directories for scripts} \onslide<3->{\item Make code do most of the cleaning} \onslide<4->{\item Clear naming of files} \onslide<5->{\item Document all files with a Readme file} @@ -145,21 +145,20 @@ \column{0.5\textwidth} \textbf{Useful Functions} \begin{itemize} - \onslide<2->{\item \texttt{create.dir()}} + \onslide<2->{\item \texttt{dir.create()}} \onslide<3->{\item\texttt{dir.exists()}} \onslide<4->{\item\texttt{file.exists()}} \onslide<5->{\item\texttt{list.files()}} - \onslide<6->{\item\texttt{dir.create()}} \end{itemize} \column{0.5\textwidth} - \onslide<7->{\textbf{Saving Data} + \onslide<6->{\textbf{Saving Data} \begin{itemize} - \onslide<8->{\item \texttt{write\_csv()}} - \onslide<9->{\item \texttt{write\_excel\_csv()}} - \onslide<10->{\item\texttt{write\_delim()}} - \onslide<11->{\item\texttt{saveRDS()}} - \onslide<12->{\item\texttt{ggsave()}} - \onslide<13->{\item\texttt{write.csv()}} + \onslide<7->{\item \texttt{write\_csv()}} + \onslide<8->{\item \texttt{write\_excel\_csv()}} + \onslide<9->{\item\texttt{write\_delim()}} + \onslide<10->{\item\texttt{saveRDS()}} + \onslide<11->{\item\texttt{ggsave()}} + \onslide<12->{\item\texttt{write.csv()}} \end{itemize} } \end{columns} @@ -175,7 +174,7 @@ Keep your main working space clean, and separate what you can. \vspace{1.5em} \begin{enumerate} - \onslide<2->{\item Make diffrent files for each main data step. Downloading, cleaning, various analyses.} + \onslide<2->{\item Make different files for each main data step. Downloading, cleaning, various analyses.} \onslide<3->{\item You can save the data downloading portion as a file called \texttt{1\_EIA\_Data\_Proc.R}} \onslide<4->{\item In the main file you could load the code with \texttt{source(``1\_EIA\_Data\_Proc.R'')}} \onslide<5->{R will run the code in the current directory even if the script is saved elsewhere.} @@ -218,7 +217,7 @@ \onslide<3->{\item File names contain spaces} \onslide<4->{\item Same name but different capitalization} \onslide<5->{\item Names don’t describe their contents ``temp''} - \onslide<6->{\item Outputs should be in seperate directory from inputs} + \onslide<6->{\item Outputs should be in separate directory from inputs} \onslide<7->{\item Outputs files should have dates in the name} \end{itemize} }