Are they the seeds to be nurtured to bring in automation, innovation and transformation. There is a saying, necessity is the mother of invention. I would say, innovation is amalgamation of creativity and necessity. We need to understand the ecosystem, to apply creativity and identify the ideas to bring in change. We need to be competent with changing ecosystem and think beyond the possible. What is the biggest challenge in doing this? "Unlearning and Learning", we think the current ecosystem is the best. Be it health, finserve, agriculture or mechanical domain, we need to emphasize with the stakeholders, to come up with the strategy to drive. The very evident example here is the quality of life is changing every millisecond. Few decades back the phone connection was limited to few, but today all the millennials are having a mobile phone. Now phone is not just a medium to talk, but are so powerful devices that an innovative solution can be developed on it.
Hello Data Experts,
Let me continue from my last blog http://outstandingoutlier.blogspot.in/2017/08/practical-usage-of-rstudio-features.html “Practical usage of RStudio features” where I had shared features for R Studio on windows platform.
Now that we are ready and familiar with R Studio, next steps are to make our-self comfortable with R Programming.
Let me start with a statement R programing is very much like how we operate calculator. We can also call R as a glorified calculator to start with.
Few basic tips to keep in mind while working on R:
· Comments start with “#” character.
# Below set of tips are very useful.
· No need to declare variable, assigning a value to a variable directly will work. Assignment of a value to a variable is done by left assign.
a <- 1
Please note there are 3 ways to assign a variable
Right Assign 25 -> b
Assign operator c = 24
Left Assign a <- 1
(Left assign is the best practice for R programing to do value assignment).
· Help can be invoked by prefixing “?” character.
?Foreign
· Data Type is assigned by R internally based on the value assigned to the variable.
Nu <- 1
St <- “How are you”
Bi <- TRUE
· R programming language is case sensitive, these are 2 different variables.
UC <- “UPPERCASE”
uc <- “LOWERCASE”
· R accepts “.” Character in variables, hence no need to have variable with underscore.
Height.inch <- 23
BASIC OPERATORS
Let us start with Data Operators, SUM, SUBSTRACTION, MULTIPLICATION and DIVISION. First let us assign values to variables
FV <- 2
SV <- 6
TV <- 3
SUM:
FV + SV
# FV + SV will result 8
SUBSTRACTION:
SV – TV
# SV – TV will result 3
DIVISION:
SV/TV
# SV/TV will result 2
MULTIPLICATION:
FV*TV
# FV*TV will result 6
ADVANCED OPERATORS
Let us use advanced operator, POWER, REMAINDER and QUOTIENT
POWER
TV^FV
# TV^FV will result 9, as it will be calculated as 3 to the power 2.
REMAINDER
TV%%FV
# This will result 1
QUOTIENT > DIVISION ADJUSTED TO WHOLE LFET
TV%/%FV
# This will result 1
RELATIONAL OPERATORS
Let us start with relation operator <, >, !=, ==, <= , >=
a <- 4
b <- 9
a < b
# This will TRUE
a > b
# This will FALSE
a != b
# This will TRUE
a == b
# This will FALSE
# we can also mix and match operators like
a <= b
# This will TRUE
a >= b
# This will FALSE
a => b
# THIS IS NOT THE RIGHT SYNTAX. HENCE WILL ERROR OUT.
I am sure this blog was useful and helped you understand How to use basic Operators using R. With this you are all set to go head and start practicing advance R using RStudio. In my next blog, I will begin with “Reading datasets using R Studio”.
I had kept this session light as it is important to have basics clear. Thank you being with me for this blog I hope it was helpful. Kindly share your valuable and kind opinion. Please do not forget to suggest what you would like to understand and hear from me in my future blogs.
Thank you...
Outstanding Outliers:: "AG".
Comments
Post a Comment