<jupyter_start><jupyter_text>Function "print" for prints the specified message to the screen, or other standard output device<jupyter_code>print(5+5)
print("Hello World")
print(TRUE)
----------------------<jupyter_output><empty_output><jupyter_text>R is case sensitive<jupyter_code>print("Me")
#Not same with
print("ME")

print("01")
#Not same with
print("1")
----------------------<jupyter_output><empty_output><jupyter_text>"c" Function for makes continues number<jupyter_code>c(1,2,3,4,5,6,7,8,9,10)
#Same with
c(1:10)
----------------------<jupyter_output><empty_output><jupyter_text>Variable in R<jupyter_code>a <- "<NAME>"
b <- 57
print(a)
print(b)
----------------------<jupyter_output><empty_output><jupyter_text>Making Vector in R<jupyter_code>Vector <- c(51,45,67)
print(Vector)
----------------------<jupyter_output><empty_output><jupyter_text>Continues Vector and Manual Vector<jupyter_code>manual <- c(10,11,12,13,14,15,16,17,18,19,20)
#Same with
vector <- c(10:20)

print(manual)
print(vector)
----------------------<jupyter_output><empty_output><jupyter_text>Vector can contains text<jupyter_code>vector <- c("I","Love","You")
print(vector)
----------------------<jupyter_output><empty_output><jupyter_text>Vector Indexing<jupyter_code>vector <- c(80,85,87,83,82,98,93,100)
print(vector[[2]]) #Print index number 2 from left
print(vector[6]) #Print index number 6 from left
print(vector[5:8]) #Print index number 5 to 8 from left
----------------------<jupyter_output><empty_output><jupyter_text>Named Vector<jupyter_code>named <- c(language="R",machine_learning="Yes",data_mining="Yes")
print(named)
print(named["machine_learning"]) #Print object named "machine_learning"
----------------------<jupyter_output><empty_output><jupyter_text>List<jupyter_code>alist <- list("I","am",100,"%","Human")
print(alist)
----------------------<jupyter_output><empty_output><jupyter_text>List Indexing<jupyter_code>alist <- list("I","am",100,"%","Human")
print(alist[3]) #Print index number 3
print(alist[1:4]) #Print index number 1 to 4
----------------------<jupyter_output><empty_output><jupyter_text>Data Frame in R<jupyter_code>jumlah_mahasiswa <- c(450,670,490,421,577)
fakultas <- c("Teknik Pertanian","Sistem Informasi","Statistika","Matematika","Ilmu Komputer")
dataframe <- data.frame(fakultas,jumlah_mahasiswa)
print(dataframe)
----------------------<jupyter_output><empty_output><jupyter_text>Taking column from data frame<jupyter_code>jumlah_mahasiswa <- c(450,670,490,421,577)
fakultas <- c("Teknik Pertanian","Sistem Informasi","Statistika","Matematika","Ilmu Komputer")
dataframe <- data.frame(fakultas,jumlah_mahasiswa)
dataframe$fakultas
dataframe$jumlah_mahasiswa
----------------------<jupyter_output><empty_output><jupyter_text>Making chart with ggplot2<jupyter_code>library(ggplot2) #Importing ggplot2 library
jumlah_mahasiswa <- c(450,670,490,421,577)
fakultas <- c("Teknik Pertanian","Sistem Informasi","Statistika","Matematika","Ilmu Komputer")
dataframe <- data.frame(prodi,jumlah_mahasiswa)
plot <- ggplot(dataframe,aes(x=fakultas,y=jumlah_mahasiswa,fill=fakultas))
plot <- plot + geom_bar(width=0.9,stat="identity")
plot
----------------------<jupyter_output><empty_output><jupyter_text>Adding title and other informations<jupyter_code>library(ggplot2) #Importing ggplot2 library
jumlah_mahasiswa <- c(450,670,490,421,577)
fakultas <- c("Teknik Pertanian","Sistem Informasi","Statistika","Matematika","Ilmu Komputer")
dataframe <- data.frame(prodi,jumlah_mahasiswa)
plot <- ggplot(dataframe,aes(x=fakultas,y=jumlah_mahasiswa,fill=fakultas))
plot <- plot + geom_bar(width=0.9,stat="identity")
plot <- plot + ggtitle("Grafik Jumlah Mahasiswa Terhadap Fakultas") #Adding title
plot <- plot + xlab("Fakultas") #Adding bottom information
plot <- plot + ylab("Jumlah Mahasiswa") # Adding side information
plot
----------------------<jupyter_output><empty_output><jupyter_text>Reading .xlsx file in R<jupyter_code>library(openxlsx) #Importing library for reading .xlsx file
read <- read.xlsx("https://academy.dqlab.id/dataset/mahasiswa.xlsx",sheet = "Sheet 1")
read
----------------------<jupyter_output><empty_output><jupyter_text>Making graph from .xlsx file<jupyter_code>library(openxlsx) #Importing library for reading .xlsx file
read <- read.xlsx("https://academy.dqlab.id/dataset/mahasiswa.xlsx",sheet = "Sheet 1")
plot <- ggplot(read,aes(x=Fakultas,y=JUMLAH,fill=Fakultas))
plot <- plot + geom_bar(width=0.9,stat="identity")
plot<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2173719376391982, 'fraction_numerical': 0.036302895322939864, 'mean_word_length': 5.298737727910239, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 70, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '17', 'dir': 'jupyter-structured-clean-dedup', 'id': '8626', 'license': 'MIT', 'n_tokens_mistral': 1817, 'n_tokens_neox': 1676, 'n_words': 257, 'path': 'Learning/R_Fundamental.ipynb', 'repo_name': 'Maulanaaz/R', 'size': '4495'}