Introduction

These are som practice works in R programming

Day 1

12-July-2021

  1. Create and save new script with name 'first class'

  2. Assign value 36475 to variable name 'First_variable'

  3. Add the following numbers 176.25, 23, 168476

  4. Subtract 143287 from 74367

  5. Multiply 175 with 83645

  6. Find 27365^23

  7. Divide 97 by 79

  8. Store the values 221, 442, 663, 884, 1105 to a vector with name 'Counts'

  9. Multiply Counts with 2

Day 2

13-July-2021

  1. Create a vector with 20 elements in it and find its sum

  2. Create a matrix with 18 elements with 6 rows both by row and column wise

  3. Access 3rd row 3rd column element of it

  4. Access 5th row 2nd column element of it

  5. Access 2nd row 1st column element of it

  6. Install packages 'ggplot2' and 'plotly'

Day 3

14-July-2021

  1. Set working directory to a folder (create ) called Data Science

  2. Create a vector with any number of elements of choice and find the number of elements in it using command, find sum of the elements and find average

  3. Create a vector of strings with any number of elements of choice and find the number of elements in it using command.

  4. Use any data set from R (find using data()) and find its dimension and structure.

  5. store 990 in a variable name and use class() function to find the class it is stored

  6. Create 2 matrices of same size preferably square matrix. Display their dimension and find transpose and trace.

Day 4

15-July-2021

  1. Create and save a new script with your name and date and do the following operations

  2. Assign a value 279857 to a variable name 'number_of_persons_in_college'

  3. Add the following numbers 6187.599, 23, 9648200.01

  4. Subtract 143287 from 74376

  5. Multiply 999 with 1200

  6. Find 2953^3

  7. Divide 97 by 23

  8. Store the values 221,442,663,884,1105 to a vector with name "kilometers"

  9. Find thrice the times of kilometers

  10. Create a vector with 7 elements in it and find its sum

  11. Create a matrix with 16 elements with 4 rows both by row and column wise store it as Ex1 and Ex2

  12. Access 3rd row 3rd column element of the matrices

  13. Access 4th row 2nd column element of them

  14. Access 2nd row 1st column element of them

  15. Set working directory to a folder (create ) called Data Science

  16. Create a vector with any number of elements of choice and find the number of elements in it using command, find sum of elements and find average using command

  17. Create a vector of strings with any number of elements of choice and find the number of elements in it using command

  18. Use iris data set and find its dimension and structure and summary.

  19. Display its 5th column

  20. Display 80th Row

  21. Access 4th column 3rd row element

  22. Create 3 matrices of same size preferably square matrix

  23. Display their dimension and find transpose and trace

Day 5

16-July-2021

Week 1 assignment Please go through the questions carefully and answer. some questions might be tricky

  1. Create a sequence of consecutive numbers starting from

    • 1:100

    • 207.6 to 22

    • -22.78 to 28 (please comment what is the difference between the numbers in the sequence)

  2. Create a sequence of 70 numbers starting from 260085.23 to 1961029

  3. Create a matrix with elements from 10 to 20000 (size of matrix should be 50x20)

  4. Display the matrix

  5. Display 3rd column 20th row element

  6. Create the following vectors

    • science with values 1,2,3,4

    • maths with values 29,43,37,199

  7. Find sum, difference, element wise product and dot product of the vectors

  8. Create two matrices of size 5x5 perform all matrix operations discussed so far

  9. Assign any new data of your choice (which is not discussed in class)

  10. Display dimension of data

  11. Obtain a glimpse of data using code

  12. Subset 5th row from data

  13. Display each column in data using names

  14. Summarize the data

  15. Create a string vector with elements 1,12,32,'key'

  16. Save a value 9000 to variable_1

  17. Save '9000' to variable_2

  18. Save 1909 to variable_3

  19. Compare the above 3 variables for equality, inequality, less than, greater than

  20. Check whether 99.101 is present in Sepal.Width column of iris data

  21. Send a small write up in a word file about your understanding of data types with examples around you

Week 3 work 1

26-July-2021

  1. Use appropriate operator to find whether 1.072 exists or not in "density" variable of 'DNase' dataset

  2. Store values 990,2564,331 to a variable "distance" and convert it to string

  3. Store values "22","223","34239789670" to a variable "numbers" and Convert it to numbers and find their total and average.

  4. Compute descriptive statistics for "DNase" data (Summarise it)

  5. Give the dimension of data

  6. Subset 24,54,39,100 th rows from data in single code

Week 3 work 2

27-July-2021

  1. Use operator -> for assignment below

    • Assign 547 to name- total

    • Assign 345 to name- Present

    • Assign string 'Welcome to class' to name- greet

  2. Use operator <- for assignment below

    • Assign 225,110,150 to name- CC

    • Assign 175,117,158 to name- weight

    • Assign string "fastest","medium","fast" to name- nature

  3. Create matrices of size 3x3

    • Using vector as input

    • Using sequence as input

    • Using string vector 'The', 'purpose', 'of', 'our', 'lives', 'is', 'to', 'be', 'happy' as input

  4. Create 4 different arrays of size of your choice

  5. Load Credit Dataset in to R

    • Display summary

    • Display dimension

    • Display structure

Week 3 work 3

28-July-2021

  1. Set working directory to a new folder with name 'assignments'

  2. Create a list with number elements of your choice with different types of elements in them

  3. Assign single values to variable names A,B and C Perform all combinations of logical operations

  4. Load Wage data and find Structure,dimension and descriptive statistics

  5. Obtain barplot of variables region, education, race

    • Give title, axes labels and play around with color

Week 3 work 4

29-July-2021

  1. Load Credit dataset to R

  2. Display Barplot of Ethnicity.

    • Change color,title,axes names, subtitle,borderobtain horizontal plot
  3. Histogram for Balance

    • Change color,title,axes names, subtitle
  4. Histogram for Income

    • change color,title,axes names, subtitle, change break value
  5. Scatter plot of Limit and Balance

    • Change color,title,axes names, subtitle
  6. Scatter plot of Limit and Balance

    • Give color based on Ethnicity
    • Give title,axes names, subtitle,
  7. Obtain pie chart of Ethnicity

    • Customise color
  8. Choose any 4 different plots and display in single window

Week 3 final

31-July-2021

  1. Check for current working directory and set working directory to a folder of your choice

  2. Store values

    • 7088000 to name People

    • 1189 to name Area

    • Chennai to name Place

Perform logical operations for all combination of 3 variables above

  • Less than

  • Less than or equal to

  • Greater than

  • Greater than or equal to

  • Check for equality

  • Check for inequality

  1. Create a vector of elements of your choice and find number of elements in it, total and average

  2. Create 2 vectors of numbers of 25 elements

    • Find sum, difference, element wise product and dot product
  3. Create a matrix of size 5X5 using vector of numbers and store it to mat_a

  4. Create a matrix of size 5X5 using sequence and store it to mat_b

    • Perform matrix addition, subtraction, element wise multiplication and matrix multiplication
  5. Load iris dataset

    • Display dimension, structure

    • Find Descriptive statistics

    • Obtain histogram of Sepal.length

    • Barplot of species

    • Scatter plot of petal.length and petal.width

  6. Load Wage csv dataset

    • Select 2 quantitative variables and obtain
    • Scatter plot, give title, axes labels, change color

    • Use education and obtain barplot
    • specify title, axes label, color etc

    • Use maritl and obtain pie diagram
    • customise color and radius

  7. Try different types of scatter plots with pressure dataset using variables temperature and pressure

  8. Display 4 different plots in single window

Single Numeric

15-Aug-2021
To be submitted on 16-Aug-2021

  1. Consider 'Midwest' dataset

  2. Prepare META DATA

  3. Explore the quantitaive variables in data using both Visual and Numerical summary measures

  4. Prepare an html file with your insights.