DS - R | Aug 20 - Sep 05

Discussion in 'Big Data and Analytics' started by K Manoj, Aug 19, 2018.

  1. K Manoj

    K Manoj Moderator
    Staff Member Simplilearn Support

    Joined:
    Aug 4, 2017
    Messages:
    228
    Likes Received:
    19
    *thread locked for this batch learners.
    Please post your questions below.
     
    #1
  2. Ramya_37

    Ramya_37 Member

    Joined:
    Aug 19, 2016
    Messages:
    5
    Likes Received:
    2

    Attached Files:

    #2
    Last edited: Aug 21, 2018
    _9804 and _32327 like this.
  3. Nikzad

    Nikzad Member

    Joined:
    Feb 29, 2016
    Messages:
    3
    Likes Received:
    0
    Kindly add "Statistics Essentials for Data Science" to my course.
     
    #3
  4. David Nguyen_4

    David Nguyen_4 Customer
    Customer

    Joined:
    Aug 7, 2018
    Messages:
    8
    Likes Received:
    0
    Please add "Statistics Essentials for Data Science" to my course as well.
     
    #4
  5. jaya chandra(4686)

    jaya chandra(4686) New Member
    Alumni

    Joined:
    Apr 17, 2013
    Messages:
    1
    Likes Received:
    0
    Kindly add "Statistics Essentials for Data Science" to my course.
     
    #5
  6. Rajesh Khanna_1

    Rajesh Khanna_1 New Member

    Joined:
    May 26, 2018
    Messages:
    1
    Likes Received:
    0
    Kindly add "Statistics Essentials for Data Science" to my courses and respond via mail... Thanks.
     
    #6
  7. _32327

    _32327 Member

    Joined:
    Jun 14, 2018
    Messages:
    9
    Likes Received:
    0
    Kindly add "Statistics Essentials for Data Science" to my course.
     
    #7
  8. Rishank Jain

    Rishank Jain New Member

    Joined:
    Jul 6, 2018
    Messages:
    1
    Likes Received:
    0
    It's showing only a single lecture of 30 minutes"Statisticss Essential for data science "
     
    #8
  9. _26564

    _26564 New Member

    Joined:
    Mar 20, 2018
    Messages:
    1
    Likes Received:
    0
    Please add "Statistics Essentials for Data Science" to my course. Waiting for the update.
     
    #9
  10. Mohamed Hantirah

    Mohamed Hantirah New Member
    Alumni

    Joined:
    Mar 23, 2018
    Messages:
    1
    Likes Received:
    0
    Please add "Statistics Essentials for Data Science" to my course
     
    #10
  11. _9804

    _9804 Member

    Joined:
    Jul 14, 2017
    Messages:
    5
    Likes Received:
    0
    Need attention!! Kindly add "Statistics Essentials for Data Science" to my course.
     
    #11
    Last edited: Aug 22, 2018
  12. _23539

    _23539 Sohan Madhana
    Alumni

    Joined:
    Feb 16, 2018
    Messages:
    4
    Likes Received:
    0
    Please add "Statistics Essentials for Data Science" to my course.
     
    #12
  13. Ramya_37

    Ramya_37 Member

    Joined:
    Aug 19, 2016
    Messages:
    5
    Likes Received:
    2
    When I click on Lab access, it opens up. But when I enter code and Run it, I am receiving error. Could the simplilearn team fix this ? Many others in my class are also facing similar lab issue.
     
    #13
  14. _32504

    _32504 Member

    Joined:
    Jun 18, 2018
    Messages:
    9
    Likes Received:
    0
    I missed last 8 minutes of my todays class Day-2 due to my internet connection issues; downloaded class 2 only to find out that voice is entirely missing for the session. Can this be fixed immediately otherwise this recording will not be effective after some days from now. Can this be verified and fixed if possible; below is the filename
    'data_science_certification_training_-_r_programming_batch_10_aug_20-21-22-23-24-27-28-29-30-31_sep_3-4-5_2018-20180821_0402-1_1534853986'
     
    #14
  15. _9804

    _9804 Member

    Joined:
    Jul 14, 2017
    Messages:
    5
    Likes Received:
    0
    Need urgent attention here. Please add "Statistics Essentials for Data Science" to my course.
     
    #15
  16. Priyanka_Mehta

    Priyanka_Mehta Well-Known Member
    Simplilearn Support

    Joined:
    May 25, 2017
    Messages:
    807
    Likes Received:
    55
    Hi all, the said course is assigned to all the learners who have requested for the same.

    Happy Learning guys!!
     
    #16
    _9804, _23539 and Nikzad like this.
  17. Nikzad

    Nikzad Member

    Joined:
    Feb 29, 2016
    Messages:
    3
    Likes Received:
    0
    Thank you for adding the requested course.
     
    #17
  18. _32410

    _32410 Member

    Joined:
    Jun 15, 2018
    Messages:
    7
    Likes Received:
    0
    when i install Rstudio it doesnt recognise any variables. have tried reinstalling as well
     
    #18
  19. _23539

    _23539 Sohan Madhana
    Alumni

    Joined:
    Feb 16, 2018
    Messages:
    4
    Likes Received:
    0
    need help in these questions.

    #Assignment on nested for loop
    # 1111
    # 111
    # 11
    # 1

    n = as.integer(readline(prompt = "enter value:"))
    j = as.integer(readline(prompt = "enter # of repetitions:"))

    while (j >= n) {
    print(rep(n,j))
    j = j-1
    }

    needed o/p: right alligned
    # 1111
    # 111
    # 11
    # 1​
    my o/p: left alligned
    # 1111
    # 111
    # 11
    # 1


    #Assignment: Strip off the beginning space char from the following character vector

    strings = c(" Astha Ahuja", " Beena Ahuja", " Charu Raheja")
    gsub(pattern=" ",replacement="",x=strings)
    strings

    intended o/p: ("Astha Ahuja", "Beena Ahuja", "Charu Raheja")
    my output:("AsthaAhuja", "BeenaAhuja", "CharuRaheja")

    #Assignment:Replace ” .” with space character

    String = c("Divya.Ahuja","Mukul.Khanna")
    gsub(pattern = ".", replacement = " ", x = String)
    String

    intended o/p: "Divya Ahuja","Mukul Khanna"
    my o/p: " "," "
     
    #19
  20. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    Hi,

    Can we please check if it is 32 bit / 64 bit issue for R. First of all please check whether you can write any command on R console (which should work even if Rstudio is not installed). If R is working fine, then we can conclude that the problem is in Rstudio.

    Regards
    Samridhi
     
    #20
  21. _32410

    _32410 Member

    Joined:
    Jun 15, 2018
    Messages:
    7
    Likes Received:
    0
    my R is working fine and ive checked it. Rstudio none of the global variables are getting created.
    Should R server be installed as well
    both my 32bit and 64bit of R is working perfectly fine.
    only my RStudio is giving me an issue.
    am lagging behind since i am unable to fix this. Please help or atleast i want to use the R-lab.
     
    #21
  22. _32410

    _32410 Member

    Joined:
    Jun 15, 2018
    Messages:
    7
    Likes Received:
    0
  23. Ramya_37

    Ramya_37 Member

    Joined:
    Aug 19, 2016
    Messages:
    5
    Likes Received:
    2
    My system is 64bit Windows OS with 16GB RAM. R Studio which I have installed is working fine.
    For my Lab access today, I was able to run getwd() command.
    However, I will need help / guidance to understand how I can upload / reference data sets in code on Lab.
    I have uploaded the titanic dataset but it is not getting accessed on Lab.
    Attached screenshot:
     

    Attached Files:

    #23
  24. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    No Rserver not required. Only Rstudio Desktop Open Source Free version required from the following link: https://www.rstudio.com/products/rstudio/download/

    I am sure you would have done - but just confirming that you tried pressing ctrl+enter or "run" to execute the statements entered in the RScript. If this doesn't get done today I'll request my colleague to get in touch with you tomorrow morning.

    Regards
    Samridhi
     
    #24
  25. _37797

    _37797 New Member

    Joined:
    Aug 18, 2018
    Messages:
    1
    Likes Received:
    0
    #Assignment: please print the table of 2
    # 2 X 1 = 2
    # 2 X 2 = 4
    #
    #
    # 2 X 10 = 20

    a=("2 X")
    for (i in 1:10)
    {
    res=2*i
    print(paste(a,i,"=",res))
    }
     
    #25
  26. _32504

    _32504 Member

    Joined:
    Jun 18, 2018
    Messages:
    9
    Likes Received:
    0
    #Assignment: Strip off the beginning space char from the following character vector
    use sub inplace of gsub; gsub replaces all the white spaces whereas sub is limited to replace only the first character which is required to be done in this case

    #Assignment:Replace ” .” with space character
    dot(.) is a special character and needs to be preceded by escape sequence character ie \\. and that will solve the issue

    #Assignment on nested for loop
    rep(n,j) line needs to be replaced with vectors to print space and 1 and 2nd vector for repetition of space and 1
    rep(c(" ",1),c(No_of_repititions -j, j ))
    This logically will solve the problem but now ends up in another problem as it gets printed with the quotes as shown below
    [1] "1" "1" "1" "1"
    [1] " " "1" "1" "1"
    [1] " " " " "1" "1"
    [1] " " " " " " "1"

    I have come up with modified version of the same with 2 control loops one for controlling space and other for 1
    i = 4 #Number of iterations required to be printed
    space = ""
    while(i >= 1 )
    {
    output = ""
    for(j in c(1:i)) #Inner loop to add #of 1s
    {
    output = paste(output,1,sep = "")
    }
    output = paste(space, output, sep="")
    print(output)
    i = i - 1
    space = paste(space, " ", sep = "")#Append for each iteration
    }

    However this also is not full proof as the final output still gets enclosed in quotes; looking for solution to print it without quotes
    [1] "1111"
    [1] " 111"
    [1] " 11"
    [1] " 1"
     
    #26
  27. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    Hi,

    The quotes will come as it represents that the output belongs to character class. A space + numeric can't belong to numeric class - please recall the discussion on what happens when we mix character + numeric classes.

    Regards,
    Samridhi
     
    #27
  28. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    Hi,

    If the issue is still not resolved, I'll help you work on R Lab on Monday. Let's spend 5 mins to demonstrate this to you during the class.

    Regards
    Samridhi
     
    #28
  29. Ramya_37

    Ramya_37 Member

    Joined:
    Aug 19, 2016
    Messages:
    5
    Likes Received:
    2
    Yes, that would be helpful. Thank you Samridhi
     
    #29
  30. _32410

    _32410 Member

    Joined:
    Jun 15, 2018
    Messages:
    7
    Likes Received:
    0
     
    #30
  31. _32410

    _32410 Member

    Joined:
    Jun 15, 2018
    Messages:
    7
    Likes Received:
    0

    yes of course i did press "Run", no one has reached out to me.
     
    #31
  32. Ramya_37

    Ramya_37 Member

    Joined:
    Aug 19, 2016
    Messages:
    5
    Likes Received:
    2
    Thanks Samridhi for the quick demo of loading dataset in R Lab. Good to know that the location of the dataset we need to add the /data/ alongwith the filename of dataset. This solved my R Lab issue
     
    #32
  33. _32504

    _32504 Member

    Joined:
    Jun 18, 2018
    Messages:
    9
    Likes Received:
    0
    Hi,

    Need help on printing the column name in the output line. Column name is not at all printing by applying the apply function; however executing individually prints as per expectation.

    #Find the sum of each column and confirm if the sum is greater than 800 or not
    #Hint: create a custom function to find the sum and compare it with 800,
    #and apply the function on each numerical column

    ir = as_tibble(iris)

    sum_compare = function(i){
    int_sum = sum(i)
    col_name = names(i)
    output = paste(col_name, "Sum is", int_sum)
    if (int_sum > 800) {
    output = paste(output, "and is greater than 800.")
    } else {
    output = paste(output, "and is less than or equal to 800.")
    }
    return(output)
    }

    apply(X = ir[,c(1:4)], MARGIN = 2, FUN = sum_compare)

    Output :
    Sepal.Length
    " Sum is 876.5 and is greater than 800."
    Sepal.Width
    " Sum is 458.6 and is less than or equal to 800."
    Petal.Length
    " Sum is 563.7 and is less than or equal to 800."
    Petal.Width
    " Sum is 179.9 and is less than or equal to 800."

    However on executing sum_compare(ir[1])
    output :
    "Sepal.Length Sum is 876.5 and is greater than 800."

    Rgds,
    Bhupendra
     
    #33
  34. _32504

    _32504 Member

    Joined:
    Jun 18, 2018
    Messages:
    9
    Likes Received:
    0
    Hi,
    Can someone please suggest a solution for below
    #Count how many different petal widths are there in each species.

    The one I can think of is table(iris$Petal.Width, iris$Species ) but not able to think of a method for grouping X by Y axis

    Rgds,

    Bhupendra
     
    #34
  35. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    Hi,

    Following is the solution to this:

    library(dplyr)
    iris%>%group_by(Species)%>%summarise(n_distinct(Petal.Width))

    Regards
    Samridhi
     
    #35
  36. _37260

    _37260 Member

    Joined:
    Aug 13, 2018
    Messages:
    3
    Likes Received:
    0
    Why the recording of last class is not available ,held on August 31? Please upload it as soon as possible.
     
    #36
  37. Samridhi Dutta

    Samridhi Dutta Well-Known Member
    Trainer

    Joined:
    Aug 16, 2017
    Messages:
    76
    Likes Received:
    10
    H
    Hi,

    This is because apply function sends the column vector as the input (without the col name). But when it gives output, it gives columnwise (with col name on the top). So, inside the function names (col) gets value = NULL, as col. name is not a part of our arguments. Let me know if we understand this, other-wise I am okay with discussing in the class.

    Regards,
    Samridhi
     
    #37
  38. _37260

    _37260 Member

    Joined:
    Aug 13, 2018
    Messages:
    3
    Likes Received:
    0
     
    #38
  39. mayurfaria

    mayurfaria Member
    Alumni

    Joined:
    Jun 21, 2018
    Messages:
    3
    Likes Received:
    0
    Hi Samridhi ,

    Please can you help me on healthcare project goal 5 question as i am not sure what is the prediction formula . I have applied linear regression formula and used the summary function . But not sure what needs to be done after that .

    Thanks

    Rgds
    Mayur
     
    #39
  40. _32327

    _32327 Member

    Joined:
    Jun 14, 2018
    Messages:
    9
    Likes Received:
    0
    sep5 wed class recording not uploaded
     
    #40
  41. _32327

    _32327 Member

    Joined:
    Jun 14, 2018
    Messages:
    9
    Likes Received:
    0
    which topics we prepare for the simulation test.
     
    #41
  42. K Manoj

    K Manoj Moderator
    Staff Member Simplilearn Support

    Joined:
    Aug 4, 2017
    Messages:
    228
    Likes Received:
    19
    All of the course content is required.
    But, do not worry take the test once. There are max 3 attempts.
     
    #42
  43. _32504

    _32504 Member

    Joined:
    Jun 18, 2018
    Messages:
    9
    Likes Received:
    0
    Any update on this one please
     
    #43

Share This Page