Skip to content

Commit

Permalink
Update R notebook for NTS
Browse files Browse the repository at this point in the history
  • Loading branch information
HSalat committed Feb 19, 2024
1 parent f9cbcfa commit 7d6ace1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions notebooks/R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ readNTS <- function(name,folderIn = "data"){
return(data)
}

NTS <- readNTS("individual",folderIn)
indiv <- readNTS("individual",folderIn)
stage <- readNTS("stage",folderIn)
trip <- readNTS("trip",folderIn)
trip <- readNTS("trip",folderIn)

trip2022 <- trip[trip$SurveyYear == 2022,]
stage2022 <- stage[stage$SurveyYear == 2022,]

# Missing values
neg <- which(trip2022 < 0, arr.ind = T)
nrow(neg)
unique(colnames(trip2022)[neg[,2]])
length(which(neg[,2] == neg[,2][1]))/nrow(trip2022)

negS <- which(stage2022 < 0, arr.ind = T)
nrow(negS)
unique(colnames(stage2022)[negS[,2]])
length(which(negS[,2] == negS[,2][1]))/nrow(stage2022)

0 comments on commit 7d6ace1

Please sign in to comment.