1. Home
  2. Training Library
  3. 9. Implicit Control Flow in R

Interacting with the clipboard in R

Developed with
QA

The course is part of this learning path

Fundamentals of R
course-steps 11 lab-steps 1 description 1
play-arrow
Start course
Overview
DifficultyBeginner
Duration31m
Students3
Ratings
5/5
star star star star star

Description

Course Description 

This module looks at how to control data in R, through reading, writing and loading objects in R.  

Learning Objectives 

The objectives of this module are to provide you with an understanding of: 

  • How to bring in data from a file in R  
  • Saving and loading objects in R  
  • Interacting with the clipboard  
  • How to connect to files in R  
  • How to read from a file in R  
  • How to write to a file in R  

Intended Audience 

Aimed at all who wish to learn the R programming language. 

Pre-requisites 

No prior knowledge of R is assumed 

Delegates should already be familiar with basic programming concepts such as variables, scope and functions 

Experience of another scripting language such as Python or Perl would be an advantage 

Understanding mathematical concepts will be beneficial 

Feedback 

We welcome all feedback and suggestions - please contact us at qa.elearningadmin@qa.com to let us know what you think. 

Transcript

- [Instructor] We can interact with the clipboard in R using two functions. Firstly, the write clipboard, and secondly, the read clipboard. The write clipboard function will allows us to copy to the clipboard. Let us note that the clipboard can only contain character vectors. So, here is a piece of data that I've created, a matrix. If I was to write this out to the clipboard, I would need to use the as character function to convert data into something that is applicable inside the write clipboard. I can paste this using the edit paste command or control V. And it show you that I have created a character vector and store this in the clipboard. I can use the read clipboard function, read, clipboard, function, to paste this data into R. I can store this as clip and I can show you what I have brought in. I've brought in a character vector. In order to return it back to the original data matrix. I would need to then convert this back into the matrix using the matrix constructor. And as you can see on the screen, clip now equals data, even though it left the R studio session into the clipboard and returned back via the read clipboard function.

About the Author

Students122
Labs1
Courses11
Learning paths1

Kunal has worked with data for most of his career, ranging from diffusion markov chain processes to migrating reporting platforms.  

Kunal has helped clients with early stage engagement and formed multi week training programme curriculum. 

Kunal has a passion for statistics and data; he has delivered training relating to Hypothesis Testing, Exploring Data, Machine Learning Algorithms, and the Theory of Visualisation. 

Data Scientist at a credit management company; applied statistical analysis to distressed portfolios. 

Business Data Analyst at an investment bank; project to overhaul the legacy reporting and analytics platform. 

Statistician within the Government Statistical Service; quantitative analysis and publishing statistical findings of emerging levels of council tax data. 

Structured Credit Product Control at an investment bank; developing, maintaining, and deploying a PnL platform for the CVA Hedging trading desk.