R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Housing = read.csv("http://www.mosaic-web.org/go/datasets/Income-Housing.csv")

Berikut merupakan contoh import data excel ke R studio

library(readxl)
Datacalculus =read_xlsx("C:/Users/Alfan Miftachul/Downloads/Data Refresh Sample Data.xlsx")
Datacalculus
## # A tibble: 22 × 5
##    `Ship Mode`     Profit `Unit Price` `Shipping Cost` `Customer Name`   
##    <chr>            <dbl>        <dbl>           <dbl> <chr>             
##  1 Regular Air    -213.          38.9            35    Muhammed MacIntyre
##  2 Delivery Truck  458.         208.             68.0  Barry French      
##  3 Regular Air      46.7          8.69            2.99 Barry French      
##  4 Regular Air    1199.         196.              3.99 Clay Rozendal     
##  5 Regular Air      -4.72         5.28            2.99 Claudia Miner     
##  6 Regular Air     783.          39.9             3.04 Neola Schneider   
##  7 Regular Air      93.8         15.7             1.39 Allen Rosenblatt  
##  8 Delivery Truck  441.         101.             26.2  Sylvia Foulston   
##  9 Regular Air    -481.         101.             69    Sylvia Foulston   
## 10 Regular Air     -11.7         66.0             5.26 Jim Radford       
## # … with 12 more rows

Download package “readxl” melalui tools ,

1.jangan lupa agar data terbaca di r markdown gunakan R terlebih dahulu

2.gunakan library (readxl)

3.masukkan nama data yang akan dipanggil

4.dan ketik read_xlxs agar data terbaca

5.cari file excel yang ingin di masukkan ke r studio dengan klik kanan ,properties dan salin letak file tersimpan

6.copy paste masukkan kedalam kurung dan jangan lupa menambah “” dan mengubah  jadi /

7.tambah nama file untuk mempermudah pencarian dengan akhiran.xlxs

8.tulis kembali nama data yang ingin dipanggil

9.silahkan run untuk mengetahui hasil Import