[SOLVED] UCS410 Lab 1-Basics of R programming

25.00 $

Programming resource
Digital learning resource
Category:
โœ“ Practical programming resource
โœ“ Suitable for guided study and reference
โœ“ Tutor guidance available when needed

Description

5/5 - (1 vote)

Experiment 1: Basics of R programming

We hope you already have R and RStudio installed in your computers. Good luck with your programming in R! Let us start with the very basics of R programming here in our first Lab ๐Ÿ™‚
If this is the first time, you are using R, then there is a lot to explore. You can try making codes for the following problems. This will give you a general idea of how to use R and over the next few labs you will learn more.

(1) Create a vector c = [5,10,15,20,25,30] and write a program which returns the maximum and minimum of this vector.
(2) Write a program in R to find factorial of a number by taking input from user. Please print error message if the input number is negative.
(4) Write an R program to make a simple calculator which can add, subtract, multiply and divide.
(5) Explore plot, pie, barplot etc. (the plotting options) which are built-in functions in R.

2

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.