Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attach(studentsurvey_2)
- table (Smoke)
- attach(studentsurvey_2)
- table(Height)
- height_factor= cut(Height, breaks= c(0, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200))
- table(height_factor)
- height_factor1= cut(Height, breaks= c(0, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200),
- labels= c("below 150 centimeters", "151 to 155 centimeters", "156 to 160 centimeters", "161 to 165 centimeters", "166 to 170 centimeters", "171 to 175 centimeters", "176 to 180 centimeters", "181 to 185 centimeters", "186 to 190 centimeters", "191 to 195 centimeters", "196 centimeters and above"))
- table(height_factor1)
- attach(studentsurvey_2)
- table(Fold)
- attach(studentsurvey_2)
- table(Pulse)
- pulse_factor= cut(Pulse, breaks= c(0, 30, 40, 50, 60, 70, 80, 90, 100, 110))
- table(pulse_factor)
- pulse_factor2= cut(Pulse, breaks= c(0, 30, 40, 50, 60, 70, 80, 90, 100, 110),
- labels= c("30 bpm and below", "31 to 40 bpm", "41 to 50 bpm","51 to 60 bpm","61 to 70 bpm","71 to 80 bpm","81 to 90 bpm","91 to 100 bpm","101 bpm and above"))
- table(pulse_factor2)
- attach(length_of_service2)
- table(`Length of Service`)
- length_of_service_factor= cut(`Length of Service`, breaks = c(0, 5, 10, 15, 20, 30))
- table(length_of_service_factor)
- length_of_service_factor1= cut(`Length of Service`, breaks = c(0, 5, 10, 15, 20, 30), labels = c("1 to 5 years", "6 to 10 years", "11 to 15 years", "16 to 20 years", "21 years and above"))
- table(length_of_service_factor1)
- attach(age_variable)
- table(Age)
- Age_factor= cut(Age, breaks = c(0, 25, 30, 35, 40, 60))
- table(Age_factor)
- Age_factor1= cut(Age, breaks = c(0, 25, 30, 35, 40, 60), labels = c("25 years old and below", "26 to 30 years old", "31 to 35 years old", "36 to 40 years old", "41 years old and above"))
- table(Age_factor1)
- my_list=list(a=1:10, name="Mike", gender="Female", TRUE)
- my_list
- lists=list(a=1:30, seq(1,10,by=0.5), fav_subj=factor(c("EDA","Route_Surveying","Ethics"),ordered=TRUE,levels=c("EDA","Route_Surveying","Ethics")), TRUE)
- lists
- test=list(seq(1,50,length.out=10),seq(11,21,by=0.3),song=factor(c("Yesterday","Imagine","Into the Unknown","Lover","Let it go"),ordered=TRUE,levels=c("Yesterday","Imagine","Into the Unknown","Lover","Let it go")))
- test
- j=1:6
- xmatrix=matrix(j, nrow=2, ncol=3, byrow = T, dimnames=NULL)
- xmatrix
- xmatrix1=matrix(c(1,2,3,4,5,6), nrow=2, ncol=3, byrow = TRUE, dimnames=list(c("a","b"),c("c","d","e")))
- xmatrix1
- x=1:30
- sixfive=matrix(x,nrow=6,ncol=5,byrow=TRUE,dimnames=list(c("A","B","C","D","E","F"),c("Blue","Red","White","Green","Yellow")))
- sixfive
- sixfive[c("A", "F"),]
- sixfive[,c("White", "Yellow")]
- name = c("Jhancel","Avemae", "Maricel", "Josiephine", "Leslie", "Leandro", "Gabriel", "Mark Jayson", "Keano", "Aira")
- favoritemovie = c("Deadpool", "Can't Help Falling in Love", "Anak", "The hows of Us", "The Notebook", "Guardians Of the Galaxy", "Black Panther", "Five Feet Apart", "Olympus Has Fallen", "HIgh School Musical")
- sports = c("Basketball", "Badminton", "N/A", "Volleyball", "Volleyball", "Basketball", "Basketball", "Basketball", "Tennis", "N/A")
- status = c("Married", "Married", "Widowed", "Single", "Single", "Single", "Single", "Single", "Single", "Single")
- age = c (26, 22, 43, 19, 20, 20, 20, 20, 20, 20)
- celebritycrush = c("Anne Curtis", "Coco Martin", "Brad Pitt", "Daniel Padilla", "Liam Hemsworth", "Dahyun", "Scarlett Johansson", "Mina", "Kendall Jenner", "Enrique Gil")
- Description = data.frame(name, favoritemovie, sports, status, age, celebritycrush)
- str(Description)
- Description$name
- Description$favoritemovie
- Description$name
- Description$status
- name = c("Jhancel","Avemae", "Maricel", "Josiephine", "Leslie", "Leandro", "Gabriel", "Mark Jayson", "Keano", "Aira")
- favoritemovie = c("Deadpool", "Can't Help Falling in Love", "Anak", "The hows of Us", "The Notebook", "Guardians Of the Galaxy", "Black Panther", "Five Feet Apart", "Olympus Has Fallen", "HIgh School Musical")
- sports = c("Basketball", "Badminton", "N/A", "Volleyball", "Volleyball", "Basketball", "Basketball", "Basketball", "Tennis", "N/A")
- status = c("Married", "Married", "Widowed", "Single", "Single", "Single", "Single", "Single", "Single", "Single")
- age = c (26, 22, 43, 19, 20, 20, 20, 20, 20, 20)
- celebritycrush = c("Anne Curtis", "Coco Martin", "Brad Pitt", "Daniel Padilla", "Liam Hemsworth", "Dahyun", "Scarlett Johansson", "Mina", "Kendall Jenner", "Enrique Gil")
- Description = data.frame(name, favoritemovie, sports, status, age, celebritycrush)
- zxc= subset(Description, status!= "Single"& age<20)
- zxc
- Name=c("Sam","Kim","Jeff","Ley","Ann","Jim","Steph","Mimi","Ana","Reg")
- Gender=c("Male","Male","Male","Male","Female","Male","Female","NA","Female","Female")
- Age=c(23,26,32,20,31,32,40,39,20,20)
- Marital_Status=c("Single","Single","Single","Married","Widow","Separated","Single","Married","Single","Single")
- Highest_Educational_Attainment=c(4,3,2,5,6,4,1,4,4,5)
- DF=data.frame(Name,Gender,Age,Marital_Status,Highest_Educational_Attainment)
- DF
- SD=subset(DF,Gender=="Male" & Marital_Status=="Single" & Age>=30 & Age<=40 & Highest_Educational_Attainment>=4)
- SD
- final_scores= c(40, 78, 80, 90, 92, 56, 72, 55, 88, 81, 81, 79, 93)
- ifelse(final_scores>=60, "PASS", "FAILED")
- final_scores= c(40, 78, 80, 90, 92, 56, 72, 55, 88, 81, 81, 79, 93)
- ifelse(final_scores<=60, "E", ifelse(final_scores<=70, "D", ifelse(final_scores<=80, "C", ifelse(final_scores<=90, "B", ifelse(final_scores<=100, "A")))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement