#Este es el codigo
options(repos = c(CRAN = "http://cran.rstudio.com"))
install.packages("ggplot2")
## Installing package into 'C:/Users/monee/AppData/Local/R/win-library/4.2'
## (as 'lib' is unspecified)
## package 'ggplot2' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\monee\AppData\Local\Temp\RtmpgL4Z6B\downloaded_packages
library(ggplot2)
dramas = read.csv("C:\\Users\\monee\\OneDrive\\Escritorio\\Aprendizaje estadistico\\top100_kdrama.csv")
head(dramas)
## ID Title Genre
## 1 1 Move to Heaven Life, Drama
## 2 2 Weak Hero Class 1 Action, Youth, Drama
## 3 3 Hospital Playlist Season 2 Romance, Life, Drama, Medical
## 4 4 Flower of Evil Thriller, Romance, Crime, Melodrama
## 5 5 Hospital Playlist Romance, Life, Drama, Medical
## 6 6 Alchemy of Souls Action, Historical, Romance, Fantasy
## Tags
## 1 Uncle-Nephew Relationship, Autism, Death, Savant Syndrome, Mourning, Tearjerker, Life Lesson, Cleaning And Organizing, Autism Spectrum Disorder, Murder
## 2 Smart Male Lead, Bromance, School Bullying, Violence, Friendship, High School, Skilled Fighter, Adapted From A Webtoon, School Setting, Fight
## 3 Multiple Mains, Band, Music, Strong Female Lead, Multiple Couples, Comedy, Smart Female Lead, Bromance, Cardiovascular Disease, Workplace Setting
## 4 Deception, Family Secret, Mystery, Suspense, Smart Female Lead, Hidden Personality, Antisocial Personality Disorder, Investigation, Murder, Hidden Identity
## 5 Nice Male Lead, Multiple Mains, Slow Romance, Multiple Couples, Strong Female Lead, Slight Romance, Nice Female Lead, Bromance, Heartfelt, Healing
## 6 Transmigration, Strong Female Lead, Master-Disciple Relationship, Kind Male Lead, Multiple Mains, Supernatural, Magical Power, Hidden Identity, Body Swap, Elemental Power
## Synopsis
## 1 Han Geu Roo is a 20-year-old with Autism. He works for his father’s business “Move To Heaven,” a company that specializes in crime scene cleanup, where they also collect and arrange items left by deceased people, and deliver them to the bereaved family.\nWhen Geu Roo's father dies, Geu Roo's guardianship passes to his uncle, ex-convict Cho Sang Gu, who is a martial arts fighter in underground matches. Per the father's will, Sang Gu must care for and work with Geu Roo in “Move To Heaven” for three months to gain full guardianship and claim the inheritance. Eying money, Sang Gu agrees to the conditions and moves in.
## 2 Yeon Shi Eun is a model student who ranks at the top of his high school. Physically, Yeon Shi Eun appears weak, but by using his wits and psychology, he fights against the violence that takes place inside and outside of his school.
## 3 Everyday is extraordinary for five doctors and their patients inside a hospital, where birth, death and everything in between coexist.
## 4 Although Baek Hee Sung is hiding a dark secret surrounding his true identity, he has established a happy family life and a successful career. He is a loving husband and doting father to his young daughter. But his perfect façade begins to crumble when his wife, Cha Ji Won, a homicide detective, begins investigating a string of serial murders from 15 years ago. Ji Won notices changes in Hee Sung’s behavior and begins to wonder if he could possibly be hiding something from her.
## 5 The stories of people going through their days are seemingly ordinary but actually special at the hospital, a place known as the microcosm of life, where someone is being born and someone's life meets its ending. The five doctors are long-time friends of 20 years who started their undergrad in 1999 in the same medical school and now are colleagues in the same hospital and have a band together.
## 6 Set in a fictional country called Daeho that does not exist in history or on maps, it is about the love and growth of young mages as they overcome their twisted fates due to a forbidden magic spell known as the "alchemy of souls", which allows souls to switch bodies.\nIt follows the story of an elite assassin named Naksu, whose soul is accidentally trapped inside the weak body of Mu Deok—Jang Uk's servant from a powerful and noble mage family in the country. The young master of the Jang Family, Jang Uk, holds a dark secret about his scandalous birth. He wants the formidable assassin to help change his destiny.
## Rank Popularity Score Episodes Duration Watchers Start_date End_date
## 1 8 94 9.2 10 52 64,103 5/14/2021
## 2 12 290 9.1 8 40 32,415 11/18/2022
## 3 14 177 9.1 12 100 43,574 6/17/2021 9/16/2021
## 4 16 31 9.1 16 70 94,811 7/29/2020 9/23/2020
## 5 17 51 9.1 12 90 81,568 3/12/2020 5/28/2020
## 6 19 112 9.1 20 80 58,576 6/18/2022 8/28/2022
## Day_aired
## 1 Friday
## 2 Friday
## 3 Thursday
## 4 Wednesday, Thursday
## 5 Thursday
## 6 Saturday, Sunday
## Main.Role
## 1 Lee Je Hoon, Tang Jun Sang, Hong Seung Hee
## 2 Park Ji Hoon, Hong Kyung, Choi Hyun Wook, Kim Su Gyeom
## 3 Jo Jung Suk, Jung Kyung Ho, Jeon Mi Do, Yoo Yeon Seok, Kim Dae Myung
## 4 Lee Joon Gi, Jang Hee Jin, Moon Chae Won, Seo Hyun Woo
## 5 Jo Jung Suk, Jung Kyung Ho, Jeon Mi Do, Yoo Yeon Seok, Kim Dae Myung
## 6 Lee Jae Wook, Hwang Min Hyun, Yoo Joon Sang, Jung So Min, Shin Seung Ho, Oh Na Ra
ggplot(dramas, aes(x = Score , y = Popularity)) +
geom_point(alpha = 1.6, size = 3, color = "orange") +
labs(title = "Relación entre puntaje y popularidad en Kdramas",
x = "Score", y = "Popularity")
hist(dramas$Episodes, main = "Histograma de cantidad de episodios", xlab = "Episodios", ylab = "Frecuencia", col = "pink", breaks = 5)
# Boxplot
ggplot(dramas, aes(x = Episodes, y = Score)) +
geom_boxplot() +
labs(title = "Boxplot de cantidad de episodios por la cantidad de puntaje", x = "Episodios", y = "Puntaje")
## Warning: Continuous x aesthetic
## ℹ did you forget `aes(group = ...)`?
```