The R Language block enables you to use R language programs in a Workflow. To use the R Language block, you must have a R interpreter installed and configured.
The following demonstrates how the R Language block can be used to restrict an input lib_books.csv dataset (which contains observations that describe a range of books available from a lending library) to only show authors.
- Import the lib_books.csv dataset onto a Workflow using Text File Import block.
- Expand the Code Blocks group in the Workflow palette, then click and drag a R Language block onto the Workflow canvas.
- Click Output port of the lib_books dataset block and drag a connection towards the Input port of the R Language block.
- Double-click on the R Language block to display the R Language Editor view.
- In the R Language Editor view:
- In the Outputs panel, click Add new output dataset.
- In the R Editor, enter the following:
Output_1 <- data.frame(Author=Input_1$Author)
- Close the R Language Editor view and save the configuration when prompted.
A green execution status is displayed in the Output port of the R Language block and the new Working Dataset. The dataset contains only the Author column from all observations in the input lib_books.csv dataset.