dplyr 0.4.3

September 4, 2015
By

(This article was first published on RStudio Blog, and kindly contributed to R-bloggers)

dplyr 0.4.3 includes over 30 minor improvements and bug fixes, which are described in detail in the release notes. Here I wanted to draw your attention five small, but important, changes:

  • mutate() no longer randomly crashes! (Sorry it took us so long to fix this – I know it’s been causing a lot of pain.)
  • dplyr now has much better support for non-ASCII column names. It’s probably not perfect, but should be a lot better than previous versions.
  • When printing a tbl_df, you now see the types of all columns, not just those that don’t fit on the screen:
    data_frame(x = 1:3, y = letters[x], z = factor(y))
    #> Source: local data frame [3 x 3]
    #> 
    #>       x     y      z
    #>   (int) (chr) (fctr)
    #> 1     1     a      a
    #> 2     2     b      b
    #> 3     3     c      c
  • bind_rows() gains a .id argument. When supplied, it creates a new column that gives the name of each data frame:
    a <- data_frame(x = 1, y = "a")
    b <- data_frame(x = 2, y = "c")
    
    bind_rows(a = a, b = b)
    #> Source: local data frame [2 x 2]
    #> 
    #>       x     y
    #>   (dbl) (chr)
    #> 1     1     a
    #> 2     2     c
    bind_rows(a = a, b = b, .id = "source")
    #> Source: local data frame [2 x 3]
    #> 
    #>   source     x     y
    #>    (chr) (dbl) (chr)
    #> 1      a     1     a
    #> 2      b     2     c
    # Or equivalently
    bind_rows(list(a = a, b = b), .id = "source")
    #> Source: local data frame [2 x 3]
    #> 
    #>   source     x     y
    #>    (chr) (dbl) (chr)
    #> 1      a     1     a
    #> 2      b     2     c
  • dplyr is now more forgiving of unknown attributes. All functions should now copy column attributes from the input to the output, instead of complaining. Additionally arrange(), filter(), slice(), and summarise() preserve attributes of the data frame itself.

To leave a comment for the author, please follow the link and comment on their blog: RStudio Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)