Use as.data.frame() when an object needs to become a classic R data frame. This is especially useful when older or base R code cannot read a tibble. section 13.6.2 section 10.3
The conversion can help when:
- A base R workflow requires a data frame rather than a tibble. section 13.6.2
- Printed results should display fully instead of using tibble’s limited screen output or scientific notation. section 13.6.2 section 10.3
Prepare win-share data for Lorenz curves
After reshaping and selecting the needed columns, convert the tibble and verify its class: ws9194 <- as.data.frame(ws9194) class(ws9194) ## [1] "data.frame" The resulting data frame can then supply columns to a base R for loop that creates four Lorenz curves. section 13.6.2
Display salary summaries clearly
Convert a summarized salary tibble at print time: print(as.data.frame(mean_salaries_real)) The output shows the average salaries for s2017 through s2000 as ordinary decimal values rather than scientific notation. section 10.3
