Skip to content

Commit 3bd4fd1

Browse files
namespace-qualify methods::as() as needed (#5644)
* namespace-qualify methods::as() as needed As identified in https://bugs.r-project.org/show_bug.cgi?id=18540 * Update tests.Rraw * revert * minify diff
1 parent ae6a3c2 commit 3bd4fd1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

inst/tests/tests.Rraw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12911,8 +12911,8 @@ test(1914.04, dt.s4.list, as.list(dt)) # Underlying data not identical
1291112911
# simple S4 conversion-isms work
1291212912
df = data.frame(a=sample(letters, 10), b=1:10)
1291312913
dt = as.data.table(df)
12914-
test(1914.05, identical(as(df, 'data.table'), dt))
12915-
test(1914.06, identical(as(dt, 'data.frame'), df))
12914+
test(1914.05, identical(methods::as(df, 'data.table'), dt))
12915+
test(1914.06, identical(methods::as(dt, 'data.frame'), df))
1291612916
# data.table can be used in an S4 slot
1291712917
dt <- data.table(a=sample(letters[1:3], 10, replace=TRUE), score=rnorm(10))
1291812918
dt.comp <- new("S4Composition", data=dt)

man/IDateTime.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ See 'Details' in \code{\link{round}} for more information.
226226
(d <- as.IDate("2001-01-01"))
227227
228228
# S4 coercion also works
229-
identical(as.IDate("2001-01-01"), as("2001-01-01", "IDate"))
229+
identical(as.IDate("2001-01-01"), methods::as("2001-01-01", "IDate"))
230230
231231
# create ITime:
232232
(t <- as.ITime("10:45"))
233233
234234
# S4 coercion also works
235-
identical(as.ITime("10:45"), as("10:45", "ITime"))
235+
identical(as.ITime("10:45"), methods::as("10:45", "ITime"))
236236
237237
(t <- as.ITime("10:45:04"))
238238

0 commit comments

Comments
 (0)