Global AI and Data Science

 View Only
  • 1.  Debugging script in RStudio on Skills Network Labs

    Posted Mon February 10, 2020 11:12 AM
      |   view attached
    Hello : I've just started to learn R Programming on Skills Network Labs platform

    I'm writing code in RScript as:

    name <- "Username"
    name <- "Mike Mackgrath"
    print(name)

    However, after running the script I'm getting following error:

    >print(name)
    Error in print(name) : object 'name' not found

    Can anyone help me to resolve this problem.

    ------------------------------
    Md Ashfaqul Alam Joarder
    ------------------------------

    #GlobalAIandDataScience
    #GlobalDataScience


  • 2.  RE: Debugging script in RStudio on Skills Network Labs

    Posted Tue February 11, 2020 10:32 AM
    The variable name you declared was not called. See your first line of code.

    ------------------------------
    Adedeji Abioye
    ------------------------------



  • 3.  RE: Debugging script in RStudio on Skills Network Labs

    Posted Tue February 11, 2020 10:33 AM
    You declared Username and not name. Please check your code.

    ------------------------------
    Adedeji Abioye
    ------------------------------



  • 4.  RE: Debugging script in RStudio on Skills Network Labs

    Posted Wed February 12, 2020 10:58 AM
    Probably, you found the answer already.

    What I do NOT see in your command console the earlier statements  like '> name <- "Mike Mackgrath"'. So earlier statement with 'name' is not executed. Select all the statements and try R. It will work.

    ------------------------------
    Manash Sarma
    ------------------------------