SlideShare a Scribd company logo
1 of 3
Download to read offline
4/16/2020 R Programming Lab - 3 - Jupyter Notebook
https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 1/3
R - Notebook [LAB EXPERIMENTS DEMONSTRATION] ---------------Prepared by - Asst. Prof.
Ashwini Mathur(CSSP)- Jain University
Following tasks to perform:
1. Calculate the interest earned after 5 years on an investment of $200
0, assuming an interest rate of 3% compounded annually.
2. Use R to calculate the area of a circle with radius 7 cm.
3. Do you think there is a difference between 48:14ห†2and 48:(14ห†2)?
4. Usin rep() and seq()as needed, create the vectors: 000001111122222333
3344444 and 1234512345123451234512345
5. Create the vector (00011110001111000111100011110001111) and convert i
t to a factor. Identify the levels of the result, and then change t
he level labels to obtain the factor:
Levels: Male Female
6. Use more.colors vector, rep() and seq() to create the vector
"red" "yellow" "blue" "yellow" "blue" "green"
"blue" "green" "magenta" "green" "magenta" "cyan"
Question 1. Calculate the interest earned after 5 years on an investment of $2000, assuming an
interest rate of 3% ompounded annually.
In [1]:
Question 2. Use R to calculate the area of a circle with radius 7 cm.
In [2]:
Question 3. Do you think there is a difference between 48:14^2and 48:(14^2)?
60 121.8 185.45 251.02 318.55 388.1 459.75 533.54 609.55 687.83 768.47 851.52
937.07 1025.18 1115.93 1209.41 1305.7 1404.87 1507.01 1612.22 1720.59 1832.21
1947.17 2065.59 2187.56 2313.18 2442.58 2575.86 2713.13 2854.52
153.9380400259
round(2000*(1.03^(1:30) - 1), 2)
r <- 7
area <- pi * r^2
area
4/16/2020 R Programming Lab - 3 - Jupyter Notebook
https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 2/3
In [3]:
Question 4. Using rep() and seq()as needed, create the vectors : 0000011111222223333344444
and 1234512345123451234512345
In [5]:
Question 5. Create the vector (00011110001111000111100011110001111) and convert it to a
factor. Identify the levels of the result, and then change the level labels to obtain the factor:
Assign the Levels: Male Female
In [4]:
48 47 46 45 44 43 42
144 141 138 135 132 129 126 123 120 117 114 111 108 105 102 99 96 93 90
87 84 81 78 75 72 69 66 63 60 57 54 51 48 45 42
0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1
1
#Yes, the parentheses are necessary, because the : has higher priority than the
#Second case the sequence is multiplied by 3.
48:(14*3)
48:14*3
rep(seq(0,4,1),times = 1,each = 5)
rep( 0:4, rep(5,5))
rep(seq(1,5,1),times = 5)
#5. Create the vector [1]00011110001111000111100011110001111
x <- rep( c(rep(0, 3), rep(1, 4)), 5)
x
4/16/2020 R Programming Lab - 3 - Jupyter Notebook
https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 3/3
In [6]:
Question 6. Use more.colors vector, rep() and seq() to create the vector
"red" "yellow" "blue" "yellow" "blue" "green" "blue" "green" "magenta"
"green" "magenta" "cyan"
In [9]:
0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1
1
Levels:
'0' '1'
male male male female female female female male male male female female female
female male male male female female female female male male male female female
female female male male male female female female female
Levels:
'red' 'yellow' 'blue' 'yellow' 'blue' 'green' 'blue' 'green' 'magenta' 'green' 'magenta' 'cyan'
#and convert it to a factor. Identify the levels of the result, and
#change the level labels to obtain the factor:
## [1] Male Male Male Female Female Female Female Male Male
## [10] Male Female Female Female Female Male Male Male Female
## [19] Female Female Female Male Male Male Female Female Female
## [28] Female Male Male Male Female Female Female Female
## Levels: Male Female
numbers = factor(rep(c(0,1,0,1,0,1,0,1,0,1),c(3,4,3,4,3,4,3,4,3,4)))
numbers
levels(numbers)=c('male','female')
numbers
more.colors <- c("red","yellow","blue","green","magenta","cyan")
more.colors[rep( seq(1,3), times = 4) + rep( seq(0,3), each=3)]

More Related Content

What's hot

Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to rJigsawAcademy2014
ย 
Lesson 15: Exponential Growth and Decay (Section 021 slides)
Lesson 15: Exponential Growth and Decay (Section 021 slides)Lesson 15: Exponential Growth and Decay (Section 021 slides)
Lesson 15: Exponential Growth and Decay (Section 021 slides)Matthew Leingang
ย 
Matlab ch1 (6)
Matlab ch1 (6)Matlab ch1 (6)
Matlab ch1 (6)mohsinggg
ย 
Statistics-Regression analysis
Statistics-Regression analysisStatistics-Regression analysis
Statistics-Regression analysisRabin BK
ย 
Credit Risk Assessment using Machine Learning Techniques with WEKA
Credit Risk Assessment using Machine Learning Techniques with WEKACredit Risk Assessment using Machine Learning Techniques with WEKA
Credit Risk Assessment using Machine Learning Techniques with WEKAMehnaz Newaz
ย 
Simple Linier Regression
Simple Linier RegressionSimple Linier Regression
Simple Linier Regressiondessybudiyanti
ย 
Introduction to Generalized Linear Models
Introduction to Generalized Linear ModelsIntroduction to Generalized Linear Models
Introduction to Generalized Linear Modelsrichardchandler
ย 
Chapter 6 simple regression and correlation
Chapter 6 simple regression and correlationChapter 6 simple regression and correlation
Chapter 6 simple regression and correlationRione Drevale
ย 

What's hot (8)

Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
ย 
Lesson 15: Exponential Growth and Decay (Section 021 slides)
Lesson 15: Exponential Growth and Decay (Section 021 slides)Lesson 15: Exponential Growth and Decay (Section 021 slides)
Lesson 15: Exponential Growth and Decay (Section 021 slides)
ย 
Matlab ch1 (6)
Matlab ch1 (6)Matlab ch1 (6)
Matlab ch1 (6)
ย 
Statistics-Regression analysis
Statistics-Regression analysisStatistics-Regression analysis
Statistics-Regression analysis
ย 
Credit Risk Assessment using Machine Learning Techniques with WEKA
Credit Risk Assessment using Machine Learning Techniques with WEKACredit Risk Assessment using Machine Learning Techniques with WEKA
Credit Risk Assessment using Machine Learning Techniques with WEKA
ย 
Simple Linier Regression
Simple Linier RegressionSimple Linier Regression
Simple Linier Regression
ย 
Introduction to Generalized Linear Models
Introduction to Generalized Linear ModelsIntroduction to Generalized Linear Models
Introduction to Generalized Linear Models
ย 
Chapter 6 simple regression and correlation
Chapter 6 simple regression and correlationChapter 6 simple regression and correlation
Chapter 6 simple regression and correlation
ย 

Similar to R LAB EXPERIMENTS

R programming lab 1 - jupyter notebook
R programming lab   1 - jupyter notebookR programming lab   1 - jupyter notebook
R programming lab 1 - jupyter notebookAshwini Mathur
ย 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordLakshmi Sarvani Videla
ย 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlabSalanSD
ย 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming languageAshwini Mathur
ย 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with RYanchang Zhao
ย 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro062MayankSinghal
ย 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningMasahiro Sakai
ย 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docxmercysuttle
ย 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfTulasiramKandula1
ย 
Smarter Measure ReflectionThis reflection paper is to be typed a.docx
Smarter Measure ReflectionThis reflection paper is to be typed a.docxSmarter Measure ReflectionThis reflection paper is to be typed a.docx
Smarter Measure ReflectionThis reflection paper is to be typed a.docxbudabrooks46239
ย 
0113 examia
0113 examia0113 examia
0113 examiapschlein
ย 
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...Breaking a Stick to form a Pentagon with Positive Integers using Programming ...
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...IRJET Journal
ย 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classificationYanchang Zhao
ย 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming languageLincoln Hannah
ย 
Build Your Own 3D Scanner: 3D Scanning with Structured Lighting
Build Your Own 3D Scanner: 3D Scanning with Structured LightingBuild Your Own 3D Scanner: 3D Scanning with Structured Lighting
Build Your Own 3D Scanner: 3D Scanning with Structured LightingDouglas Lanman
ย 

Similar to R LAB EXPERIMENTS (20)

R programming lab 1 - jupyter notebook
R programming lab   1 - jupyter notebookR programming lab   1 - jupyter notebook
R programming lab 1 - jupyter notebook
ย 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
ย 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlab
ย 
Descriptive analytics in r programming language
Descriptive analytics in r programming languageDescriptive analytics in r programming language
Descriptive analytics in r programming language
ย 
Regression and Classification with R
Regression and Classification with RRegression and Classification with R
Regression and Classification with R
ย 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
ย 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
ย 
QMC: Undergraduate Workshop, Tutorial on 'R' Software - Yawen Guan, Feb 26, 2...
QMC: Undergraduate Workshop, Tutorial on 'R' Software - Yawen Guan, Feb 26, 2...QMC: Undergraduate Workshop, Tutorial on 'R' Software - Yawen Guan, Feb 26, 2...
QMC: Undergraduate Workshop, Tutorial on 'R' Software - Yawen Guan, Feb 26, 2...
ย 
1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx1 Faculty of Computer Studies Information Technology a.docx
1 Faculty of Computer Studies Information Technology a.docx
ย 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdf
ย 
Learning R
Learning RLearning R
Learning R
ย 
Taller parcial 2
Taller parcial 2Taller parcial 2
Taller parcial 2
ย 
Smarter Measure ReflectionThis reflection paper is to be typed a.docx
Smarter Measure ReflectionThis reflection paper is to be typed a.docxSmarter Measure ReflectionThis reflection paper is to be typed a.docx
Smarter Measure ReflectionThis reflection paper is to be typed a.docx
ย 
0113 examia
0113 examia0113 examia
0113 examia
ย 
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...Breaking a Stick to form a Pentagon with Positive Integers using Programming ...
Breaking a Stick to form a Pentagon with Positive Integers using Programming ...
ย 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classification
ย 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
ย 
Build Your Own 3D Scanner: 3D Scanning with Structured Lighting
Build Your Own 3D Scanner: 3D Scanning with Structured LightingBuild Your Own 3D Scanner: 3D Scanning with Structured Lighting
Build Your Own 3D Scanner: 3D Scanning with Structured Lighting
ย 
Control charts
Control chartsControl charts
Control charts
ย 
Grade 10 tutorials
Grade 10 tutorialsGrade 10 tutorials
Grade 10 tutorials
ย 

More from Ashwini Mathur

S3 classes and s4 classes
S3 classes and s4 classesS3 classes and s4 classes
S3 classes and s4 classesAshwini Mathur
ย 
Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r Ashwini Mathur
ย 
Rpy2 demonstration
Rpy2 demonstrationRpy2 demonstration
Rpy2 demonstrationAshwini Mathur
ย 
R programming lab 2 - jupyter notebook
R programming lab   2 - jupyter notebookR programming lab   2 - jupyter notebook
R programming lab 2 - jupyter notebookAshwini Mathur
ย 
R for statistics session 1
R for statistics session 1R for statistics session 1
R for statistics session 1Ashwini Mathur
ย 
R for statistics 2
R for statistics 2R for statistics 2
R for statistics 2Ashwini Mathur
ย 
Play with matrix in r
Play with matrix in rPlay with matrix in r
Play with matrix in rAshwini Mathur
ย 
Object oriented programming in r
Object oriented programming in r Object oriented programming in r
Object oriented programming in r Ashwini Mathur
ย 
Linear programming optimization in r
Linear programming optimization in r Linear programming optimization in r
Linear programming optimization in r Ashwini Mathur
ย 
Introduction to python along with the comparitive analysis with r
Introduction to python   along with the comparitive analysis with r Introduction to python   along with the comparitive analysis with r
Introduction to python along with the comparitive analysis with r Ashwini Mathur
ย 
Example 2 summerization notes for descriptive statistics using r
Example   2    summerization notes for descriptive statistics using r Example   2    summerization notes for descriptive statistics using r
Example 2 summerization notes for descriptive statistics using r Ashwini Mathur
ย 
Descriptive statistics assignment
Descriptive statistics assignment Descriptive statistics assignment
Descriptive statistics assignment Ashwini Mathur
ย 
Data analysis for covid 19
Data analysis for covid 19Data analysis for covid 19
Data analysis for covid 19Ashwini Mathur
ย 
Correlation and linear regression
Correlation and linear regression Correlation and linear regression
Correlation and linear regression Ashwini Mathur
ย 
Calling c functions from r programming unit 5
Calling c functions from r programming    unit 5Calling c functions from r programming    unit 5
Calling c functions from r programming unit 5Ashwini Mathur
ย 
Anova (analysis of variance) test
Anova (analysis of variance) test Anova (analysis of variance) test
Anova (analysis of variance) test Ashwini Mathur
ย 

More from Ashwini Mathur (17)

S3 classes and s4 classes
S3 classes and s4 classesS3 classes and s4 classes
S3 classes and s4 classes
ย 
Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r Summerization notes for descriptive statistics using r
Summerization notes for descriptive statistics using r
ย 
Rpy2 demonstration
Rpy2 demonstrationRpy2 demonstration
Rpy2 demonstration
ย 
Rpy package
Rpy packageRpy package
Rpy package
ย 
R programming lab 2 - jupyter notebook
R programming lab   2 - jupyter notebookR programming lab   2 - jupyter notebook
R programming lab 2 - jupyter notebook
ย 
R for statistics session 1
R for statistics session 1R for statistics session 1
R for statistics session 1
ย 
R for statistics 2
R for statistics 2R for statistics 2
R for statistics 2
ย 
Play with matrix in r
Play with matrix in rPlay with matrix in r
Play with matrix in r
ย 
Object oriented programming in r
Object oriented programming in r Object oriented programming in r
Object oriented programming in r
ย 
Linear programming optimization in r
Linear programming optimization in r Linear programming optimization in r
Linear programming optimization in r
ย 
Introduction to python along with the comparitive analysis with r
Introduction to python   along with the comparitive analysis with r Introduction to python   along with the comparitive analysis with r
Introduction to python along with the comparitive analysis with r
ย 
Example 2 summerization notes for descriptive statistics using r
Example   2    summerization notes for descriptive statistics using r Example   2    summerization notes for descriptive statistics using r
Example 2 summerization notes for descriptive statistics using r
ย 
Descriptive statistics assignment
Descriptive statistics assignment Descriptive statistics assignment
Descriptive statistics assignment
ย 
Data analysis for covid 19
Data analysis for covid 19Data analysis for covid 19
Data analysis for covid 19
ย 
Correlation and linear regression
Correlation and linear regression Correlation and linear regression
Correlation and linear regression
ย 
Calling c functions from r programming unit 5
Calling c functions from r programming    unit 5Calling c functions from r programming    unit 5
Calling c functions from r programming unit 5
ย 
Anova (analysis of variance) test
Anova (analysis of variance) test Anova (analysis of variance) test
Anova (analysis of variance) test
ย 

Recently uploaded

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
ย 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
ย 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptDr. Soumendra Kumar Patra
ย 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
ย 
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...Delhi Call girls
ย 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
ย 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
ย 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Callshivangimorya083
ย 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
ย 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
ย 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
ย 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
ย 

Recently uploaded (20)

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
ย 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
ย 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
ย 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
ย 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
ย 
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )๐Ÿ” 9953056974๐Ÿ”(=)/CALL GIRLS SERVICE
ย 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
ย 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
ย 
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9205541914 ๐Ÿ”( Delhi) Escorts S...
ย 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
ย 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
ย 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
ย 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
ย 
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptxZuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
ย 
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 โ˜Žโœ”๐Ÿ‘Œโœ” Whatsapp Hard And Sexy Vip Call
ย 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
ย 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
ย 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
ย 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
ย 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
ย 

R LAB EXPERIMENTS

  • 1. 4/16/2020 R Programming Lab - 3 - Jupyter Notebook https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 1/3 R - Notebook [LAB EXPERIMENTS DEMONSTRATION] ---------------Prepared by - Asst. Prof. Ashwini Mathur(CSSP)- Jain University Following tasks to perform: 1. Calculate the interest earned after 5 years on an investment of $200 0, assuming an interest rate of 3% compounded annually. 2. Use R to calculate the area of a circle with radius 7 cm. 3. Do you think there is a difference between 48:14ห†2and 48:(14ห†2)? 4. Usin rep() and seq()as needed, create the vectors: 000001111122222333 3344444 and 1234512345123451234512345 5. Create the vector (00011110001111000111100011110001111) and convert i t to a factor. Identify the levels of the result, and then change t he level labels to obtain the factor: Levels: Male Female 6. Use more.colors vector, rep() and seq() to create the vector "red" "yellow" "blue" "yellow" "blue" "green" "blue" "green" "magenta" "green" "magenta" "cyan" Question 1. Calculate the interest earned after 5 years on an investment of $2000, assuming an interest rate of 3% ompounded annually. In [1]: Question 2. Use R to calculate the area of a circle with radius 7 cm. In [2]: Question 3. Do you think there is a difference between 48:14^2and 48:(14^2)? 60 121.8 185.45 251.02 318.55 388.1 459.75 533.54 609.55 687.83 768.47 851.52 937.07 1025.18 1115.93 1209.41 1305.7 1404.87 1507.01 1612.22 1720.59 1832.21 1947.17 2065.59 2187.56 2313.18 2442.58 2575.86 2713.13 2854.52 153.9380400259 round(2000*(1.03^(1:30) - 1), 2) r <- 7 area <- pi * r^2 area
  • 2. 4/16/2020 R Programming Lab - 3 - Jupyter Notebook https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 2/3 In [3]: Question 4. Using rep() and seq()as needed, create the vectors : 0000011111222223333344444 and 1234512345123451234512345 In [5]: Question 5. Create the vector (00011110001111000111100011110001111) and convert it to a factor. Identify the levels of the result, and then change the level labels to obtain the factor: Assign the Levels: Male Female In [4]: 48 47 46 45 44 43 42 144 141 138 135 132 129 126 123 120 117 114 111 108 105 102 99 96 93 90 87 84 81 78 75 72 69 66 63 60 57 54 51 48 45 42 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 #Yes, the parentheses are necessary, because the : has higher priority than the #Second case the sequence is multiplied by 3. 48:(14*3) 48:14*3 rep(seq(0,4,1),times = 1,each = 5) rep( 0:4, rep(5,5)) rep(seq(1,5,1),times = 5) #5. Create the vector [1]00011110001111000111100011110001111 x <- rep( c(rep(0, 3), rep(1, 4)), 5) x
  • 3. 4/16/2020 R Programming Lab - 3 - Jupyter Notebook https://hub.gke.mybinder.org/user/binder-examples-r-kagj2wsh/notebooks/R Programming Lab - 3.ipynb# 3/3 In [6]: Question 6. Use more.colors vector, rep() and seq() to create the vector "red" "yellow" "blue" "yellow" "blue" "green" "blue" "green" "magenta" "green" "magenta" "cyan" In [9]: 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 Levels: '0' '1' male male male female female female female male male male female female female female male male male female female female female male male male female female female female male male male female female female female Levels: 'red' 'yellow' 'blue' 'yellow' 'blue' 'green' 'blue' 'green' 'magenta' 'green' 'magenta' 'cyan' #and convert it to a factor. Identify the levels of the result, and #change the level labels to obtain the factor: ## [1] Male Male Male Female Female Female Female Male Male ## [10] Male Female Female Female Female Male Male Male Female ## [19] Female Female Female Male Male Male Female Female Female ## [28] Female Male Male Male Female Female Female Female ## Levels: Male Female numbers = factor(rep(c(0,1,0,1,0,1,0,1,0,1),c(3,4,3,4,3,4,3,4,3,4))) numbers levels(numbers)=c('male','female') numbers more.colors <- c("red","yellow","blue","green","magenta","cyan") more.colors[rep( seq(1,3), times = 4) + rep( seq(0,3), each=3)]