File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 55- Improved graceful errors for ` fetch_ucirepo() ` and ` list_available_datasets() `
66 when resources are not found/available. ([ #3 ] ( https://github.com/coatless-rpkg/ucimlrepo/issues/3 ) ,
77 thanks Prof. Ripley!)
8+
9+ ## Bug fixes
10+
11+ - Fixed internal subset issue with ` fetch_ucirepo() ` when metadata from the
12+ repository had whitespace characters in the variable names. ([ #2 ] ( https://github.com/coatless-rpkg/ucimlrepo/issues/2 ) )
813
914# ucimlrepo 0.0.1
1015
Original file line number Diff line number Diff line change @@ -246,11 +246,11 @@ fetch_ucirepo <- function(name, id) {
246246 stop(' Role must be one of "ID", "Feature", "Target", or "Other"' )
247247 }
248248
249- variables_by_role [[variable $ role ]] <- c(variables_by_role [[variable $ role ]], variable $ name )
249+ variables_by_role [[variable $ role ]] <- c(variables_by_role [[variable $ role ]], trimws( variable $ name ) )
250250 }
251251
252252 # Extract dataframes for each variable role
253- ids_df <- if (length(variables_by_role $ ID ) > 0 ) df [ , variables_by_role $ ID , drop = FALSE ] else NULL
253+ ids_df <- if (length(variables_by_role $ ID ) > 0 ) df [ , unlist( variables_by_role $ ID ) , drop = FALSE ] else NULL
254254 features_df <- if (length(variables_by_role $ Feature ) > 0 ) df [ , unlist(variables_by_role $ Feature ), drop = FALSE ] else NULL
255255 targets_df <- if (length(variables_by_role $ Target ) > 0 ) df [ , unlist(variables_by_role $ Target ), drop = FALSE ] else NULL
256256
You can’t perform that action at this time.
0 commit comments