0% found this document useful (0 votes)
186 views52 pages

R Data Analysis for Beginners

The document shows various R code examples for data manipulation and visualization. Some key examples include: loading data from files using read.table(); examining data structure using dim(), head(), tail(); subsetting data frames using [ ]; transforming data between numeric, factor and logical types; creating basic plots like bar plots, pie charts and histograms; and installing and loading packages like ggplot2.

Uploaded by

koustav naha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views52 pages

R Data Analysis for Beginners

The document shows various R code examples for data manipulation and visualization. Some key examples include: loading data from files using read.table(); examining data structure using dim(), head(), tail(); subsetting data frames using [ ]; transforming data between numeric, factor and logical types; creating basic plots like bar plots, pie charts and histograms; and installing and loading packages like ggplot2.

Uploaded by

koustav naha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

x1= c(1,3,5,7,9)

x1= c("male","female","hijra")
9:34
sec(2:90)
sec(from=1,to=8,by=1)
rep(seq(from=1,to=8,by=1/2),times =5)
rep(c("male","female","hijra"),times =9)
y[6]
y[-6]
y[-c(1,5)]
y[y<6]
matrix(c(1,2,3,4,5,6,7,8,9),nrow=3,byrow=TRUE)
> matrix(c(1,2,3,4,5,6,7,8,9),nrow=3,byrow=FALSE)
MAT[3,2]
MAT[c(3,2),2]
MAT[,2]
data1=read.table(file="C:/Users/hp/Desktop/it business analyst/rdata.txt",header=
TRUE, sep="")
data2 =read.data1
data2 =read.table(file.choose(), header=TRUE, sep="")
View(data2)
dim(data2)
head(data2)
tail(data2)
data2[-c(2:220),]
mean(data2$sed)
attach(data2)
mean(sed)
summary(data2)
class(sed)
factor(sed)
levels(temp)
x=as.factor(x)
temp1=temp>7

install.packages("ggplot2")
library(ggplot2)
view(diamond)

barplot(percent)
barplot(percent, main = "TITLE", xlab = "gender", ylab = "%")
percent = table(Gender)/725
barplot(percent, main = "TITLE", xlab = "gender", ylab = "%")
barplot(percent, main = "TITLE", xlab = "ge
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%", las= 1, names.arg=
c("FEMALE","MALE"))
pie(count)
> pie(count, main = "title goes here")
> box()
> hist(LungCap, freq = F, las = 1, main = c(0.02,0.04,0.06,0.08))
> hist(LungCap, freq = F, las = 1, main = c("pagla hawa"), ylab="amar
mon",xlab="badol dine pagol e")
> lines(density(LungCap),col =2, lwd = 4)

> datadcience = read.table(file.chose(), header = TRUE, SEP="/t")


Error in read.table(file.chose(), header = TRUE, SEP = "/t") :
unused argument (SEP = "/t")
> datadcience = read.table(file.chose(), header = TRUE, sep="/t")
Error in file.chose() : could not find function "file.chose"
> datadcience = read.table(file.choose(), header = TRUE, sep="/t")
Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1, quiet = TRUE,
:
invalid 'sep' value: must be one byte
In addition: Warning message:
In read.table(file.choose(), header = TRUE, sep = "/t") :
incomplete final line found by readTableHeader on 'C:\Users\hp\Desktop\it
business analyst\r coding\LungCapData.xls'
> View(datadcience)
Error in as.data.frame(x) : object 'datadcience' not found
> datascience = read.table(file.choose(), header = TRUE, sep="/t")
Error in scan(file, what = "", sep = sep, quote = quote, nlines = 1, quiet = TRUE,
:
invalid 'sep' value: must be one byte
In addition: Warning message:
In read.table(file.choose(), header = TRUE, sep = "/t") :
incomplete final line found by readTableHeader on 'C:\Users\hp\Desktop\it
business analyst\r coding\LungCapData.xls'
> datascience = read.table(file.choose(), header = TRUE, sep="\t")
Warning message:
In read.table(file.choose(), header = TRUE, sep = "\t") :
incomplete final line found by readTableHeader on 'C:\Users\hp\Desktop\it
business analyst\r coding\LungCapData.xls'
> datascience = read.table(file.choose(), header = TRUE, sep="\t")
> View(datascience)
> attach(datascience)
> dim(datascience)
[1] 725 6
> class(geder)
Error: object 'geder' not found
> class(gender)
Error: object 'gender' not found
> class(Gender)
[1] "factor"
> table(Gender)
Gender
female male
358 367
> count = table(Gender)
> count
Gender
female male
358 367
> table(Gender)/725
Gender
female male
0.4937931 0.5062069
> percent = table(Gender)
> barplot(count)
> barplot(percent)
> barplot(percent)
> barplot(count)
> barplot(count)
> q()
> barplot(percent)
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%")
> percent = table(Gender)/725
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%")
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%", las= 1)
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%", las= 1, names.arg=
("FEMALE","MALE"))
Error: unexpected ',' in "barplot(percent, main = "TITLE", xlab = "gender", ylab =
"%", las= 1, names.arg= ("FEMALE","
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "%", las= 1,
names.arg=c("FEMALE","MALE"))
> barplot(percent, main = "TITLE", xlab = "gender", ylab = "frequency %", las= 1,
names.arg=c("FEMALE","MALE"))
> pie(count)
> pie(count, main = "title goes here")
>
>
>
>
>
>
> box(count)
Error in box(count) : invalid 'which' argument
> box()
> hist(datascience)
Error in hist.default(datascience) : 'x' must be numeric
> attach(datascience)
The following objects are masked from datascience (pos = 3):

Age, Caesarean, Gender, Height, LungCap, Smoke

> datascience = read.table(file.choose(), header = TRUE, sep="\t")


> Veiw(datascience)
Error in Veiw(datascience) : could not find function "Veiw"
> View(datascience)
> hist(datascience)
Error in hist.default(datascience) : 'x' must be numeric
> hist(LungCap)
> hist(LungCap, freq = "F")
Error in freq && !equidist : invalid 'x' type in 'x && y'
> hist(LungCap, freq = f)
Error in hist.default(LungCap, freq = f) : object 'f' not found
> hist(LungCap, freq = F)
> hist(LungCap, freq = "F", las = 1)
Error in freq && !equidist : invalid 'x' type in 'x && y'
> hist(LungCap, freq = F, las = 1)
> hist(LungCap, freq = F, las = 1, main = c(0.02,0.04,0.06,0.08))
> hist(LungCap, freq = F, las = 1, main = c(pagla hawa))
Error: unexpected symbol in "hist(LungCap, freq = F, las = 1, main = c(pagla hawa"
> hist(LungCap, freq = F, las = 1, main = c("pagla hawa"))
> hist(LungCap, freq = F, las = 1, main = c("pagla hawa"), ylab="amar
mon",xlab="badol dine pagol e")
> lines(density(LungCap)
+ )
> lines(density(LungCap),col =2, lwd = 4)
> install.packages("ggplot2")
Installing package into �C:/Users/hp/Documents/R/win-library/3.6�
(as �lib� is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies �colorspace�, �utf8�, �Rcpp�, �farver�,
�labeling�, �munsell�, �viridisLite�, �lifecycle�, �pillar�, �pkgconfig�, �vctrs�,
�gtable�, �isoband�, �scales�, �tibble�
There is a binary version available but the source version is later:
binary source needs_compilation
pillar 1.4.3 1.4.4 FALSE

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/colorspace_1.4-1.zip'
Content type 'application/zip' length 2550276 bytes (2.4 MB)
downloaded 2.4 MB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/utf8_1.1.4.zip'
Content type 'application/zip' length 215093 bytes (210 KB)
downloaded 210 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/Rcpp_1.0.4.6.zip'
Content type 'application/zip' length 3031067 bytes (2.9 MB)
downloaded 2.9 MB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/farver_2.0.3.zip'
Content type 'application/zip' length 1912129 bytes (1.8 MB)
downloaded 1.8 MB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/labeling_0.3.zip'
Content type 'application/zip' length 62937 bytes (61 KB)
downloaded 61 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/munsell_0.5.0.zip'
Content type 'application/zip' length 245447 bytes (239 KB)
downloaded 239 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/viridisLite_0.3.0.zip
'
Content type 'application/zip' length 60721 bytes (59 KB)
downloaded 59 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/lifecycle_0.2.0.zip'
Content type 'application/zip' length 101616 bytes (99 KB)
downloaded 99 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/pkgconfig_2.0.3.zip'
Content type 'application/zip' length 22330 bytes (21 KB)
downloaded 21 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/vctrs_0.2.4.zip'
Content type 'application/zip' length 1027373 bytes (1003 KB)
downloaded 1003 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/gtable_0.3.0.zip'
Content type 'application/zip' length 434486 bytes (424 KB)
downloaded 424 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/isoband_0.2.1.zip'
Content type 'application/zip' length 3304536 bytes (3.2 MB)
downloaded 3.2 MB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/scales_1.1.0.zip'
Content type 'application/zip' length 554516 bytes (541 KB)
downloaded 541 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/tibble_3.0.1.zip'
Content type 'application/zip' length 411838 bytes (402 KB)
downloaded 402 KB

trying URL
'http://mirror.its.sfu.ca/mirror/CRAN/bin/windows/contrib/3.6/ggplot2_3.3.0.zip'
Content type 'application/zip' length 4021699 bytes (3.8 MB)
downloaded 3.8 MB

package �colorspace� successfully unpacked and MD5 sums checked


package �utf8� successfully unpacked and MD5 sums checked
package �Rcpp� successfully unpacked and MD5 sums checked
package �farver� successfully unpacked and MD5 sums checked
package �labeling� successfully unpacked and MD5 sums checked
package �munsell� successfully unpacked and MD5 sums checked
package �viridisLite� successfully unpacked and MD5 sums checked
package �lifecycle� successfully unpacked and MD5 sums checked
package �pkgconfig� successfully unpacked and MD5 sums checked
package �vctrs� successfully unpacked and MD5 sums checked
package �gtable� successfully unpacked and MD5 sums checked
package �isoband� successfully unpacked and MD5 sums checked
package �scales� successfully unpacked and MD5 sums checked
package �tibble� successfully unpacked and MD5 sums checked
package �ggplot2� successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\hp\AppData\Local\Temp\RtmpcDs5P7\downloaded_packages
installing the source package �pillar�

trying URL 'http://mirror.its.sfu.ca/mirror/CRAN/src/contrib/pillar_1.4.4.tar.gz'


Content type 'application/x-gzip' length 231021 bytes (225 KB)
downloaded 225 KB

* installing *source* package 'pillar' ...


** package 'pillar' successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'pillar'
finding HTML links ... done
colonnade html
deprecated html
Rd warning:
C:/Users/hp/AppData/Local/Temp/Rtmp4qSTo9/R.INSTALL1be054a948bd/pillar/man/deprecat
ed.Rd:16: file link 'vec_is' in package 'vctrs' does not exist and so has been
treated as a topic
dim_desc html
expect_known_display html
extra_cols html
format_type_sum html
get_extent html
new_ornament html
finding level-2 HTML links ... done

new_pillar_shaft html
new_pillar_title html
new_pillar_type html
pillar-package html
pillar html
pillar_shaft html
style_subtle html
type_sum html
Rd warning:
C:/Users/hp/AppData/Local/Temp/Rtmp4qSTo9/R.INSTALL1be054a948bd/pillar/man/type_sum
.Rd:21: file link 'vec_ptype_abbr' in package 'vctrs' does not exist and so has
been treated as a topic
Rd warning:
C:/Users/hp/AppData/Local/Temp/Rtmp4qSTo9/R.INSTALL1be054a948bd/pillar/man/type_sum
.Rd:28: file link 'vec_ptype_abbr' in package 'vctrs' does not exist and so has
been treated as a topic
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (pillar)

The downloaded source packages are in


�C:\Users\hp\AppData\Local\Temp\RtmpcDs5P7\downloaded_packages�
> library(ggplot2)
> view(diamond)
Error in view(diamond) : could not find function "view"
> View(diamond)
Error in as.data.frame(x) : object 'diamond' not found
> View(diamonds)
> head(diamonds)
# A tibble: 6 x 10
carat cut color clarity depth table price x y z
<dbl> <ord> <ord> <ord> <dbl> <dbl> <int> <dbl> <dbl> <dbl>
1 0.23 Ideal E SI2 61.5 55 326 3.95 3.98 2.43
2 0.21 Premium E SI1 59.8 61 326 3.89 3.84 2.31
3 0.23 Good E VS1 56.9 65 327 4.05 4.07 2.31
4 0.290 Premium I VS2 62.4 58 334 4.2 4.23 2.63
5 0.31 Good J SI2 63.3 58 335 4.34 4.35 2.75
6 0.24 Very Good J VVS2 62.8 57 336 3.94 3.96 2.48
> dim/9diamonds)
Error: unexpected symbol in "dim/9diamonds"
> dim)diamonds)
Error: unexpected ')' in "dim)"
> dim(diamonds)
[1] 53940 10
> datascience = read.table(file.choose(), header = TRUE, sep="\t")
> View(datascience)
> hist("Age")
Error in hist.default("Age") : 'x' must be numeric
> attach(datascience)
The following objects are masked from datascience (pos = 4):

Age, Caesarean, Gender, Height, LungCap, Smoke

The following objects are masked from datascience (pos = 5):

Age, Caesarean, Gender, Height, LungCap, Smoke

> load(datascience)
Error in load(datascience) : bad 'file' argument
> head(datascience)
LungCap Age Height Smoke Gender Caesarean
1 6.475 6 62.1 no male no
2 10.125 18 74.7 yes female no
3 9.550 16 69.7 no female yes
4 11.125 14 71.0 no male no
5 4.800 5 56.9 no male no
6 6.225 11 58.7 no female no
> hist(datascience, frequency = T, las = 1)
Error in hist.default(datascience, frequency = T, las = 1) :
'x' must be numeric
> hist(LungCap, frequency = T, las = 1)
Warning messages:
1: In plot.window(xlim, ylim, "", ...) :
"frequency" is not a graphical parameter
2: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
"frequency" is not a graphical parameter
3: In axis(1, ...) : "frequency" is not a graphical parameter
4: In axis(2, ...) : "frequency" is not a graphical parameter
> hist(LungCap, freq = F, las = 1)
> hist(LungCap, freq = F, las = 1)
> head(datascience)
LungCap Age Height Smoke Gender Caesarean
1 6.475 6 62.1 no male no
2 10.125 18 74.7 yes female no
3 9.550 16 69.7 no female yes
4 11.125 14 71.0 no male no
5 4.800 5 56.9 no male no
6 6.225 11 58.7 no female no
> femaledatascience = datascience(Gender = "female")
Error in datascience(Gender = "female") :
could not find function "datascience"
> femaledatascience = datascience(Gender == "female")
Error in datascience(Gender == "female") :
could not find function "datascience"
> femaledatascience = datascience[Gender == "female"]
Error in `[.data.frame`(datascience, Gender == "female") :
undefined columns selected
> names(datascience)
[1] "LungCap" "Age" "Height" "Smoke" "Gender" "Caesarean"
> femaledatascience = LungCap[Gender == "female"]
> stem(femaledatascience)
The decimal point is at the |

0 | 5
1 | 0134689
2 | 0033455667789999
3 | 0122457788999999
4 | 012333334555555666677777889
5 | 0000122222334455666777778899
6 | 000000111122222222233345555555666667777777788888889999
7 | 000123333333444445555556667778888888899999
8 | 000000001111122222333333333444555556666666666777777888888888889
9 | 000000001112222333334444555666677778888888999999
10 | 00111112223344455556667777788999
11 | 0111223556678888
12 | 1222479
13 | 1

> stem(femaledatascience,scale = 2)

The decimal point is at the |

0 | 5
1 | 0134
1 | 689
2 | 00334
2 | 55667789999
3 | 01224
3 | 57788999999
4 | 012333334
4 | 555555666677777889
5 | 00001222223344
5 | 55666777778899
6 | 00000011112222222223334
6 | 5555555666667777777788888889999
7 | 00012333333344444
7 | 5555556667778888888899999
8 | 000000001111122222333333333444
8 | 555556666666666777777888888888889
9 | 000000001112222333334444
9 | 555666677778888888999999
10 | 001111122233444
10 | 55556667777788999
11 | 0111223
11 | 556678888
12 | 12224
12 | 79
13 | 1

> table(Smoke,Gender)
Gender
Smoke female male
no 314 334
yes 44 33
> table(Smoke,Gender, LungCap)
, , LungCap = 0.507

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.025

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.125

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.175

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 1.325

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.45

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.575

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 1.625

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.675

Gender
Smoke female male
no 0 1
yes 0 0
, , LungCap = 1.775

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.85

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 1.9

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 1.925

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 1.95

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 2

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.025

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.25

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 2.375

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.475

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.55

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.625

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 2.65

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 2.725

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 2.825

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.85

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 2.875

Gender
Smoke female male
no 1 2
yes 0 0
, , LungCap = 2.925

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 2.95

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.025

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 3.1

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 3.175

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 3.225

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 3.25

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.4

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.425
Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 3.45

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 3.6

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.625

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.65

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 3.675

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 3.7

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 3.75

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 3.825

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 3.85

Gender
Smoke female male
no 0 0
yes 1 0

, , LungCap = 3.9

Gender
Smoke female male
no 2 0
yes 1 0

, , LungCap = 3.925

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 3.975

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 4.075

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 4.125

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.15

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.2

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 4.25
Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 4.325

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 4.35

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.425

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 4.45

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 4.475

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 4.5

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.525

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.55

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.575

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.625

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 4.65

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.7

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 4.725

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 4.775

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 4.8

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 4.825

Gender
Smoke female male
no 0 1
yes 0 0
, , LungCap = 4.85

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 4.875

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 4.9

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 4.95

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 4.975

Gender
Smoke female male
no 0 2
yes 1 0

, , LungCap = 5.025

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 5.05

Gender
Smoke female male
no 0 3
yes 0 0

, , LungCap = 5.075

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.125

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.15

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 5.175

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.2

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.225

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 5.25

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 5.275

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.3

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.325

Gender
Smoke female male
no 1 1
yes 0 0
, , LungCap = 5.35

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.375

Gender
Smoke female male
no 0 2
yes 1 0

, , LungCap = 5.425

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.475

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.5

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 5.55

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 5.575

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.6

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.625
Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.65

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 5.675

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.7

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.725

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 5.775

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 5.825

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 5.85

Gender
Smoke female male
no 1 3
yes 0 0

, , LungCap = 5.875

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 5.95

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 6

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 6.05

Gender
Smoke female male
no 3 1
yes 0 0

, , LungCap = 6.075

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 6.1

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 6.125

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 6.15

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 6.175

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 6.2
Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 6.225

Gender
Smoke female male
no 2 1
yes 1 0

, , LungCap = 6.25

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 6.275

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 6.3

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 6.325

Gender
Smoke female male
no 1 0
yes 0 1

, , LungCap = 6.375

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 6.4

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 6.425

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 6.45

Gender
Smoke female male
no 1 3
yes 1 2

, , LungCap = 6.475

Gender
Smoke female male
no 1 1
yes 1 0

, , LungCap = 6.5

Gender
Smoke female male
no 0 1
yes 1 0

, , LungCap = 6.525

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 6.55

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 6.575

Gender
Smoke female male
no 2 0
yes 1 1

, , LungCap = 6.6

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 6.625

Gender
Smoke female male
no 1 1
yes 0 0
, , LungCap = 6.65

Gender
Smoke female male
no 0 0
yes 2 0

, , LungCap = 6.675

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 6.7

Gender
Smoke female male
no 2 2
yes 1 0

, , LungCap = 6.725

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 6.75

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 6.775

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 6.8

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 6.825

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 6.85

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 6.9

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 6.925

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 6.95

Gender
Smoke female male
no 1 3
yes 0 0

, , LungCap = 6.975

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 7

Gender
Smoke female male
no 0 1
yes 0 1

, , LungCap = 7.025

Gender
Smoke female male
no 1 0
yes 1 0

, , LungCap = 7.05

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 7.075

Gender
Smoke female male
no 0 1
yes 0 0
, , LungCap = 7.1

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 7.125

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.15

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 7.175

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.2

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.225

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 7.25

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 7.275

Gender
Smoke female male
no 1 3
yes 0 0

, , LungCap = 7.3
Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 7.325

Gender
Smoke female male
no 1 3
yes 0 0

, , LungCap = 7.35

Gender
Smoke female male
no 2 1
yes 2 0

, , LungCap = 7.375

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 7.4

Gender
Smoke female male
no 0 3
yes 1 0

, , LungCap = 7.425

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 7.45

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 7.475

Gender
Smoke female male
no 1 2
yes 1 0

, , LungCap = 7.5

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.55

Gender
Smoke female male
no 2 3
yes 0 1

, , LungCap = 7.575

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 7.625

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 7.65

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 7.675

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 7.7

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 7.725

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.75

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 7.775
Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 7.8

Gender
Smoke female male
no 1 0
yes 1 0

, , LungCap = 7.825

Gender
Smoke female male
no 3 4
yes 0 0

, , LungCap = 7.85

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 7.875

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 7.9

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 7.925

Gender
Smoke female male
no 3 1
yes 0 1

, , LungCap = 7.95

Gender
Smoke female male
no 1 0
yes 2 0

, , LungCap = 7.975

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 8

Gender
Smoke female male
no 3 3
yes 0 1

, , LungCap = 8.025

Gender
Smoke female male
no 2 1
yes 0 1

, , LungCap = 8.05

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 8.075

Gender
Smoke female male
no 0 1
yes 1 0

, , LungCap = 8.1

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 8.125

Gender
Smoke female male
no 2 1
yes 1 0

, , LungCap = 8.175

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 8.2

Gender
Smoke female male
no 1 1
yes 1 0
, , LungCap = 8.225

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 8.25

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 8.275

Gender
Smoke female male
no 2 0
yes 1 0

, , LungCap = 8.3

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 8.325

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 8.35

Gender
Smoke female male
no 3 5
yes 0 0

, , LungCap = 8.375

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 8.425

Gender
Smoke female male
no 2 2
yes 0 1

, , LungCap = 8.45

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 8.475

Gender
Smoke female male
no 1 0
yes 0 1

, , LungCap = 8.5

Gender
Smoke female male
no 3 1
yes 0 1

, , LungCap = 8.525

Gender
Smoke female male
no 0 0
yes 1 0

, , LungCap = 8.55

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 8.575

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 8.6

Gender
Smoke female male
no 4 2
yes 0 0

, , LungCap = 8.625

Gender
Smoke female male
no 3 2
yes 1 0

, , LungCap = 8.65

Gender
Smoke female male
no 0 1
yes 1 0
, , LungCap = 8.675

Gender
Smoke female male
no 0 0
yes 1 0

, , LungCap = 8.7

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 8.725

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 8.775

Gender
Smoke female male
no 5 1
yes 1 0

, , LungCap = 8.8

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 8.825

Gender
Smoke female male
no 0 2
yes 1 0

, , LungCap = 8.85

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 8.875

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 8.9
Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 8.925

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 8.975

Gender
Smoke female male
no 3 2
yes 0 0

, , LungCap = 9

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 9.025

Gender
Smoke female male
no 3 1
yes 0 0

, , LungCap = 9.05

Gender
Smoke female male
no 0 1
yes 1 1

, , LungCap = 9.1

Gender
Smoke female male
no 2 2
yes 0 1

, , LungCap = 9.125

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 9.15

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 9.175

Gender
Smoke female male
no 1 1
yes 0 1

, , LungCap = 9.2

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 9.225

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 9.275

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 9.3

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 9.325

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 9.35

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 9.375

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 9.4
Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 9.45

Gender
Smoke female male
no 1 0
yes 0 1

, , LungCap = 9.475

Gender
Smoke female male
no 0 3
yes 1 0

, , LungCap = 9.5

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 9.525

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 9.55

Gender
Smoke female male
no 1 1
yes 1 0

, , LungCap = 9.575

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 9.6

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 9.625

Gender
Smoke female male
no 1 1
yes 1 0

, , LungCap = 9.65

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 9.675

Gender
Smoke female male
no 0 4
yes 0 1

, , LungCap = 9.7

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 9.725

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 9.75

Gender
Smoke female male
no 1 1
yes 0 1

, , LungCap = 9.8

Gender
Smoke female male
no 0 1
yes 1 0

, , LungCap = 9.825

Gender
Smoke female male
no 3 1
yes 0 0

, , LungCap = 9.85

Gender
Smoke female male
no 1 1
yes 1 0
, , LungCap = 9.875

Gender
Smoke female male
no 1 0
yes 0 1

, , LungCap = 9.9

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 9.925

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 9.95

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 9.975

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.025

Gender
Smoke female male
no 1 3
yes 0 0

, , LungCap = 10.05

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 10.1

Gender
Smoke female male
no 2 1
yes 0 0

, , LungCap = 10.125

Gender
Smoke female male
no 1 0
yes 1 0

, , LungCap = 10.175

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 10.2

Gender
Smoke female male
no 1 3
yes 1 0

, , LungCap = 10.25

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.275

Gender
Smoke female male
no 0 1
yes 0 1

, , LungCap = 10.3

Gender
Smoke female male
no 0 1
yes 1 0

, , LungCap = 10.325

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10.35

Gender
Smoke female male
no 0 2
yes 0 0
, , LungCap = 10.375

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.4

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 10.425

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 10.45

Gender
Smoke female male
no 0 1
yes 0 2

, , LungCap = 10.475

Gender
Smoke female male
no 1 2
yes 1 0

, , LungCap = 10.5

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 10.525

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.55

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10.575
Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.6

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 10.625

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 10.65

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 10.675

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 10.7

Gender
Smoke female male
no 1 1
yes 1 1

, , LungCap = 10.725

Gender
Smoke female male
no 3 0
yes 0 0

, , LungCap = 10.75

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10.775

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 10.8

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10.825

Gender
Smoke female male
no 1 0
yes 0 1

, , LungCap = 10.85

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 10.875

Gender
Smoke female male
no 0 1
yes 0 1

, , LungCap = 10.9

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 10.925

Gender
Smoke female male
no 1 2
yes 0 0

, , LungCap = 10.95

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 10.975

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11
Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 11.025

Gender
Smoke female male
no 0 1
yes 0 1

, , LungCap = 11.05

Gender
Smoke female male
no 0 0
yes 1 0

, , LungCap = 11.075

Gender
Smoke female male
no 2 2
yes 0 0

, , LungCap = 11.125

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11.175

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.225

Gender
Smoke female male
no 2 2
yes 0 1

, , LungCap = 11.275

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 11.3

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.325

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 11.35

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.4

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11.5

Gender
Smoke female male
no 1 1
yes 1 0

, , LungCap = 11.525

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.55

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.575

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 11.6

Gender
Smoke female male
no 1 0
yes 0 0
, , LungCap = 11.625

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.65

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11.675

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 11.7

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 11.75

Gender
Smoke female male
no 0 0
yes 1 0

, , LungCap = 11.775

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 11.8

Gender
Smoke female male
no 2 0
yes 0 0

, , LungCap = 11.825

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 11.875

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11.9

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 11.95

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.05

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 12.125

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 12.15

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 12.2

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 12.225

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 12.275

Gender
Smoke female male
no 0 1
yes 0 0
, , LungCap = 12.325

Gender
Smoke female male
no 0 3
yes 0 0

, , LungCap = 12.375

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.4

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.425

Gender
Smoke female male
no 1 1
yes 0 0

, , LungCap = 12.5

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.625

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.7

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 12.9

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 12.925
Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 12.95

Gender
Smoke female male
no 0 2
yes 0 0

, , LungCap = 13.025

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 13.05

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 13.075

Gender
Smoke female male
no 1 0
yes 0 0

, , LungCap = 13.1

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 13.2

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 13.325

Gender
Smoke female male
no 0 0
yes 0 1

, , LungCap = 13.375

Gender
Smoke female male
no 0 3
yes 0 0

, , LungCap = 13.875

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 14.375

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 14.55

Gender
Smoke female male
no 0 1
yes 0 0

, , LungCap = 14.675

Gender
Smoke female male
no 0 1
yes 0 0

> table(Smoke,Gender)
Gender
Smoke female male
no 314 334
yes 44 33
> x = table(Smoke,Gender)
> barplot(x)
> barplot(x, beside = T)
> barplot(x, beside = T, legend.text = T)
> barplot(x, beside = T, legend.text = c(smoker,non-smoker),las = 1, xlab = "smoker
n gender", main = "corelation")
Error in barplot.default(x, beside = T, legend.text = c(smoker, non - :
object 'smoker' not found
> barplot(x, beside = T, legend.text = c("smoker","non-smoker"),las = 1, xlab =
"smoker n gender", main = "corelation")
> barplot(x, beside = T, legend.text = c("smoker","non"),las = 1, xlab = "smoker n
gender", main = "corelation")
> barplot(x, beside = T, legend.text = c("smoker","non"),las = 1, xlab = "smoker n
gender", main = "corelation", col=c(3,5))
> mosaicplot(x)
> cor(Age,Height)
[1] 0.8357368
> plot(Age,Height, Main="scatterplot", xlab="Age", las=1)
Warning messages:
1: In plot.window(...) : "Main" is not a graphical parameter
2: In plot.xy(xy, type, ...) : "Main" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
"Main" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
"Main" is not a graphical parameter
5: In box(...) : "Main" is not a graphical parameter
6: In title(...) : "Main" is not a graphical parameter
> plot(Age,Height, main="scatterplot", xlab="Age", las=1)
> plot(Age,Height, main="scatterplot", xlab="Age",ylav="Height",xlim = c(0,20),
las=1)
Warning messages:
1: In plot.window(...) : "ylav" is not a graphical parameter
2: In plot.xy(xy, type, ...) : "ylav" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
"ylav" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
"ylav" is not a graphical parameter
5: In box(...) : "ylav" is not a graphical parameter
6: In title(...) : "ylav" is not a graphical parameter
> plot(Age,Height, main="scatterplot", xlab="Age",ylab="Height",xlim = c(0,20),
las=1)
> abline(Age,Height)
> abline(lm(Age~Height))
> abline(lm(Height~Age))
> abline(lm(Height~Age),col=c(7))
> abline(lm(Height~Age),col=c(2))
> abline(lm(Height~Age),col=c(3))
> lines(smooth(Age~Height))
Error in smooth(Age ~ Height) : attempt to smooth non-numeric values
> lines(smooth.spline(Age~Height))
> abline(lm(Height~Age),col=c(4))
> save.image("C:\\Users\\hp\\Desktop\\it business analyst\\r coding\\new R")
> var(LungCap)
[1] 7.086288
> Mean(LungCap)
Error in Mean(LungCap) : could not find function "Mean"
> mean(LungCap)
[1] 7.863148
> median(LungCap)
[1] 8
> sd(LungCap)
[1] 2.662008
> min(LungCap)
[1] 0.507
> max(LungCap)
[1] 14.675
> max(LungCap)
[1] 14.675
> cor(LungCap,Age)
[1] 0.8196749
> cov(LungCap,Age)
[1] 8.738289
> var(LungCap)
[1] 7.086288
> var(LungCap,Age)
[1] 8.738289
> summary(LungCap)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.507 6.150 8.000 7.863 9.800 14.675
> summary(datascience)
LungCap Age Height Smoke Gender
Min. : 0.507 Min. : 3.00 Min. :45.30 no :648 female:358
1st Qu.: 6.150 1st Qu.: 9.00 1st Qu.:59.90 yes: 77 male :367
Median : 8.000 Median :13.00 Median :65.40
Mean : 7.863 Mean :12.33 Mean :64.84
3rd Qu.: 9.800 3rd Qu.:15.00 3rd Qu.:70.30
Max. :14.675 Max. :19.00 Max. :81.80
Caesarean
no :561
yes:164

> dbinome(x=3, size = 20, prob = 1/6)


Error in dbinome(x = 3, size = 20, prob = 1/6) :
could not find function "dbinome"
> dbinom(x=3, size = 20, prob = 1/6)
[1] 0.2378866
> dbinom(x=0:3, size = 20, prob = 1/6)
[1] 0.02608405 0.10433621 0.19823881 0.23788657
> sum(dbinom(x=0:3, size = 20, prob = 1/6))
[1] 0.5665456
> qbinom(x=3, size = 20, prob = 1/6, lower.tail = T)
Error in qbinom(x = 3, size = 20, prob = 1/6, lower.tail = T) :
unused argument (x = 3)
> qbinom(w=3, size = 20, prob = 1/6, lower.tail = T)
Error in qbinom(w = 3, size = 20, prob = 1/6, lower.tail = T) :
unused argument (w = 3)
> qbinom(q=3, size = 20, prob = 1/6, lower.tail = T)

Error in qbinom(q = 3, size = 20, prob = 1/6, lower.tail = T) :


unused argument (q = 3)
> pbinom(q=3, size = 20, prob = 1/6, lower.tail = T)
[1] 0.5665456
> dpois(x=0:4, lambda=7)
[1] 0.000911882 0.006383174 0.022341108 0.052129252 0.091226192
> ppois(x=0:4, lambda=7)
Error in ppois(x = 0:4, lambda = 7) : unused argument (x = 0:4)
> ppois(x=4, lambda=7, lower.tail= T)
Error in ppois(x = 4, lambda = 7, lower.tail = T) :
unused argument (x = 4)
> ppois(q=4, lambda=7, lower.tail= T)
[1] 0.1729916
> ppois(i=4, lambda=7, lower.tail= T)
Error in ppois(i = 4, lambda = 7, lower.tail = T) :
unused argument (i = 4)
> ppois(q=4, lambda=7, lower.tail= T)
[1] 0.1729916
> pnorm?
+ 7
Error in `?`(pnorm, 7) :
no documentation of type �pnorm� and topic �7� (or error in processing help)
> pnorm(1.6)
[1] 0.9452007
> pnorm(-1.6)
[1] 0.05479929
> pnorm(156, mean = 150, sd = 12)
[1] 0.6914625
> pnorm(23333, mean = 150, sd = 12)
[1] 1
> pnorm(-23333, mean = 150, sd = 12)
[1] 0
> pnorm(-233, mean = 150, sd = 12)
[1] 7.839767e-224
> pnorm(233, mean = 150, sd = 12)
[1] 1
> pnorm(23, mean = 150, sd = 12)
[1] 1.780304e-26
> pnorm(180, mean = 150, sd = 12)
[1] 0.9937903
> qnorm(-0.61)
[1] NaN
Warning message:
In qnorm(-0.61) : NaNs produced
> qnorm(0.61)
[1] 0.279319
> qnorm(1-0.61)
[1] -0.279319
>

dnorm(x, mean = 0, sd = 1, log = FALSE)


pnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
qnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
rnorm(n, mean = 0, sd = 1)

dnorm gives the density,


pnorm gives the distribution function,
qnorm gives the quantile function, and
rnorm generates random deviates.

t Distribution and t Scores::::::::::::::::::::::::::::::::::::::::::::::::

> x= rnorm(n=10, mean=30, sd = 5)


> x
[1] 32.42619 23.85681 39.66570 31.58187 32.59871 30.73738 36.37765 31.87392
[9] 29.91117 27.26472
> hist(x)
> plot(x)
> pt (q=2.3, df=25, lower.tail=F)
[1] 0.01503675
> qt(p = 0.025, df = 25, lower.tail=T)
[1] -2.059539
> pt (q=2.3, df=25, lower.tail=F) + pt (q= -2.3, df=25, lower.tail=F)
[1] 1
> pt (q=2.3, df=25, lower.tail=F) + pt (q= -2.3, df=25, lower.tail=T)
[1] 0.03007351

You might also like