Skip to content

Commit

Permalink
Brad's review of data_01_aps_investigations_import.qmd
Browse files Browse the repository at this point in the history
Part of #33
- Use the `here` package to facilitate file import and export.
- Checked for overlap with `qaqc/data_01_aps_recode_factors.Rmd`. There was nothing in the QAQC file that wasn't also in the data import file. Deleted the QAQC file.
- Added two carriage returns before level one headings.
  • Loading branch information
mbcann01 committed Mar 15, 2024
1 parent 938a45f commit 6b5b1be
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 155 deletions.
27 changes: 23 additions & 4 deletions data_management/data_01_aps_investigations_import.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,28 @@ library(dplyr, warn.conflicts = FALSE)
library(readr)
library(purrr)
library(stringr)
library(janitor)
library(janitor, warn.conflicts = FALSE)
```


# Load data

Load the data table into the global environment as a data frame using the raw csv file. See this Wiki page for more information about the location of the data: https://github.com/brad-cannell/detect_fu_interviews_public/wiki/Using-this-repository.
Load the data table into the global environment as a data frame using the raw csv file. See this Wiki page for more information about the location of the data: https://github.com/brad-cannell/detect_fu_interviews_public/wiki.

```{r}
aps_inv <- read_csv("../data/filemaker_pro_exports/aps_investigations_import.csv")
aps_inv_path <- here::here("data", "filemaker_pro_exports", "aps_investigations_import.csv")
```

```{r}
aps_inv <- read_csv(aps_inv_path)
```

```{r}
# Data check
dim(aps_inv) # 951 18
```


# Data cleaning

We will create categorical variables with numerical values that match the codebook and also create a factor variable for each categorical variable in the data frame to be used for analysis.
Expand Down Expand Up @@ -139,8 +145,21 @@ aps_inv <- aps_inv %>%
dim(aps_inv) # 951 22
```


# Save as rds file

```{r}
write_rds(aps_inv, "../data/cleaned_rds_files/aps_investigations_import.rds")
aps_inv_path <- here::here("data", "cleaned_rds_files", "aps_investigations_import.rds")
```

```{r}
write_rds(aps_inv, aps_inv_path)
```


# Clean up

```{r}
rm(list = ls())
```

151 changes: 0 additions & 151 deletions data_management/qaqc/data_01_aps_recode_factors.Rmd

This file was deleted.

0 comments on commit 6b5b1be

Please sign in to comment.