Data Structures Exercises (Part 2)

[This article was first published on R-exercises, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In the Exercises we will cover Hashes, Factors and Zoo in R

Answers to the exercises are available here.

Learn more about Data Structures in the online course
R Data Pre-Processing & Data Management – Shape your Data!
. In this course you will learn how to:

  • Convert your data in R
  • Use SQL query embedded in R
  • Work with different data management packages like dplyr
  • And much more

Exercise 1

Create a Hash based Key Value Pairs with three employees, with Employees as the key and the name as the values.

Exercise 2

Create Hash of an Employee with the Name, Age, Address & SSN as the key and the details of the employee as the values

Exercise 3

Create Hash and use names function to give names to the key.

Exercise 4

Create a factor based on marks of students and print the summary of the same.

Exercise 5

Create a factor based on heights and print the levels and summary for the heights factor

Exercise 6

Create a factors of 10 random values between 1 and 100, with on repeating values and also check the variable is a factor

Exercise 7

Create a factor based on Age of students and plot a graph based on the age.

Exercise 8

Create a random factor based on 0 & 1 and give assign false for 0 and true for 1 and check the variable by print the type of the variable.

Exercise 9

Create a random factor based on 0 & 1 and give assign false for 0 and true for 1 and assign new 11 the value as False.

Exercise 10

Create a data Frame of dates and return of company and use zoo
to convert the data.

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)