@@ -142,6 +142,8 @@ run_abimo_command_line <- function(args, tag = latest_abimo_version())
142
142
output
143
143
}
144
144
145
+ # write.dbf.abimo --------------------------------------------------------------
146
+
145
147
# ' writes data.frame into ABIMO-dbf
146
148
# '
147
149
# ' Saves an existing data.frame into dBase-format
@@ -156,20 +158,12 @@ run_abimo_command_line <- function(args, tag = latest_abimo_version())
156
158
# ' @export
157
159
write.dbf.abimo <- function (df_name , new_dbf )
158
160
{
159
- na_counts <- sapply(df_name , kwb.utils :: nNA )
160
- is_double <- sapply(df_name , is.double )
161
-
162
- may_cause_warnings <- is_double & (na_counts > 0L )
161
+ all_na <- sapply(df_name , kwb.utils :: nNA ) == nrow(df_name )
163
162
164
- if (any(may_cause_warnings )) {
163
+ if (any(all_na )) {
165
164
message(
166
- " foreign::write.dbf() may cause warnings due to NA values in the " ,
167
- " following numeric columns: " ,
168
- paste(collapse = " , " , sprintf(
169
- " \" %s\" (%d-times)" ,
170
- names(which(may_cause_warnings )),
171
- na_counts [may_cause_warnings ]
172
- ))
165
+ " foreign::write.dbf() will cause warnings due to the following empty " ,
166
+ " columns: " , kwb.utils :: stringList(names(which(all_na )), qchar = ' "' )
173
167
)
174
168
}
175
169
0 commit comments