@@ -488,7 +488,7 @@ test_file_name_match <- function(directory = here::here(), metadata = load_metad
488
488
if (length(meta_only ) == 0 && length(dir_only ) == 0 ) {
489
489
cli :: cli_inform(c(" v" = " All data files are listed in metadata and all metadata files names refer to data files." ))
490
490
} else if (length(meta_only ) > 0 || length(dir_only ) > 0 ) {
491
- msg <- c()
491
+ msg <- NULL
492
492
if (length(meta_only > 0 )) {
493
493
names(meta_only ) <- rep(" *" , length(meta_only ))
494
494
msg <- c(" x" = " {length(meta_only)} file{?s} listed in metadata but missing from data folder" , meta_only )
@@ -536,7 +536,7 @@ test_fields_match <- function(directory = here::here(), metadata = load_metadata
536
536
537
537
# get names of each file to add to attributes table
538
538
table_names <- NULL
539
- for (i in 1 : length( seq_along(data_files ) )) {
539
+ for (i in seq_along(data_files )) {
540
540
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
541
541
table_names <- append(table_names , tbl_nam )
542
542
}
@@ -625,14 +625,14 @@ test_missing_data <- function(directory = here::here(),
625
625
626
626
# load files and test for NAs
627
627
error_log <- NULL
628
- for (i in 1 : length( seq_along(data_files ) )) {
628
+ for (i in seq_along(data_files )) {
629
629
# load each file
630
630
dat <- suppressMessages(readr :: read_csv(paste0(directory ,
631
631
" /" ,
632
632
data_files [i ]),
633
633
show_col_types = FALSE ))
634
634
# look in each column in the given file
635
- for (j in 1 : ncol(dat )) {
635
+ for (j in seq_len( ncol(dat ) )) {
636
636
# look for NAs; if NAs found, look for correct missing data codes
637
637
if (sum(is.na(dat [,j ])) > 0 ) {
638
638
missing <- data_tbl [[i ]][[" attributeList" ]][[" attribute" ]][[j ]][[" missingValueCode" ]][[" code" ]]
@@ -702,7 +702,7 @@ test_numeric_fields <- function(directory = here::here(), metadata = load_metada
702
702
703
703
# get names of each file to add to attributes table
704
704
table_names <- NULL
705
- for (i in 1 : length( seq_along(data_files ) )) {
705
+ for (i in seq_along(data_files )) {
706
706
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
707
707
table_names <- append(table_names , tbl_nam )
708
708
}
@@ -818,7 +818,7 @@ test_dates_parse <- function(directory = here::here(),
818
818
819
819
# get names of each file to add to dttm attributes table
820
820
table_names <- NULL
821
- for (i in 1 : length( seq_along(data_tbl ) )) {
821
+ for (i in seq_along(data_tbl )) {
822
822
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
823
823
table_names <- append(table_names , tbl_nam )
824
824
}
@@ -1014,7 +1014,7 @@ test_date_range <- function(directory = here::here(),
1014
1014
1015
1015
# get names of each file to add to dttm attributes table
1016
1016
table_names <- NULL
1017
- for (i in 1 : length( seq_along(data_tbl ) )) {
1017
+ for (i in seq_along(data_tbl )) {
1018
1018
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
1019
1019
table_names <- append(table_names , tbl_nam )
1020
1020
}
@@ -1340,7 +1340,7 @@ test_valid_fieldnames <- function(metadata = load_metadata(here::here())) {
1340
1340
1341
1341
# get names of each file to add to attributes table
1342
1342
table_names <- NULL
1343
- for (i in 1 : length( seq_along(data_tbl ) )) {
1343
+ for (i in seq_along(data_tbl )) {
1344
1344
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
1345
1345
table_names <- append(table_names , tbl_nam )
1346
1346
}
@@ -1403,7 +1403,7 @@ test_valid_filenames <- function(metadata = load_metadata(here::here())) {
1403
1403
1404
1404
# get names of each file to add to attributes table
1405
1405
file_names <- NULL
1406
- for (i in 1 : length( seq_along(data_tbl ) )) {
1406
+ for (i in seq_along(data_tbl )) {
1407
1407
tbl_nam <- data_tbl [[i ]][[" physical" ]][[" objectName" ]]
1408
1408
file_names <- append(file_names , tbl_nam )
1409
1409
}
0 commit comments