Bapak Prof. Dr. SUHARTONO, M.Kom || UIN Maulana Malik Ibrahim Malang

Pertanyaan mendasar yang harus ditanyakan terlebih dahulu tentang kerangka data apa pun adalah:

Apa yang dimaksud dengan satu baris? Apa saja variabelnya dan apa kepanjangannya? Jawaban atas pertanyaan-pertanyaan ini, untuk kerangka data yang akan kita gunakan, tersedia melalui dokumentasi R. Untuk memunculkan dokumentasi Engines, misalnya, berikan perintah:

Saat bekerja dengan data, sering kali kita lupa apa saja variabelnya, bagaimana ejaannya, dan nilai apa yang dimiliki setiap variabel. Dua perintah yang berguna untuk mengingatkan diri sendiri adalah (diilustrasikan di sini dengan Engines):

library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
##   method                           from   
##   fortify.SpatialPolygonsDataFrame ggplot2
## 
## The 'mosaic' package masks several functions from core packages in order to add 
## additional features.  The original behavior of these functions should not be affected by this.
## 
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following object is masked from 'package:ggplot2':
## 
##     stat
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
##     quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
## 
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
## 
##     count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
##      (status 2 uses the sf package in place of rgdal)
## 
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
## 
##     D
head(Engines)
## # A tibble: 6 × 9
##   Engine            mass ncylinder strokes displacement  bore stroke   BHP   RPM
##   <chr>            <dbl>     <dbl>   <dbl>        <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 Webra Speedy     0.135         1       2          1.8  13.5   12.5  0.45 22000
## 2 Motori Cipolla   0.15          1       2          2.5  15     14    1    26000
## 3 Webra Speed 20   0.25          1       2          3.4  16.5   16    0.78 22000
## 4 Webra 40         0.27          1       2          6.5  21     19    0.96 15500
## 5 Webra 61 Blackh… 0.43          1       2         10    24     22    1.55 14000
## 6 Webra 6WR        0.49          1       2         10    24     22    2.76 19000
nrow(Engines)
## [1] 39