Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9713f73

Browse files
committed
Advance deprecation of fwf_empty(skip_empty_rows =)
Part of#1600
1 parent18af120 commit9713f73

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

‎NEWS.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
are now available in the meltr package
1313
(https://github.com/r-lib/meltr).
1414

15+
* The`skip_empty_rows` argument of`fwf_empty()` now throws an error if used in
16+
edition 2. This argument was deprecated in readr 2.0.0 (2021-07-20).
17+
1518
#readr 2.1.6
1619

1720
*`locale(encoding =)` now warns, instead of errors, when the`encoding` cannot

‎R/read_fwf.R‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,22 @@ read_fwf <- function(
134134
fwf_empty<-function(
135135
file,
136136
skip=0,
137-
skip_empty_rows=FALSE,
137+
skip_empty_rows=deprecated(),
138138
col_names=NULL,
139139
comment="",
140140
n=100L
141141
) {
142142
if (edition_first()) {
143-
ds<- datasource(file,skip=skip,skip_empty_rows=skip_empty_rows)
143+
skip_empty_rows<-if (is_present(skip_empty_rows)) {
144+
skip_empty_rows
145+
}else {
146+
FALSE
147+
}
148+
ds<- datasource(
149+
file,
150+
skip=skip,
151+
skip_empty_rows=skip_empty_rows
152+
)
144153

145154
out<- whitespaceColumns(ds,comment=comment,n=n)
146155
out$end[length(out$end)]<-NA
@@ -151,7 +160,14 @@ fwf_empty <- function(
151160
}
152161

153162
if (!missing(skip_empty_rows)) {
154-
lifecycle::deprecate_soft("2.0.0","readr::fwf_empty(skip_empty_rows = )")
163+
lifecycle::deprecate_stop(
164+
when="2.0.0",
165+
what="readr::fwf_empty(skip_empty_rows = )",
166+
details= c(
167+
"i"="This argument is not supported in readr edition 2.",
168+
"i"="Use `with_edition(1, ...)` or `local_edition(1)` to use the legacy edition 1."
169+
)
170+
)
155171
}
156172

157173
vroom::fwf_empty(

‎man/read_fwf.Rd‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp