Skip to content

Commit 716d5aa

Browse files
committed
Fixes for readr 2.0.0
readr 2.0.0 requires literal data to be marked with `I()` when passed to the reading function. Also the way that name repair happens has changed, so X1 and X6 are no longer the correct names. Removing the columns by position rather than name solves this second issue.
1 parent eee04df commit 716d5aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

r-package/R/list_geobr.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ table_end <- grep("Other functions", readme) -1
3535
table_strig <- readme[table_start:table_end]
3636

3737
# read table as a data.frame
38-
suppressWarnings({ df <- readr::read_delim(table_strig, delim = '|', trim_ws = T) })
38+
suppressWarnings({ df <- readr::read_delim(I(table_strig), delim = '|', trim_ws = T) })
3939

4040
# clean colunms
41-
df$X1 <- NULL
42-
df$X6 <- NULL
41+
df[[1]] <- NULL
42+
df[[5]] <- NULL
4343

4444
# remove 1st row with "-----"
4545
df <- df[-1,]

0 commit comments

Comments
 (0)