Data structures in R

BAN421 Data structures in R

  • Topics


    -Understanding data structures is the key to empowering users of R, both in understanding what is going on, in reading the scripts of others, in customising results, and in writing scripts. Data structures have developed in R over time, so that both older and newer forms are found together in most workflows. Working from the ground upwards, we will see how they may be understood, and how this understanding gives insight into the language and its use.

  • Learning outcome

    Learning outcome

    Knowledge: on successful completion, the student will be able to

    • understand basic data structures used in R programming
    • understand the role of data frames as a fundamental data container in R, and how other structures are needed for graphs
    • understand the representation of time and character encoding used in R
    • understand the development of class definition systems in R, including method dispatch
    • understand the motivations underlying the choices made among data structures in R programming
    • use this understanding in customising output of functions

    Skills: on successful completion, the student will be able to

    • assign correct descriptions to data structures used in scripts and functions encountered in simple workflows
    • define new composite data structures for workflow output, and appropriate standard methods

    General competence: on successful completion, the student will be able to

    • handle the output of R functions with greater confidence
    • customise the output of R functions to meet specific needs

  • Teaching


    This course combines lectures and programming tutorials. Lectures focus on methodological issues. In programming tutorials, the student will implement the learned methodologies using R.

  • Recommended prerequisites

    Recommended prerequisites

    Programming skills with R are helpful. However, if necessary, an additional introduction to programming with R will be offered.

  • Credit reduction due to overlap

    Credit reduction due to overlap

    Course identical to BUS463.

  • Requirements for course approval

    Requirements for course approval

    A group project, with a presentation during the course (conditional on participant numbers).

    Course approval from BUS463 is valid for BAN421.

  • Assessment


    Group term paper, based on the group project (conditional on participant numbers)

    This course is a continuation of BUS463 and the total number of attempts applies to the course (not the course code).

  • Grading Scale

    Grading Scale


  • Computer tools

    Computer tools

    R ( and RStudio ( and contributed packages packages as needed.

  • Semester


    Autumn. Offered Autumn 2018.

    Last week of autumn semester

  • Literature


    Main book:

    • Gillespie C. & Lovelace, R. (2017) Efficient R Programming. Sebastopol, CA: O'Reilly.



    First strand:

    • Chambers, J. M. (1998) Programming with Data: A Guide to the S Language. New York: Springer. (chapter 1)
    • Chambers, J. M. (2008) Software for Data Analysis: Programming with R. New York: Springer. (chapters 1, 3, 5, 6)
    • Chambers, J. M. (2016) Extending R. Boca Raton, FL: CRC Press. (chapters 1-6, 9)

    Second strand:

    • Grolemund, G. (2014) Hands-On Programming with R. Sebastopol, CA: O'Reilly. (chapters 1, 2, 8)
    • Wickham, H. (2015) Advanced R. Boca Raton, FL: CRC Press. (chapters 1, 2, 7)
    • Wickham, H. & Grolemund, G. (2017) R for Data Science. Boca Raton, FL: CRC Press. (3, 7, 9, 10, 16)


ECTS Credits
Teaching language

Course responsible

Professor Roger Bivand, Department of Economics