Sei sulla pagina 1di 11

R version 3.4.

1 (2017-06-30) -- "Single Candle"


Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.


You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.


Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or


'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

>
stdid=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,
29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50)
>
Regno=c("17MNT0001","17MNT0002","17MNT0003","17MNT0004","17MNT0005","17MNT0006","17
MNT0007","17MNT0008","17MNT0009","17MNT0010","17MNT0011","17MNT0012","17MNT0013","1
7MNT0014","17MNT0015","17MNT0016","17MNT0017","17MNT0018","17MNT0019","17MNT0020","
17MNT0021","17MNT0022","17MNT0023","17MNT0024","17MNT0025","17MNT0026","17MNT0027",
"17MNT0028","17MNT0029","17MNT0030","17MNT0031","17MNT0032","17MNT0033","17MNT0034"
,"17MNT0035","17MNT0036","17MNT0037","17MNT0038","17MNT0039","17MNT0040","17MNT0041
","17MNT0042","17MNT0043","17MNT0044","17MNT0045","17MNT0046","17MNT0047","17MNT004
8","17MNT0049","17MNT0050")
>
Names=c("Sarmistha","priyada","Aparana","pradeep","Deepu","mounika","mouni","chanda
na","keerthi","hari","jay kumar","jaydev","jay
kumar","akbar","rohit","anzalna","tandra","aleena","pankaj","micheele","hemin","and
rew","swaroop","Madhan","chaitu","harsha","rakesh","Durga","prasanna","maneesha","M
ohammad","Kumar","Reddy","sanjeev","rajeev","yaragalla","krishna","suneel","sai","v
inod","ssai","Sarmistha","priyada","Aparana","pradeep","Deepu","mounika","mouni","c
handana","keerthi")
>
sex=c(0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,1,1,1,0,1,0,1,1,1
,1,1,0,0,0,1,1,0,0,0,0)
>
status=c(1,2,1,2,1,2,1,2,1,1,1,2,2,1,2,1,2,1,2,1,2,1,2,1,1,1,2,2,1,2,1,2,1,2,1,2,1,
2,1,1,1,2,2,1,2,1,1,2,2,1)
> stdinfo=data.frame(stdid,Regno,Names,sex,status)
> stdinfo
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha 0 1
2 2 17MNT0002 priyada 0 2
3 3 17MNT0003 Aparana 0 1
4 4 17MNT0004 pradeep 1 2
5 5 17MNT0005 Deepu 1 1
6 6 17MNT0006 mounika 0 2
7 7 17MNT0007 mouni 0 1
8 8 17MNT0008 chandana 0 2
9 9 17MNT0009 keerthi 0 1
10 10 17MNT0010 hari 1 1
11 11 17MNT0011 jay kumar 1 1
12 12 17MNT0012 jaydev 1 2
13 13 17MNT0013 jay kumar 1 2
14 14 17MNT0014 akbar 1 1
15 15 17MNT0015 rohit 1 2
16 16 17MNT0016 anzalna 0 1
17 17 17MNT0017 tandra 0 2
18 18 17MNT0018 aleena 0 1
19 19 17MNT0019 pankaj 1 2
20 20 17MNT0020 micheele 0 1
21 21 17MNT0021 hemin 1 2
22 22 17MNT0022 andrew 1 1
23 23 17MNT0023 swaroop 1 2
24 24 17MNT0024 Madhan 1 1
25 25 17MNT0025 chaitu 1 1
26 26 17MNT0026 harsha 1 1
27 27 17MNT0027 rakesh 1 2
28 28 17MNT0028 Durga 0 2
29 29 17MNT0029 prasanna 0 1
30 30 17MNT0030 maneesha 0 2
31 31 17MNT0031 Mohammad 1 1
32 32 17MNT0032 Kumar 1 2
33 33 17MNT0033 Reddy 1 1
34 34 17MNT0034 sanjeev 0 2
35 35 17MNT0035 rajeev 1 1
36 36 17MNT0036 yaragalla 0 2
37 37 17MNT0037 krishna 1 1
38 38 17MNT0038 suneel 1 2
39 39 17MNT0039 sai 1 1
40 40 17MNT0040 vinod 1 1
41 41 17MNT0041 ssai 1 1
42 42 17MNT0042 Sarmistha 0 2
43 43 17MNT0043 priyada 0 2
44 44 17MNT0044 Aparana 0 1
45 45 17MNT0045 pradeep 1 2
46 46 17MNT0046 Deepu 1 1
47 47 17MNT0047 mounika 0 1
48 48 17MNT0048 mouni 0 2
49 49 17MNT0049 chandana 0 2
50 50 17MNT0050 keerthi 0 1
> stdinfo$sex=factor(stdinfo$sex,labels=c("male","female"))
> stdinfo$status=factor(stdinfo$status,labels=c("present","absent"))
> stdinfo
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha male present
2 2 17MNT0002 priyada male absent
3 3 17MNT0003 Aparana male present
4 4 17MNT0004 pradeep female absent
5 5 17MNT0005 Deepu female present
6 6 17MNT0006 mounika male absent
7 7 17MNT0007 mouni male present
8 8 17MNT0008 chandana male absent
9 9 17MNT0009 keerthi male present
10 10 17MNT0010 hari female present
11 11 17MNT0011 jay kumar female present
12 12 17MNT0012 jaydev female absent
13 13 17MNT0013 jay kumar female absent
14 14 17MNT0014 akbar female present
15 15 17MNT0015 rohit female absent
16 16 17MNT0016 anzalna male present
17 17 17MNT0017 tandra male absent
18 18 17MNT0018 aleena male present
19 19 17MNT0019 pankaj female absent
20 20 17MNT0020 micheele male present
21 21 17MNT0021 hemin female absent
22 22 17MNT0022 andrew female present
23 23 17MNT0023 swaroop female absent
24 24 17MNT0024 Madhan female present
25 25 17MNT0025 chaitu female present
26 26 17MNT0026 harsha female present
27 27 17MNT0027 rakesh female absent
28 28 17MNT0028 Durga male absent
29 29 17MNT0029 prasanna male present
30 30 17MNT0030 maneesha male absent
31 31 17MNT0031 Mohammad female present
32 32 17MNT0032 Kumar female absent
33 33 17MNT0033 Reddy female present
34 34 17MNT0034 sanjeev male absent
35 35 17MNT0035 rajeev female present
36 36 17MNT0036 yaragalla male absent
37 37 17MNT0037 krishna female present
38 38 17MNT0038 suneel female absent
39 39 17MNT0039 sai female present
40 40 17MNT0040 vinod female present
41 41 17MNT0041 ssai female present
42 42 17MNT0042 Sarmistha male absent
43 43 17MNT0043 priyada male absent
44 44 17MNT0044 Aparana male present
45 45 17MNT0045 pradeep female absent
46 46 17MNT0046 Deepu female present
47 47 17MNT0047 mounika male present
48 48 17MNT0048 mouni male absent
49 49 17MNT0049 chandana male absent
50 50 17MNT0050 keerthi male present
> sexf=subset(stdinfo,stdinfo$sex=='female')
> sexf
stdid Regno Names sex status
4 4 17MNT0004 pradeep female absent
5 5 17MNT0005 Deepu female present
10 10 17MNT0010 hari female present
11 11 17MNT0011 jay kumar female present
12 12 17MNT0012 jaydev female absent
13 13 17MNT0013 jay kumar female absent
14 14 17MNT0014 akbar female present
15 15 17MNT0015 rohit female absent
19 19 17MNT0019 pankaj female absent
21 21 17MNT0021 hemin female absent
22 22 17MNT0022 andrew female present
23 23 17MNT0023 swaroop female absent
24 24 17MNT0024 Madhan female present
25 25 17MNT0025 chaitu female present
26 26 17MNT0026 harsha female present
27 27 17MNT0027 rakesh female absent
31 31 17MNT0031 Mohammad female present
32 32 17MNT0032 Kumar female absent
33 33 17MNT0033 Reddy female present
35 35 17MNT0035 rajeev female present
37 37 17MNT0037 krishna female present
38 38 17MNT0038 suneel female absent
39 39 17MNT0039 sai female present
40 40 17MNT0040 vinod female present
41 41 17MNT0041 ssai female present
45 45 17MNT0045 pradeep female absent
46 46 17MNT0046 Deepu female present
> sexm=subset(stdinfo,stdinfo$sex=='male')
> sexm
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha male present
2 2 17MNT0002 priyada male absent
3 3 17MNT0003 Aparana male present
6 6 17MNT0006 mounika male absent
7 7 17MNT0007 mouni male present
8 8 17MNT0008 chandana male absent
9 9 17MNT0009 keerthi male present
16 16 17MNT0016 anzalna male present
17 17 17MNT0017 tandra male absent
18 18 17MNT0018 aleena male present
20 20 17MNT0020 micheele male present
28 28 17MNT0028 Durga male absent
29 29 17MNT0029 prasanna male present
30 30 17MNT0030 maneesha male absent
34 34 17MNT0034 sanjeev male absent
36 36 17MNT0036 yaragalla male absent
42 42 17MNT0042 Sarmistha male absent
43 43 17MNT0043 priyada male absent
44 44 17MNT0044 Aparana male present
47 47 17MNT0047 mounika male present
48 48 17MNT0048 mouni male absent
49 49 17MNT0049 chandana male absent
50 50 17MNT0050 keerthi male present
> stdinfo$sex=factor(stdinfo$sex,labels=c("female","male"))
> stdinfo
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha female present
2 2 17MNT0002 priyada female absent
3 3 17MNT0003 Aparana female present
4 4 17MNT0004 pradeep male absent
5 5 17MNT0005 Deepu male present
6 6 17MNT0006 mounika female absent
7 7 17MNT0007 mouni female present
8 8 17MNT0008 chandana female absent
9 9 17MNT0009 keerthi female present
10 10 17MNT0010 hari male present
11 11 17MNT0011 jay kumar male present
12 12 17MNT0012 jaydev male absent
13 13 17MNT0013 jay kumar male absent
14 14 17MNT0014 akbar male present
15 15 17MNT0015 rohit male absent
16 16 17MNT0016 anzalna female present
17 17 17MNT0017 tandra female absent
18 18 17MNT0018 aleena female present
19 19 17MNT0019 pankaj male absent
20 20 17MNT0020 micheele female present
21 21 17MNT0021 hemin male absent
22 22 17MNT0022 andrew male present
23 23 17MNT0023 swaroop male absent
24 24 17MNT0024 Madhan male present
25 25 17MNT0025 chaitu male present
26 26 17MNT0026 harsha male present
27 27 17MNT0027 rakesh male absent
28 28 17MNT0028 Durga female absent
29 29 17MNT0029 prasanna female present
30 30 17MNT0030 maneesha female absent
31 31 17MNT0031 Mohammad male present
32 32 17MNT0032 Kumar male absent
33 33 17MNT0033 Reddy male present
34 34 17MNT0034 sanjeev female absent
35 35 17MNT0035 rajeev male present
36 36 17MNT0036 yaragalla female absent
37 37 17MNT0037 krishna male present
38 38 17MNT0038 suneel male absent
39 39 17MNT0039 sai male present
40 40 17MNT0040 vinod male present
41 41 17MNT0041 ssai male present
42 42 17MNT0042 Sarmistha female absent
43 43 17MNT0043 priyada female absent
44 44 17MNT0044 Aparana female present
45 45 17MNT0045 pradeep male absent
46 46 17MNT0046 Deepu male present
47 47 17MNT0047 mounika female present
48 48 17MNT0048 mouni female absent
49 49 17MNT0049 chandana female absent
50 50 17MNT0050 keerthi female present
> sexf
stdid Regno Names sex status
4 4 17MNT0004 pradeep female absent
5 5 17MNT0005 Deepu female present
10 10 17MNT0010 hari female present
11 11 17MNT0011 jay kumar female present
12 12 17MNT0012 jaydev female absent
13 13 17MNT0013 jay kumar female absent
14 14 17MNT0014 akbar female present
15 15 17MNT0015 rohit female absent
19 19 17MNT0019 pankaj female absent
21 21 17MNT0021 hemin female absent
22 22 17MNT0022 andrew female present
23 23 17MNT0023 swaroop female absent
24 24 17MNT0024 Madhan female present
25 25 17MNT0025 chaitu female present
26 26 17MNT0026 harsha female present
27 27 17MNT0027 rakesh female absent
31 31 17MNT0031 Mohammad female present
32 32 17MNT0032 Kumar female absent
33 33 17MNT0033 Reddy female present
35 35 17MNT0035 rajeev female present
37 37 17MNT0037 krishna female present
38 38 17MNT0038 suneel female absent
39 39 17MNT0039 sai female present
40 40 17MNT0040 vinod female present
41 41 17MNT0041 ssai female present
45 45 17MNT0045 pradeep female absent
46 46 17MNT0046 Deepu female present
> stdinfo
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha female present
2 2 17MNT0002 priyada female absent
3 3 17MNT0003 Aparana female present
4 4 17MNT0004 pradeep male absent
5 5 17MNT0005 Deepu male present
6 6 17MNT0006 mounika female absent
7 7 17MNT0007 mouni female present
8 8 17MNT0008 chandana female absent
9 9 17MNT0009 keerthi female present
10 10 17MNT0010 hari male present
11 11 17MNT0011 jay kumar male present
12 12 17MNT0012 jaydev male absent
13 13 17MNT0013 jay kumar male absent
14 14 17MNT0014 akbar male present
15 15 17MNT0015 rohit male absent
16 16 17MNT0016 anzalna female present
17 17 17MNT0017 tandra female absent
18 18 17MNT0018 aleena female present
19 19 17MNT0019 pankaj male absent
20 20 17MNT0020 micheele female present
21 21 17MNT0021 hemin male absent
22 22 17MNT0022 andrew male present
23 23 17MNT0023 swaroop male absent
24 24 17MNT0024 Madhan male present
25 25 17MNT0025 chaitu male present
26 26 17MNT0026 harsha male present
27 27 17MNT0027 rakesh male absent
28 28 17MNT0028 Durga female absent
29 29 17MNT0029 prasanna female present
30 30 17MNT0030 maneesha female absent
31 31 17MNT0031 Mohammad male present
32 32 17MNT0032 Kumar male absent
33 33 17MNT0033 Reddy male present
34 34 17MNT0034 sanjeev female absent
35 35 17MNT0035 rajeev male present
36 36 17MNT0036 yaragalla female absent
37 37 17MNT0037 krishna male present
38 38 17MNT0038 suneel male absent
39 39 17MNT0039 sai male present
40 40 17MNT0040 vinod male present
41 41 17MNT0041 ssai male present
42 42 17MNT0042 Sarmistha female absent
43 43 17MNT0043 priyada female absent
44 44 17MNT0044 Aparana female present
45 45 17MNT0045 pradeep male absent
46 46 17MNT0046 Deepu male present
47 47 17MNT0047 mounika female present
48 48 17MNT0048 mouni female absent
49 49 17MNT0049 chandana female absent
50 50 17MNT0050 keerthi female present
> sexm=subset(stdinfo,stdinfo$sex=='male')
> sexm
stdid Regno Names sex status
4 4 17MNT0004 pradeep male absent
5 5 17MNT0005 Deepu male present
10 10 17MNT0010 hari male present
11 11 17MNT0011 jay kumar male present
12 12 17MNT0012 jaydev male absent
13 13 17MNT0013 jay kumar male absent
14 14 17MNT0014 akbar male present
15 15 17MNT0015 rohit male absent
19 19 17MNT0019 pankaj male absent
21 21 17MNT0021 hemin male absent
22 22 17MNT0022 andrew male present
23 23 17MNT0023 swaroop male absent
24 24 17MNT0024 Madhan male present
25 25 17MNT0025 chaitu male present
26 26 17MNT0026 harsha male present
27 27 17MNT0027 rakesh male absent
31 31 17MNT0031 Mohammad male present
32 32 17MNT0032 Kumar male absent
33 33 17MNT0033 Reddy male present
35 35 17MNT0035 rajeev male present
37 37 17MNT0037 krishna male present
38 38 17MNT0038 suneel male absent
39 39 17MNT0039 sai male present
40 40 17MNT0040 vinod male present
41 41 17MNT0041 ssai male present
45 45 17MNT0045 pradeep male absent
46 46 17MNT0046 Deepu male present
> sexf=subset(stdinfo,stdinfo$sex=='female')
> sexf
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha female present
2 2 17MNT0002 priyada female absent
3 3 17MNT0003 Aparana female present
6 6 17MNT0006 mounika female absent
7 7 17MNT0007 mouni female present
8 8 17MNT0008 chandana female absent
9 9 17MNT0009 keerthi female present
16 16 17MNT0016 anzalna female present
17 17 17MNT0017 tandra female absent
18 18 17MNT0018 aleena female present
20 20 17MNT0020 micheele female present
28 28 17MNT0028 Durga female absent
29 29 17MNT0029 prasanna female present
30 30 17MNT0030 maneesha female absent
34 34 17MNT0034 sanjeev female absent
36 36 17MNT0036 yaragalla female absent
42 42 17MNT0042 Sarmistha female absent
43 43 17MNT0043 priyada female absent
44 44 17MNT0044 Aparana female present
47 47 17MNT0047 mounika female present
48 48 17MNT0048 mouni female absent
49 49 17MNT0049 chandana female absent
50 50 17MNT0050 keerthi female present
> summary(stdinfo)
stdid Regno Names sex status
Min. : 1.00 17MNT0001: 1 Aparana : 2 female:23 present:27
1st Qu.:13.25 17MNT0002: 1 chandana : 2 male :27 absent :23
Median :25.50 17MNT0003: 1 Deepu : 2
Mean :25.50 17MNT0004: 1 jay kumar: 2
3rd Qu.:37.75 17MNT0005: 1 keerthi : 2
Max. :50.00 17MNT0006: 1 mouni : 2
(Other) :44 (Other) :38
> statuss=subset(stdinfo,stdinfo$status=='present')
> statuss
stdid Regno Names sex status
1 1 17MNT0001 Sarmistha female present
3 3 17MNT0003 Aparana female present
5 5 17MNT0005 Deepu male present
7 7 17MNT0007 mouni female present
9 9 17MNT0009 keerthi female present
10 10 17MNT0010 hari male present
11 11 17MNT0011 jay kumar male present
14 14 17MNT0014 akbar male present
16 16 17MNT0016 anzalna female present
18 18 17MNT0018 aleena female present
20 20 17MNT0020 micheele female present
22 22 17MNT0022 andrew male present
24 24 17MNT0024 Madhan male present
25 25 17MNT0025 chaitu male present
26 26 17MNT0026 harsha male present
29 29 17MNT0029 prasanna female present
31 31 17MNT0031 Mohammad male present
33 33 17MNT0033 Reddy male present
35 35 17MNT0035 rajeev male present
37 37 17MNT0037 krishna male present
39 39 17MNT0039 sai male present
40 40 17MNT0040 vinod male present
41 41 17MNT0041 ssai male present
44 44 17MNT0044 Aparana female present
46 46 17MNT0046 Deepu male present
47 47 17MNT0047 mounika female present
50 50 17MNT0050 keerthi female present
> statusA=subset(stdinfo,stdinfo$status=='Absent')
> statusA
[1] stdid Regno Names sex status
<0 rows> (or 0-length row.names)
> statuss=subset(stdinfo,stdinfo$status=='present')
> statusj=subset(stdinfo,stdinfo$status=='Absent')
> statusj
[1] stdid Regno Names sex status
<0 rows> (or 0-length row.names)
> statusa=subset(stdinfo,stdinfo$status=='absent')
> statusa
stdid Regno Names sex status
2 2 17MNT0002 priyada female absent
4 4 17MNT0004 pradeep male absent
6 6 17MNT0006 mounika female absent
8 8 17MNT0008 chandana female absent
12 12 17MNT0012 jaydev male absent
13 13 17MNT0013 jay kumar male absent
15 15 17MNT0015 rohit male absent
17 17 17MNT0017 tandra female absent
19 19 17MNT0019 pankaj male absent
21 21 17MNT0021 hemin male absent
23 23 17MNT0023 swaroop male absent
27 27 17MNT0027 rakesh male absent
28 28 17MNT0028 Durga female absent
30 30 17MNT0030 maneesha female absent
32 32 17MNT0032 Kumar male absent
34 34 17MNT0034 sanjeev female absent
36 36 17MNT0036 yaragalla female absent
38 38 17MNT0038 suneel male absent
42 42 17MNT0042 Sarmistha female absent
43 43 17MNT0043 priyada female absent
45 45 17MNT0045 pradeep male absent
48 48 17MNT0048 mouni female absent
49 49 17MNT0049 chandana female absent
> summary(status)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.00 1.00 1.00 1.46 2.00 2.00
> summary(statuss)
stdid Regno Names sex status
Min. : 1.0 17MNT0001: 1 Aparana: 2 female:11 present:27
1st Qu.:12.5 17MNT0003: 1 Deepu : 2 male :16 absent : 0
Median :25.0 17MNT0005: 1 keerthi: 2
Mean :25.3 17MNT0007: 1 akbar : 1
3rd Qu.:38.0 17MNT0009: 1 aleena : 1
Max. :50.0 17MNT0010: 1 andrew : 1
(Other) :21 (Other):18
> summary(statusa)
stdid Regno Names sex status
Min. : 2.00 17MNT0002: 1 chandana : 2 female:12 present: 0
1st Qu.:14.00 17MNT0004: 1 pradeep : 2 male :11 absent :23
Median :27.00 17MNT0006: 1 priyada : 2
Mean :25.74 17MNT0008: 1 Durga : 1
3rd Qu.:37.00 17MNT0012: 1 hemin : 1
Max. :49.00 17MNT0013: 1 jay kumar: 1
(Other) :17 (Other) :14
> q()
> summary(statusa)
stdid Regno Names sex status
Min. : 2.00 17MNT0002: 1 chandana : 2 female:12 present: 0
1st Qu.:14.00 17MNT0004: 1 pradeep : 2 male :11 absent :23
Median :27.00 17MNT0006: 1 priyada : 2
Mean :25.74 17MNT0008: 1 Durga : 1
3rd Qu.:37.00 17MNT0012: 1 hemin : 1
Max. :49.00 17MNT0013: 1 jay kumar: 1
(Other) :17 (Other) :14
> plot(stdinfo$status,type="l",main="status of students",xlab="stdid",ylab="no:of
students present",col="blue")
Warning messages:
1: In plot.window(xlim, ylim, log = log, ...) :
graphical parameter "type" is obsolete
2: In axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty = axis.lty, :
graphical parameter "type" is obsolete
3: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
graphical parameter "type" is obsolete
4: In axis(if (horiz) 1 else 2, cex.axis = cex.axis, ...) :
graphical parameter "type" is obsolete
> table4<-table(stdinfo$sex)
Warning messages:
1: unable to open printer
2: opening device failed
> pie(table4)
> pie
function (x, labels = names(x), edges = 200, radius = 0.8, clockwise = FALSE,
init.angle = if (clockwise) 90 else 0, density = NULL, angle = 45,
col = NULL, border = NULL, lty = NULL, main = NULL, ...)
{
if (!is.numeric(x) || any(is.na(x) | x < 0))
stop("'x' values must be positive.")
if (is.null(labels))
labels <- as.character(seq_along(x))
else labels <- as.graphicsAnnot(labels)
x <- c(0, cumsum(x)/sum(x))
dx <- diff(x)
nx <- length(dx)
plot.new()
pin <- par("pin")
xlim <- ylim <- c(-1, 1)
if (pin[1L] > pin[2L])
xlim <- (pin[1L]/pin[2L]) * xlim
else ylim <- (pin[2L]/pin[1L]) * ylim
dev.hold()
on.exit(dev.flush())
plot.window(xlim, ylim, "", asp = 1)
if (is.null(col))
col <- if (is.null(density))
c("white", "lightblue", "mistyrose", "lightcyan",
"lavender", "cornsilk")
else par("fg")
if (!is.null(col))
col <- rep_len(col, nx)
if (!is.null(border))
border <- rep_len(border, nx)
if (!is.null(lty))
lty <- rep_len(lty, nx)
angle <- rep(angle, nx)
if (!is.null(density))
density <- rep_len(density, nx)
twopi <- if (clockwise)
-2 * pi
else 2 * pi
t2xy <- function(t) {
t2p <- twopi * t + init.angle * pi/180
list(x = radius * cos(t2p), y = radius * sin(t2p))
}
for (i in 1L:nx) {
n <- max(2, floor(edges * dx[i]))
P <- t2xy(seq.int(x[i], x[i + 1], length.out = n))
polygon(c(P$x, 0), c(P$y, 0), density = density[i], angle = angle[i],
border = border[i], col = col[i], lty = lty[i])
P <- t2xy(mean(x[i + 0:1]))
lab <- as.character(labels[i])
if (!is.na(lab) && nzchar(lab)) {
lines(c(1, 1.05) * P$x, c(1, 1.05) * P$y)
text(1.1 * P$x, 1.1 * P$y, labels[i], xpd = TRUE,
adj = ifelse(P$x < 0, 1, 0), ...)
}
}
title(main = main, ...)
invisible(NULL)
}
<bytecode: 0x0000000014dab908>
<environment: namespace:graphics>
> table5=table(stdinfo$sex,stdinfo$status)
> barplot(table5,beside=T,xlim=c(1,50),ylim=c(0,4))
> boxplot(stdinfo$Names~stdinfo$status,col=c("red","orange"))
Error in oldClass(stats) <- cl :
adding class "factor" to an invalid object
> boxplot(stdinfo$sex~stdinfo$status,col=c("red","orange"))
Error in oldClass(stats) <- cl :
adding class "factor" to an invalid object
> table4<-table(stdinfo$sex)
> barplot(table5,beside=T,xlim=c(1,50),ylim=c(0,4))

Potrebbero piacerti anche