R Tutorial: Description and Namespace files
Key Takeaways
Describes DESCRIPTION and NAMESPACE files in R packages
Full Transcript
now you've seen the basic structure of a package and know what to do with your are functions let's take a look at two important aspects of your package the description and namespace the description file contains basic information about the package including its authors and maintainer its dependencies and the license let's take a look at an example description file now the basic package metadata includes the package name that you chose when you created the package as well as a one-line title for your package and a short description this is the information people typically use to judge the content of your package when searching for new packages so keep it relevant and descriptive and make sure you update it if you change the package the version field tells us which version of the package this is when you start making changes to your package you should remember to increment the version number this will allow you and others to keep track of which version of the package they are working with then we have the license this defines how other people can use ocurred in your package the authors at our field is where you list the package authors as occurred the our function person helps us to keep this in the right format you need to give the first name last name email and royal the role is an abbreviation and there are many many possibilities you could use but most common for our packages are CR e for the package maintainer aut for an author CTB for contributors and CP hich for the package copyright holder this is often used when a company owns copyright on a package people can have multiple roles you just supply them as a vector like in the example here you can also have multiple people you simply need to provide a vector of person calls one for each person the last entries of nerds are the depends and imports fields these ensure that any other package your package needs is installed and is available to use before someone tries to run the code you'll be looking at the differences between depends and imports later in this course but for now you can see that the minimum version of our is listed in the depends field and other package dependencies are listed in the imports field the namespace file allows you to control two very important things firstly which functions from other packages you need access to to run the curd in our package secondly which functions from your package you want to make available to people using it you will come back to both of these ideas later but all you need to know now is that you don't need to edit this file you will manage it with all of your other documentation for now let's just take a quick look at what a complete namespace might look like this file always contains a reminder to us not to edit it but otherwise you can see that in this package you are importing or making available to your package the functions from deep liar from your package you are exporting are making available to the package users any accounter now you have seen these two important files it's your turn to try creating a description file for your package
Original Description
Want to learn more? Take the full course at https://learn.datacamp.com/courses/developing-r-packages at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
Now you have seen the basic structure of a package and know what to do with your R functions let's take a look at two important aspects of your package, the DESCRIPTION and NAMESPACE.
The DESCRIPTION file contains basic information about the package including its authors and maintainer, its dependencies and the license.
Let's take a look at an example DESCRIPTION file now.
The basic package metadata includes the package name, that you chose when you created the package, as well as a one-line title for your package and a short description. This is the information people typically use to judge the content of your package when searching for new packages, so keep it relevant and descriptive - and make sure you update it if you change the package.
The "Version" field tells us which version of the package this is. When you start making changes to your package, you should remember to increment the version number. This will allow you and others to keep track of which version of the package they are working with!
Then we have the "License". This defines how other people can use the code in your package.
The "Authors-@R field" is where you list the package authors as R code. The R function "person" helps us to keep this in the right format. You need to give the first name, last name, email and role. The role is an abbreviation and there are many many possibilities you could use but most common for R packages are "cre" for the package maintainer, "aut" for an author, "ctb" for contributors and "cph" for the package copyright holder. This is often used when a company owns the copyright on a package. People can have multiple roles, you just supply them as a vector, like in the example here. You can also have multiple people, you simply need to provide a vector
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from DataCamp · DataCamp · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SQL Server Tutorial: Date manipulation
DataCamp
R Tutorial: Intermediate Interactive Data Visualization with plotly in R
DataCamp
R Tutorial: Adding aesthetics to represent a variable
DataCamp
R Tutorial: Moving Beyond Simple Interactivity
DataCamp
Python Tutorial: Why use ML for marketing? Strategies and use cases
DataCamp
Python Tutorial: Preparation for modeling
DataCamp
Python Tutorial: Machine Learning modeling steps
DataCamp
R Tutorial: The prior model
DataCamp
R Tutorial: Data & the likelihood
DataCamp
R Tutorial: The posterior model
DataCamp
R Tutorial: An Introduction to plotly
DataCamp
R Tutorial: Plotting a single variable
DataCamp
R Tutorial: Bivariate graphics
DataCamp
Python Tutorial: Customer Segmentation in Python
DataCamp
Python Tutorial: Time cohorts
DataCamp
Python Tutorial: Calculate cohort metrics
DataCamp
Python Tutorial: Cohort analysis visualization
DataCamp
R Tutorial: Building Dashboards with flexdashboard
DataCamp
R Tutorial: Anatomy of a flexdashboard
DataCamp
R Tutorial: Layout basics
DataCamp
R Tutorial: Advanced layouts
DataCamp
Python Tutorial: Time Series Analysis in Python
DataCamp
Python Tutorial: Correlation of Two Time Series
DataCamp
Python Tutorial: Simple Linear Regressions
DataCamp
Python Tutorial: Autocorrelation
DataCamp
R Tutorial: The gapminder dataset
DataCamp
R Tutorial: The filter verb
DataCamp
R Tutorial: The arrange verb
DataCamp
R Tutorial: The mutate verb
DataCamp
R Tutorial: What is cluster analysis?
DataCamp
R Tutorial: Distance between two observations
DataCamp
R Tutorial: The importance of scale
DataCamp
R Tutorial: Measuring distance for categorical data
DataCamp
Python Tutorial: Plotting multiple graphs
DataCamp
Python Tutorial: Customizing axes
DataCamp
Python Tutorial: Legends, annotations, & styles
DataCamp
Python Tutorial: Introduction to iterators
DataCamp
Python Tutorial: Playing with iterators
DataCamp
Python Tutorial: Using iterators to load large files into memory
DataCamp
SQL Tutorial: Introduction to Relational Databases in SQL
DataCamp
SQL Tutorial: Tables: At the core of every database
DataCamp
SQL Tutorial: Update your database as the structure changes
DataCamp
Python Tutorial: Classification-Tree Learning
DataCamp
Python Tutorial: Decision-Tree for Classification
DataCamp
Python Tutorial: Decision-Tree for Regression
DataCamp
Python Tutorial: Census Subject Tables
DataCamp
Python Tutorial: Census Geography
DataCamp
Python Tutorial: Using the Census API
DataCamp
R Tutorial: A/B Testing in R
DataCamp
R Tutorial: Baseline Conversion Rates
DataCamp
R Tutorial: Designing an Experiment - Power Analysis
DataCamp
R Tutorial: Introduction to qualitative data
DataCamp
R Tutorial: Understanding your qualitative variables
DataCamp
R Tutorial: Making Better Plots
DataCamp
SQL Tutorial: OLTP and OLAP
DataCamp
SQL Tutorial: Storing data
DataCamp
SQL Tutorial: Database design
DataCamp
Python Tutorial: Introduction to spaCy
DataCamp
Python Tutorial: Statistical Models
DataCamp
Python Tutorial: Rule-based Matching
DataCamp
Related Reads
📰
📰
📰
📰
I Tested an AI Slop Detector — It Flagged My Own Writing
Dev.to AI
The Ultimate Guide to Crafting a Winning Resume with AI
Dev.to · vicente san silvestre chacon
Google Veo3 Public Release 2026: The Creator's Secret Weapon
Dev.to AI
Stop Paying for SaaS - Build Free AI Stack
Dev.to · Swastik Mishra
🎓
Tutor Explanation
DeepCamp AI