R is a popular statistical analysis and machine-learning package that includes tests, models, analyses, and graphics, and enables data management. RStudio, included in IBM Watson Studio, provides an IDE for working with R.
- Data format
- All data file types in the RStudio server file structure or stored in the IBM Cloud Object Storage bucket associated with the project
- Tables in relational data sources
- Data size
RStudio is integrated in IBM Watson Studio projects and can be launched after you create a project.With RStudio integration in projects, you can access and use the data files that are stored in the IBM Cloud Object Storage bucket associated with your project in RStudio.
To start RStudio in your project:
- Click RStudio from the Launch IDE menu on your project’s action bar.
- Select an environment runtime.
- Click Launch.
The environment runtime is initiated and the development environment opens.
Watch this video to see an overview of the RStudio IDE.
Working with data files
In RStudio, you can work with data files from different sources:
Files in the RStudio server file structure, which you can view by clicking Files in the bottom right section of RStudio. This is where you can create folders, upload files from your local system, and delete files.
To access these files in R, you need to set the working directory to the directory with the data files. You can do this by navigating to the directory with the files and clicking More > Set as Working Directory.
Be aware that files stored in the
Homedirectory of your RStudio instance are persistent within your instance only and cannot be shared across environments nor within your project.
Watch this video to see how to load data to RStudio.
Data files that are stored in the IBM Cloud Object Storage bucket associated with your project. When RStudio is launched, the IBM Cloud Object Storage bucket content is mounted to your
Homedirectory under the
project-objectstoragefolder. You are permitted to view the content of data files in this folder only. You can read and update data files in that folder, however you cannot delete files.
Restriction: You cannot load files to this folder at this time.
If new data assets are added to the project which you want to access from RStudio, you need to refresh the folder.
Data stored in a database system.
Watch this video to see how to connect to external data sources in RStudio.
Adding or deleting project assets
You should upload data files to use in your notebooks in RStudio from the find and add data sidebar on your project’s Assets page because these files are automatically added as data assets to your project.
However, if you worked with data files in RStudio, you can add them to your project as project data assets. These files must be in the
project_data/rstudio/data_assets folder. To add these files as data assets to the project:
- On the Assets page of the project, click the Find and Add Data icon () and select the Files tab.
- Select the files you want to add to the project as assets.
- From the Actions list, select Add as data asset and apply your changes.
If you delete a data asset from the
project_data/rstudio/data_assets folder in RStudio, the file is no longer listed in the add data sidebar under the Files tab when you click the Find and Add Data icon on the project Assets page. However it is still listed as a data asset on the Assets page of your project. Delete the entry in the data assets list by:
- Selecting the data asset from the list.
- From the Actions list, selecting Remove.
Watch this video to see how to run Shiny applications in RStudio: