Ggplot2 Diamonds Dataset Download !exclusive! May 2026

The diamonds dataset is a cornerstone of R data science, originally compiled by Hadley Wickham to showcase the capabilities of the ggplot2 package. It contains information on 53,940 round-cut diamonds, including their prices and physical attributes. How to Download and Access the Dataset

ggplot2/data-raw/diamonds. csv at main · tidyverse/ggplot2 · GitHub. Navigation Menu. Toggle navigation. Dataset: Diamonds from Hadley's ggplot2 - Zenodo

If you already have ggplot2 installed, you can generate your own CSV file using a single line of code: write.csv(diamonds, "diamonds.csv", row.names = FALSE) Use code with caution. Dataset Structure and Variables The dataset consists of and 10 variables : Description price Price in US dollars ($326–$18,823). carat Weight of the diamond (0.2–5.01). cut Quality of the cut (Fair, Good, Very Good, Premium, Ideal). color Diamond color, from D (best) to J (worst). clarity Measurement of clearness (I1 (worst) to IF (best)). x Length in mm (0–10.74). y Width in mm (0–58.9). z Depth in mm (0–31.8). depth Total depth percentage = table Width of top of diamond relative to widest point. Common Uses for the Dataset ggplot2/data-raw/diamonds.csv at main - GitHub ggplot2 diamonds dataset download

A versioned, 2.4 MB CSV file is available for download on Zenodo .

You can find the dataset in various machine learning competitions on Kaggle . 3. Export from R to CSV The diamonds dataset is a cornerstone of R

Since the dataset is built into the ggplot2 package, you do not need to download a separate file if you are working in R.

You can access this dataset either directly within R or by downloading it as a standalone CSV file for use in other software like Python, Excel, or Tableau. 1. Direct Access in R csv at main · tidyverse/ggplot2 · GitHub

If you need a physical copy of the data, you can obtain the from several reputable sources:

The raw CSV is hosted on the tidyverse/ggplot2 GitHub repository .

# Install ggplot2 if you haven't already install.packages("ggplot2") # Load the library library(ggplot2) # Access the dataset data(diamonds) # View the first few rows head(diamonds) Use code with caution. 2. Download as a CSV File