data(): Prebuilt datasets

In this page, we will learn data() function that shows prebuilt datasets in R. data() function will show the list of all datasets in your workspace. data() is a function within a "utils" package in "base" version of R installation so that you do not need to install any package to run this.

When you install R in your computer, the package "datasets" is included in the base installation of R. Datasets in the package "datasets" are provided openly and free. These datasets can be used when you want to verify your statistical methods. When you install some packages that include datasets, data() function will show the datasets in the packages.

1-3_List_Of_Datasets.png

You can see the document of data() function at the following link:

  • data() : Show all datasets in your workspace
  • Instruction

    Copy and Run the sample code in your RStudio to see how data() function works.

    # DO NOT RUN HERE # Copy and Run the sample code in your RStudio. # list all available data sets data() # print iris dataset iris

    Previous: 1-2 | print(): Print a value of object to the console

    Next: 1-4 | head(): Look up the first entries in variables

    Back to Main