Thank you for nice video. Kindly mention how to change the whole data frame with some logical condotion.
@StatisticsGlobe8 ай бұрын
Thanks for the kind comment! This is actually what is happening in the last example (i.e. data[data == 3] <- 777). Does this work for you? Regards, Joachim
@vijayarjunwadkar4 жыл бұрын
Liked it! Concept explained nicely with easy examples and simple manner to help understand! Keep it up!
@StatisticsGlobe4 жыл бұрын
Thanks a lot Vijay, great to get such positive feedback! :)
@danielarotaru34912 жыл бұрын
Hello! Thanks for this video, I finally understood why a bit of the code didn't work for me! I have a question that I don't know if there is even an answer (at least I can't find it anywhere). I want to do this replacement but with two conditions, I don't get any error but the replacement isn't being done. Plus, I already transformed both variables into chr. credit_data$length[credit_data$title == "NA" & credit_data$lenght == "NA"]
@StatisticsGlobe2 жыл бұрын
Hey Daniela, thank you for the kind words, glad this video helped! Regarding your question: You have to select NA values using the is.na function. Does the following code work for your data? credit_data$length[is.na(credit_data$title) & is.na(credit_data$lenght)]
@cristopherdunaway Жыл бұрын
Thank you!
@matthias.statisticsglobe Жыл бұрын
Hey Christopher! Thanks for the positive response!
@ProfBoggs3 жыл бұрын
Do you have a video that explains how to replace a value in one column, given another value in a different column? For instance, my dataframe named data has two columns, NAME and OCCUPATION. In pseudo-code, I want something that does this: if data$NAME = "Marie", then data$occupation = "Statistician" but only for that same row. Optimally, this would be in basic R.
@StatisticsGlobe3 жыл бұрын
Hey, does this R code work for you? data$occupation[data$NAME == "Marie"]
@ProfBoggs3 жыл бұрын
@@StatisticsGlobe Hi Joachim, that works. Thank you kindly.
@StatisticsGlobe3 жыл бұрын
You are very welcome!
@jared11223 жыл бұрын
Thanks for vid - nicely explianed!
@StatisticsGlobe3 жыл бұрын
Glad you enjoyed it Jared!
@ambroiseyeboua20433 жыл бұрын
thanks you. i want to know, how to replace multiple values in the same column with a corresponding list of values with a single click
@StatisticsGlobe3 жыл бұрын
Hey Ambroise, thank you for the kind words, and I'm sorry for the late response. I just came back from holidays and did not have the chance to read your message earlier. Do you still have problems with this?
@ambroiseyeboua20433 жыл бұрын
@@StatisticsGlobe thank you, i was able to solve the problem
@StatisticsGlobe3 жыл бұрын
That's great to hear!
@danhdo19103 жыл бұрын
How did you do this? :( I am looking for a solution too!
@BOY_NAME_3 жыл бұрын
cool thanks!! worked for my case!!!
@StatisticsGlobe3 жыл бұрын
Great, glad to hear that!
@jeremylarcher39812 жыл бұрын
thank you!
@StatisticsGlobe2 жыл бұрын
You're welcome Jeremy!
@kathrynmalchow31993 жыл бұрын
THANK YOU :*
@StatisticsGlobe3 жыл бұрын
You're welcome Kathryn! :)
@apostoloskolovos98153 жыл бұрын
thank you very much
@StatisticsGlobe3 жыл бұрын
You are very welcome Apostolos!
@CoachPegasus2 жыл бұрын
How to change/replace/impute 04-04-2020 to 04/04/2020 in date column ? if Date column is character column
@StatisticsGlobe2 жыл бұрын
Hey, please have a look here: statisticsglobe.com/change-format-of-dates-in-r
@SudhirKumar-ry4gk4 жыл бұрын
I need your help, actually I have data frame in which duplicate value, I want to add new column and show if any value comes two times then I want againt both result come 2,2 and if repeat three times then it comes 3 againt all repeated values which comes thrice.
@StatisticsGlobe4 жыл бұрын
Hey Sudhir, please check out this thred at Stack Overflow: stackoverflow.com/questions/7450600/count-number-of-rows-per-group-and-add-result-to-original-data-frame I think it's explaining what you are looking for. Regards, Joachim
@SudhirKumar-ry4gk4 жыл бұрын
@@StatisticsGlobe Thanks for the revert it's very useful.
@StatisticsGlobe4 жыл бұрын
That's nice to hear :)
@abhijeetjahagirdar61174 жыл бұрын
Hello Sir your videos are really helpful while solving exercise but I really need your help in one problem I came across data science in R book. Q. For the job field, combine the jobs with less than 5% of the records into a field called other. Above question is from bank_marketing_training data set of 26874 obs of 21 variables, in that job is one of them.How to compute in R I didn't get how to write in R and get it executed.
@StatisticsGlobe4 жыл бұрын
Hey Abhijeet, nice to hear from you again. Is this working? jobs_less_5
@abhijeetjahagirdar61174 жыл бұрын
@@StatisticsGlobe yes it worked its really short and sweet execution otherwise i would have complicated it.I need to learn from scratch and revise it,your tutorials are vey helpful and explainatory thanks bro and guide like you is awe-inspiring privilege.
@StatisticsGlobe4 жыл бұрын
Thanks mate, I'm really happy to get such an awesome feedback! Keep me updated about your learning progress :)
@jamesleleji6984 Жыл бұрын
team code 1 QATAR QA 2 ENGLAND NA 3 SENEGAL SN 4 UNITED STATES US 5 ARGENTINA AR 6 DENMARK DK 7 ENGLAND NA 8 WALES NA 9 WALES NA Given the data frame above, i want to convert the NA for ENGLAND and WALES to their code, EN and WL, respectively while keeping the codes for the other countries unchanged. How do i write the code in R. Thanks
@cansustatisticsglobe Жыл бұрын
Hello James, You can use the method given in the tutorial. Didn't it work for you? Regards, Cansu
@jamesleleji6984 Жыл бұрын
@@cansustatisticsglobe df |> mutate(code = case_when(team == "ENGLAND" ~ "EN", team == "WALES" ~ "WL", TRUE ~ code)) This code worked for me. It replaced the NA with EN and WL and retained the code values of other countries. Thanks
@cansustatisticsglobe Жыл бұрын
@@jamesleleji6984, your solution is even more advanced, congratulations! When you stick with the tutorial, you should write something like this: data
@jamesleleji6984 Жыл бұрын
@@cansustatisticsglobe Thanks for always being helpful.