No. BP : 2011132025
Kelas : TIP/ C
TUGAS 1 DAN 2
1. Memahami perintah R
2. Contoh penggunaan variable yang salah
Mengenal fungsi
Statement if dan if else
Statement for
Statement repeat dan break
Statement while
7. Argumen dari suatu fungsi
Optional argument
Sambungan optional argument
Required argument
Perintah print
Perintah format
Perintah cat
Sambungan perintah cat
TUGAS 3
Membuat grafik
7uga Mere IRdznuoulikodhgl RSudo B X
[Ia/orkspace 1oaded from -/Tugas Nengenal R dan ñ nst ruksl kadi ng 1/ . RData]
R 1 s a col 1 abor at ñ ve p roj ect wk th many con try butors . R • ! Global ENVironment - Q
Type ' cont râ butors () ’ to r no re i n formats on and Data
' ct tats on {) ' on how to ct te R or R packages n publ1catl and a va1ue s num [1: 3, 1 : 4§ 4 9 13 .. @
a 1u
type ' demo{} ’ for some demos , ' help{g ' fa r on -11 ne help , or
he1p . start( ’ for an HTNL browser 1nterface to he1p . bee num [1: 25a 3 4 1 1 3 4 3...
r
' ' ** ’ "' ” Ales Plots Packa es Hcl Viewer
[\\Workspace 1oaded from -/Tugas Nengenal R dan 1nst ruksJ kodñ ng 1/ . RData] @ @ zoo -R Export . I O I c.
> vec <- c (4, 9, 13, 12, 17, 6, 9, 27, 15, 1.8}
> va1ues mat r1x {vec , nrow = 3, nco1 = 4}
\¥arn1 ng message:
In nrow = J, ncol = 4) :
data length [11a is not a sub-multiple or multiple of the number
of ro us [3]
› values
[,l][,2][,3j [,4j
[1,a 4 12 9 l
[2,] 9 17 27 8
[3,J 13 6 15 4
> barpl ot {val ues , cot = c {"b rown ” , ” red” , ”ye11ow” } )
> pt e {val ues, co1 = c ("ye11ow" , "pñ nk" , ”green ” } )
[\¥orkspace 1oaded from -/Tugas Nengenal R dan 1nst ruksl kodl ng 1/ . RData] "’^’ ^"’ ^ **" -