Skip to Content
R Programming Fundamentals
book

R Programming Fundamentals

by Kaelen Medeiros
September 2018
Beginner
206 pages
4h 27m
English
Packt Publishing
Content preview from R Programming Fundamentals

Splitting and Unsplitting Data with Base R and the dplyr Methods

Splitting data can be accomplished using base R with the split() function. Its simplest use would be to input a dataset you'd like to be split followed by a factor variable to split that dataset by.unsplit() works in a very similar fashion.

dplyr also has functions that facilitate splitting data, which can be rejoined with combination methods we will cover in more detail very soon in this section. Often, these alternative methods will require less code.

Let's explore both of these possibilities in the next section.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Programming Fundamentals

R Programming Fundamentals

Samik Sen, Marcin Dubel
Python for Programmers

Python for Programmers

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9781789612998Supplemental Content