SlideShare a Scribd company logo
Variable Scope
 A variable’s scope is the set of places from which you can see the variable.
For example, when you define a variable inside a function, the rest of the
statements in that function will have access to that variable.
 In R subfunctions will also have access to that variable.
 In this next example, the function f takes a variable x and passes it to the
function g. f also defines a variable y, which is within the scope of g, since g
is a sub‐ function of f.
 So, even though y isn’t defined inside g, the example works:
 f <- function(x)
 {
 y <- 1
 g <- function(x)
 {
 (x + y) / 2 #y is used, but is not a formal argument of g }
 g(x)
 }
 f(sqrt(5)) #It works! y is magically found in the environment of f
 ## [1] 1.618
String Manipulation
 String manipulation basically refers to the process of
handling and analyzing strings.
 It involves various operations concerned with
modification and parsing of strings to use and change its
data.
 Paste:
 str <- paste(c(1:3), "4", sep = ":")
 print (str)
 ## "1:4" "2:4" "3:4"
 Concatenation:
 # Concatenation using cat() function
 str <- cat("learn", "code", "tech", sep = ":")
 print (str)
## learn:code:tech
Packages and Visualization
Loading and Packages
 R is not limited to the code provided by the R Core Team.
It is very much a community effort, and
 there are thousands of add-on packages available to
extend it.
 The majority of R packages are currently installed in an
online repository called CRAN (the Comprehensive R
Archive Network1)
 which is maintained by the R Core Team. Installing and
using these add-on packages is an important part of the R
experience
Loading Packages
 To load a package that is already installed on your
machine, you call the library function
 We can load it with the library function:
 library(lattice)
 the functions provided by lattice. For example,
displays a fancy dot plot of the famous Immer’s barley
dataset:
dotplot(
variety ~ yield | site,
data = barley,
groups = year
)
Scatter Plot
 A "scatter plot" is a type of plot used to display the relationship between two
numerical variables, and plots one dot for each observation.
 It needs two vectors of same length, one for the x-axis (horizontal) and one
for the y-axis (vertical):
 Example
 x <- c(5,7,8,7,2,2,9,4,11,12,9,6)
y <- c(99,86,87,88,111,103,87,94,78,77,85,86)
plot(x, y)
P<- ggplot(mtcars,aes(wt,mpg) )
p+geom_point()
P<- ggplot(mtcars,aes(wt,mpg) )
p+geom_line(color=blue)
Box_plot()
ggplot(data = mpg, aes(x = drv, y = hwy,
colour = class)) +
geom_boxplot()
Geom_bar()
g <- ggplot(mpg, aes(class))
# Number of cars in each class:
g + geom_bar()

More Related Content

PPTX
欧洲杯体彩-欧洲杯体彩足彩-欧洲杯体彩足彩竞猜|【​网址​🎉ac55.net🎉​】
PPTX
世预赛下注-世预赛下注投注-世预赛下注投注网|【​网址​🎉ac10.net🎉​】
PPTX
nba-nba买球推荐-nba买球推荐网站|【​网址​🎉ac10.net🎉​】
PPTX
欧洲杯投注-欧洲杯投注押注app-欧洲杯投注押注app官网|【​网址​🎉ac10.net🎉​】
PPTX
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
PPTX
欧洲杯足彩-欧洲杯足彩投注app-欧洲杯足彩下注app|【​网址​🎉ac22.net🎉​】
PPTX
美洲杯买球-美洲杯买球在哪个软件买球-美洲杯买球买球软件下载|【​网址​🎉ac55.net🎉​】
PPTX
欧洲杯体彩-网上怎么押注欧洲杯体彩-欧洲杯体彩押注app官网|【​网址​🎉ac99.net🎉​】
欧洲杯体彩-欧洲杯体彩足彩-欧洲杯体彩足彩竞猜|【​网址​🎉ac55.net🎉​】
世预赛下注-世预赛下注投注-世预赛下注投注网|【​网址​🎉ac10.net🎉​】
nba-nba买球推荐-nba买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯投注-欧洲杯投注押注app-欧洲杯投注押注app官网|【​网址​🎉ac10.net🎉​】
欧洲杯买球-欧洲杯买球买球推荐-欧洲杯买球买球推荐网站|【​网址​🎉ac10.net🎉​】
欧洲杯足彩-欧洲杯足彩投注app-欧洲杯足彩下注app|【​网址​🎉ac22.net🎉​】
美洲杯买球-美洲杯买球在哪个软件买球-美洲杯买球买球软件下载|【​网址​🎉ac55.net🎉​】
欧洲杯体彩-网上怎么押注欧洲杯体彩-欧洲杯体彩押注app官网|【​网址​🎉ac99.net🎉​】

Similar to 欧洲杯外围-欧洲杯外围开户-欧洲杯外围开户平台|【​网址​🎉ac55.net🎉​】 (20)

PPTX
世预赛投注-网上怎么押注世预赛投注-世预赛投注押注app官网|【​网址​🎉ac123.net🎉​】
PPTX
世预赛下注-世预赛下注投注-世预赛下注投注网|【​网址​🎉ac10.net🎉​】
PPTX
欧洲杯足彩-欧洲杯足彩买球从哪买-欧洲杯足彩买球去哪买|【​网址​🎉ac22.net🎉​】
PPTX
美洲杯投注-美洲杯投注比分-美洲杯投注比分投注|【​网址​🎉ac44.net🎉​】
PPTX
美洲杯投注-美洲杯投注买球投注官网-美洲杯投注买球官方官网|【​网址​🎉ac99.net🎉​】
PPTX
欧洲杯足彩-欧洲杯足彩买球平台-正规欧洲杯足彩买球平台|【​网址​🎉ac99.net🎉​】
PPTX
欧洲杯体彩-欧洲杯体彩足彩-欧洲杯体彩足彩竞猜|【​网址​🎉ac99.net🎉​】
PPTX
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
PPTX
欧洲杯足彩-欧洲杯足彩怎么押注-欧洲杯足彩押注怎么玩|【​网址​🎉ac22.net🎉​】
PPTX
世预赛下注-世预赛下注下注平台-世预赛下注投注平台|【​网址​🎉ac44.net🎉​】
PPTX
欧洲杯买球-欧洲杯买球猜球-欧洲杯买球猜球网站|【​网址​🎉ac10.net🎉​】
PPTX
世预赛投注-世预赛投注网投官网-世预赛投注投注网站|【​网址​🎉ac10.net🎉​】
PPTX
世预赛下注-世预赛下注比赛投注官网-世预赛下注投注官网app|【​网址​🎉ac44.net🎉​】
PPTX
欧洲杯竞猜-欧洲杯竞猜押注-欧洲杯竞猜押注官网|【​网址​🎉ac99.net🎉​】
PPTX
美洲杯投注-美洲杯投注竞猜app-竞猜美洲杯投注app|【​网址​🎉ac10.net🎉​】
PPTX
欧洲杯外围-欧洲杯外围下注网址-欧洲杯外围下注网站|【​网址​🎉ac44.net🎉​】
PPTX
欧洲杯体彩-欧洲杯体彩比分-欧洲杯体彩比分投注|【​网址​🎉ac44.net🎉​】
PPTX
欧洲杯足彩-欧洲杯足彩押注-欧洲杯足彩押注官网|【​网址​🎉ac99.net🎉​】
PPTX
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
PPTX
美洲杯投注-美洲杯投注外围投注-美洲杯投注外围投注平台|【​网址​🎉ac10.net🎉​】
世预赛投注-网上怎么押注世预赛投注-世预赛投注押注app官网|【​网址​🎉ac123.net🎉​】
世预赛下注-世预赛下注投注-世预赛下注投注网|【​网址​🎉ac10.net🎉​】
欧洲杯足彩-欧洲杯足彩买球从哪买-欧洲杯足彩买球去哪买|【​网址​🎉ac22.net🎉​】
美洲杯投注-美洲杯投注比分-美洲杯投注比分投注|【​网址​🎉ac44.net🎉​】
美洲杯投注-美洲杯投注买球投注官网-美洲杯投注买球官方官网|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩买球平台-正规欧洲杯足彩买球平台|【​网址​🎉ac99.net🎉​】
欧洲杯体彩-欧洲杯体彩足彩-欧洲杯体彩足彩竞猜|【​网址​🎉ac99.net🎉​】
欧洲杯外围-欧洲杯外围赛程-欧洲杯外围压注|【​网址​🎉ac99.net🎉​】
欧洲杯足彩-欧洲杯足彩怎么押注-欧洲杯足彩押注怎么玩|【​网址​🎉ac22.net🎉​】
世预赛下注-世预赛下注下注平台-世预赛下注投注平台|【​网址​🎉ac44.net🎉​】
欧洲杯买球-欧洲杯买球猜球-欧洲杯买球猜球网站|【​网址​🎉ac10.net🎉​】
世预赛投注-世预赛投注网投官网-世预赛投注投注网站|【​网址​🎉ac10.net🎉​】
世预赛下注-世预赛下注比赛投注官网-世预赛下注投注官网app|【​网址​🎉ac44.net🎉​】
欧洲杯竞猜-欧洲杯竞猜押注-欧洲杯竞猜押注官网|【​网址​🎉ac99.net🎉​】
美洲杯投注-美洲杯投注竞猜app-竞猜美洲杯投注app|【​网址​🎉ac10.net🎉​】
欧洲杯外围-欧洲杯外围下注网址-欧洲杯外围下注网站|【​网址​🎉ac44.net🎉​】
欧洲杯体彩-欧洲杯体彩比分-欧洲杯体彩比分投注|【​网址​🎉ac44.net🎉​】
欧洲杯足彩-欧洲杯足彩押注-欧洲杯足彩押注官网|【​网址​🎉ac99.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
美洲杯投注-美洲杯投注外围投注-美洲杯投注外围投注平台|【​网址​🎉ac10.net🎉​】
Ad

More from andreassenrolf537 (10)

PPT
竞猜欧洲杯app最好的-最好的竞猜欧洲杯app大全 |【​网址​🎉ac99.net🎉​】 .
PPT
十大世界杯投注台子-十大世界杯投注靠谱平台 |【​网址​🎉ac55.net🎉​】 .
PPT
十大美洲杯投注平台-世界十大美洲杯投注平台 |【​网址​🎉ac123.net🎉​】 .
PPT
欧洲杯盘口-欧洲杯盘口哪个平台好-欧洲杯盘口平台推荐 |【​网址​🎉ac99.net🎉​】
PPT
十大热门2024欧洲杯投注首页-十大2024欧洲杯投注网站 |【​网址​🎉ac10.net🎉​】
PPT
欧洲杯投注-欧洲杯投注押注平台-欧洲杯投注买球平台 |【​网址​🎉ac123.net🎉​】
PPT
欧洲杯投注app正规网站-推荐欧洲杯投注app正规网站 |【​网址​🎉ac55.net🎉​】
PPT
正规欧洲杯博彩下载-欧洲杯博彩正版下载 |【​网址​🎉ac22.net🎉​】 .
PPTX
欧洲杯冠军-欧洲杯冠军网站-欧洲杯冠军|【​网址​🎉ac123.net🎉​】领先全球的买球投注平台
PPTX
三昇体育-三昇体育欢迎您-三昇体育|【​网址​🎉ac123.net🎉​】领先全球的买球投注平台
竞猜欧洲杯app最好的-最好的竞猜欧洲杯app大全 |【​网址​🎉ac99.net🎉​】 .
十大世界杯投注台子-十大世界杯投注靠谱平台 |【​网址​🎉ac55.net🎉​】 .
十大美洲杯投注平台-世界十大美洲杯投注平台 |【​网址​🎉ac123.net🎉​】 .
欧洲杯盘口-欧洲杯盘口哪个平台好-欧洲杯盘口平台推荐 |【​网址​🎉ac99.net🎉​】
十大热门2024欧洲杯投注首页-十大2024欧洲杯投注网站 |【​网址​🎉ac10.net🎉​】
欧洲杯投注-欧洲杯投注押注平台-欧洲杯投注买球平台 |【​网址​🎉ac123.net🎉​】
欧洲杯投注app正规网站-推荐欧洲杯投注app正规网站 |【​网址​🎉ac55.net🎉​】
正规欧洲杯博彩下载-欧洲杯博彩正版下载 |【​网址​🎉ac22.net🎉​】 .
欧洲杯冠军-欧洲杯冠军网站-欧洲杯冠军|【​网址​🎉ac123.net🎉​】领先全球的买球投注平台
三昇体育-三昇体育欢迎您-三昇体育|【​网址​🎉ac123.net🎉​】领先全球的买球投注平台
Ad

Recently uploaded (20)

PPTX
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
PPTX
making presentation that do no stick.pptx
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PPTX
Nanokeyer nano keyekr kano ketkker nano keyer
PPTX
Syllabus Computer Six class curriculum s
PPTX
ERP good ERP good ERP good ERP good good ERP good ERP good
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PPTX
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
PPTX
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
PPTX
Lecture-3-Computer-programming for BS InfoTech
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
PPTX
Embedded for Artificial Intelligence 1.pptx
PDF
PPT Determiners.pdf.......................
PPTX
Embeded System for Artificial intelligence 2.pptx
PDF
Dynamic Checkweighers and Automatic Weighing Machine Solutions
PPTX
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
PPTX
Wireless and Mobile Backhaul Market.pptx
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PPT
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
making presentation that do no stick.pptx
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
Nanokeyer nano keyekr kano ketkker nano keyer
Syllabus Computer Six class curriculum s
ERP good ERP good ERP good ERP good good ERP good ERP good
A PROPOSAL ON IoT climate sensor 2.docx
PLC ANALOGUE DONE BY KISMEC KULIM TD 5 .0
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
Lecture-3-Computer-programming for BS InfoTech
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
Embedded for Artificial Intelligence 1.pptx
PPT Determiners.pdf.......................
Embeded System for Artificial intelligence 2.pptx
Dynamic Checkweighers and Automatic Weighing Machine Solutions
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
Wireless and Mobile Backhaul Market.pptx
"Fundamentals of Digital Image Processing: A Visual Approach"
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh

欧洲杯外围-欧洲杯外围开户-欧洲杯外围开户平台|【​网址​🎉ac55.net🎉​】

  • 1. Variable Scope  A variable’s scope is the set of places from which you can see the variable. For example, when you define a variable inside a function, the rest of the statements in that function will have access to that variable.  In R subfunctions will also have access to that variable.  In this next example, the function f takes a variable x and passes it to the function g. f also defines a variable y, which is within the scope of g, since g is a sub‐ function of f.
  • 2.  So, even though y isn’t defined inside g, the example works:  f <- function(x)  {  y <- 1  g <- function(x)  {  (x + y) / 2 #y is used, but is not a formal argument of g }  g(x)  }  f(sqrt(5)) #It works! y is magically found in the environment of f  ## [1] 1.618
  • 3. String Manipulation  String manipulation basically refers to the process of handling and analyzing strings.  It involves various operations concerned with modification and parsing of strings to use and change its data.  Paste:  str <- paste(c(1:3), "4", sep = ":")  print (str)  ## "1:4" "2:4" "3:4"  Concatenation:  # Concatenation using cat() function  str <- cat("learn", "code", "tech", sep = ":")  print (str) ## learn:code:tech
  • 5. Loading and Packages  R is not limited to the code provided by the R Core Team. It is very much a community effort, and  there are thousands of add-on packages available to extend it.  The majority of R packages are currently installed in an online repository called CRAN (the Comprehensive R Archive Network1)  which is maintained by the R Core Team. Installing and using these add-on packages is an important part of the R experience
  • 6. Loading Packages  To load a package that is already installed on your machine, you call the library function  We can load it with the library function:  library(lattice)  the functions provided by lattice. For example, displays a fancy dot plot of the famous Immer’s barley dataset: dotplot( variety ~ yield | site, data = barley, groups = year )
  • 7. Scatter Plot  A "scatter plot" is a type of plot used to display the relationship between two numerical variables, and plots one dot for each observation.  It needs two vectors of same length, one for the x-axis (horizontal) and one for the y-axis (vertical):  Example  x <- c(5,7,8,7,2,2,9,4,11,12,9,6) y <- c(99,86,87,88,111,103,87,94,78,77,85,86) plot(x, y)
  • 10. Box_plot() ggplot(data = mpg, aes(x = drv, y = hwy, colour = class)) + geom_boxplot()
  • 11. Geom_bar() g <- ggplot(mpg, aes(class)) # Number of cars in each class: g + geom_bar()