Code snippet from 1.6.3 Profiling contains a function dplyr::rbind_all() which is no longer supported the current version of dplyr package.
Code snippet from book
library("profvis")
profvis(expr = {
library("ggplot2")
out = readRDS("extdata/out-ice.Rds")
df = dplyr::rbind_all(out, id = "Year")
ggplot(df, aes(long, lat, group = paste(group, Year))) +
geom_path(aes(colour = Year))
ggsave("figures/icesheet-test.png")
}, interval = 0.01, prof_output = "ice-prof")
When tried to create a dataframe from out using rbind_all got the following error
extdata_path <- "https://raw.githubusercontent.com/csgillespie/efficientR/master/extdata/"
out <- readr::read_rds(paste0(extdata_path, "out-ice.Rds"))
df = dplyr::rbind_all(out, id = "Year")
#> Error: 'rbind_all' is not an exported object from 'namespace:dplyr'
Fix
Now dplyr offers bind_rows function to bind data-frames which should be used instead of rbind_all
extdata_path <- "https://raw.githubusercontent.com/csgillespie/efficientR/master/extdata/"
out <- readr::read_rds(paste0(extdata_path, "out-ice.Rds"))
df <- dplyr::bind_rows(out, .id = "Year")
head(df)
#> Year long lat order hole piece id group
#> 1 1985 575000 5700000 1 FALSE 1 0 0.1
#> 2 1985 600000 5700000 2 FALSE 1 0 0.1
#> 3 1985 600000 5675000 3 FALSE 1 0 0.1
#> 4 1985 575000 5675000 4 FALSE 1 0 0.1
#> 5 1985 575000 5700000 5 FALSE 1 0 0.1
#> 6 1985 500000 5625000 1 FALSE 1 1 1.1
Please note that I am using dplyr version 1.0.8
packageVersion("dplyr")
#> [1] '1.0.8'
Code snippet from 1.6.3 Profiling contains a function
dplyr::rbind_all()which is no longer supported the current version of dplyr package.Code snippet from book
When tried to create a dataframe from out using
rbind_allgot the following errorFix
Now
dplyroffers bind_rows function to bind data-frames which should be used instead ofrbind_allPlease note that I am using
dplyrversion 1.0.8