Skip to content

Commit

Permalink
Remove redundant "as.data.set" method and setOldClass() call for "tbl…
Browse files Browse the repository at this point in the history
…_df"
  • Loading branch information
melff committed Jan 20, 2021
1 parent 7ed1391 commit 56cd7d3
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions pkg/R/tibbles.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,3 @@ setMethod("as_haven",signature(x="item.vector"),function(x,user_na=FALSE,...){
}
return(y)
})

if(!requireNamespace("tibble",quietly = TRUE)) setOldClass("tbl_df")
setMethod("as.data.set","tbl_df",function(x,row.names=NULL,...){
class(x) <- "data.frame"
if(length(row.names)){
if(length(row.names)!=nrow(x)) stop("row.names argument has wrong length")
attr(x,"row.names") <- row.names
}
else
attr(x,"row.names") <- seq_len(nrow(x))
new("data.set",x)
})

0 comments on commit 56cd7d3

Please sign in to comment.