Forum Replies Created

Viewing 15 posts - 16 through 30 (of 109 total)
  • Author
    Posts
  • in reply to: Scatterplot3js not working. #23484

    Hi Roberto,

    Thank you for your message – could you copy and paste the code that you were running? It may be that you forgot to load the threejs package, which contains the scatterplot3js function. Let me know if that helps!

    Best,

    Merav

    in reply to: Hispanic Exercise rchart problem #23483

    Hi Elizabeth,

    Thank you for your question, and my sincerest apologies for the delay in response. It looks like rjson has not be loaded in the environment. Have you tried running install.packages("rjson"), then library(rjson)? That should solve the issue.

    Please let me know if you have any additional questions!

    Best,

    Merav

    in reply to: Video Not Playing #23482

    Hi Latoya,

    Thank you for letting us know – this issue has been resolved and we really appreciate the feedback!

    Best,

    Merav

    in reply to: R-chart problem #23481

    Hi Elizabeth,

    Thank you for your question and apologies for the delayed response. When you save it, do you get an html file? Could you copy and paste the code you use to create it? That will help me get a better idea of what might be the issue.

    Best,

    Merav

    in reply to: Video not playing #23480

    Hi Christopher,

    My sincerest apologies for the delay in response – we updated our video storage system a little while ago and you should be able to see it. Are you able to view the video now?

    Best,

    Merav

    in reply to: Stock Chart Date Range #23479

    Hi Roberto,

    Apologies for the delayed response – you can use the following notation to select specific dates:

    AMZN$AMZN.Close[‘2007-06::2008-01-12’]

    This will select dates from June, 2007 to January 12, 2008. There is some great documentation in this site: http://www.quantmod.com/examples/data/#subset

    Please let me know if you have any more questions!

    Best,

    Merav

    in reply to: Visualizing Social Media Networks: Concept Review 5 Error #23478

    Hi Kisha,

    Is this error still occurring for you? If so, you can click on this link to go to the concept review directly: http://datasociety.co/quizzes/concept-review-5-visualizing-social-media-networks-3/

    Please let me know if that helps!

    Best,

    Merav

    in reply to: Trouble with authenticating Twitter application #23477

    Hi Alex,

    It’s great to hear from you, thank you for your message! Based on the error, I would double check how your OAuth was set up and make sure that you correctly copied and pasted all four terms correctly.

    This OAuth documentation goes through each step you need to take in order to set it up. Make sure to get the access token as well, which you will need to connect R to the API.

    Let me know if that helps! If it doesn’t work, let me know what steps aren’t working for you. One other thing to be mindful of is the connection that you’re on – it may be that the authorization is incongruous with a more secure network.

    Have a great weekend!

    Best,

    Merav

    in reply to: Exercise 3: NavBar Page #19679

    Hi Kisha,

    Glad to hear you’re working on this! The error you got is probably because your free Shinyapps account has a limited number of apps that you can deploy at one time. My advice is to remove one of the apps you’ve posted and try again – that should clear up that issue.

    I hope that helps!

    Best,

    Merav

    in reply to: Exercise 3: NavBar Page #19614

    Hi Kisha,

    I’ve looked into this error – it looks like this can be caused if you’re running McAfee anti-virus software on your computer. If you’re running that on your computer, I recommend you quit the application and try again. I’d also make sure that you’re running the latest versions of R and RStudio – R was just updated to version 3.3.3, and you can download it from the Cran R website. In addition, check the “Update” button on the “Packages” tab in the lower right corner. That will go through all your packages and update them. Then, restart R and RStudio and see if that fixes it.

    Looking at the documentation for both shinyapps and rsconnect, it looks like the rsconnect package is an updated version of shinyapps that includes publishing R Markdown (a notebook version where you can write and execute code, as well as type paragraphs). As long as you found code that works for you, that’s fine – every programmer programs in a slightly different way, and given updates that occur to packages, your code may look different than ours.

    Let me know if disabling McAfee and updating the packages helped!

    Best,

    Merav

    in reply to: Web Scraping with R #19583

    Nice fix, Kisha!

    In terms of other tools to use, Firebug is a good plugin for Chrome. I think they discontinued it for Firefox, but they have a Devtools plugin instead. You can also right-click on a page and click on ‘Inspect Element’ to get additional information about the page.

    Keep up the good work!

    Best,

    Merav

    in reply to: Exercise 3: NavBar Page #19582

    Hi Kisha,

    Thanks for your post! Could you copy and paste the code that you used to deploy the app? Here is the code I used to deploy the stocks app:

    if (!require("devtools"))
      install.packages("devtools")
    devtools::install_github("rstudio/shinyapps")
    
    # Create a username and password at shinyapps.io and input the 
    # token and secret to set your account information.
    
    shinyapps::setAccountInfo(name = "<Username>", 
                              token = "<TOKEN>",
                              secret = '<SECRET>')
    # Load shinyapps.
    
    library(shinyapps)
    
    # Now deploy the app to shinyapps so you can send the link to anyone!
    
    shinyapps::deployApp("./stockreturns_navbar/") 

    A few things to keep in mind:

    1. Make sure your working directory is set so that R can find the folder with the UI and Server scripts.
    2. Make sure that the name of the app doesn’t have any spaces – R has trouble reading names with spaces.
    3. When you load rCharts, there is a patch we added into the code which you’d need to add in the server script:

     ## The rCharts package was not updated for the latest version of R, so run this
    ## code below to install rCharts.
    
    install.packages("devtools")
    install.packages("Rcpp")
    library(devtools)
    library(Rcpp)
    install_github('ramnathv/rCharts')

    Because the scripts are connected, you only need to load the packages in one of them, which is why you don’t need to add it into the UI script if you have it in the server script already.

    Let me know if that helps!

    Best,

    Merav

    in reply to: Visualizing Health with rCharts Concept Review #19556

    Hi Kisha,

    Thanks for your questions! The rename() function has the following syntax (which you can look at by typing in ?rename into the console / script window): rename(x, replace, warn_missing = TRUE, warn_duplicated = TRUE). The rename() function requires that you put the data set in first, followed by the column names and the ones you’d want to replace it with. The issue with rename is that you have to use it for all the column names. Also, you have to specify that it comes from the ‘plyr’ package and not the ‘dplyr’ package so you don’t get an error. This is what that syntax would look like:

    long_data = plyr::rename(long_data, c("topState.State" = "State", "Ancestry" = "Ancestry",
                        "Percentage" = "Percentage"))

    You can see how this may be tedious if we have many columns. Gsub will only replace entries within your data that are read in a character format, so it wouldn’t work on column names. You can look up additional documentation by typing in ?gsub to see what the arguments are and how to use it.

    The syntax to use for renaming one column is the following:

    colnames(long_data)[colnames(long_data) == "topState.State"] <- "State"

    Here, we’re subsetting only the column we want to rename – this is useful if you don’t know which column it is, so the code searches for the title as opposed for you having to search for the exact column number in the dataset.

    In terms of the difference between read.delim and read.csv, they serve the same purpose. Read.csv looks at comma separated values (so all values are separated by commas), as opposed to read.delim, which does not require a comma, but looks at spaces. This can be seen in the ‘sep’ arguments below:

    read.csv(file, header = TRUE, sep = ",", quote = "\"",
             dec = ".", fill = TRUE, comment.char = "", ...)
    
    read.delim(file, header = TRUE, sep = "\t", quote = "\"",
               dec = ".", fill = TRUE, comment.char = "", ...)

    In general, I use read.csv to input new datasets.

    Let me know if you have any more questions!

    Best,

    Merav
    `

    in reply to: Visualizing Health with rCharts Concept Review #19554

    Hi Kisha,

    That’s great! Sounds like you’re on your way to becoming a great programmer!

    Let me know if you have any more questions 🙂

    in reply to: Data Society Question #19543

    Hi Elizabeth,

    Thank you for your post! We don’t currently offer retail in-person workshops, but we have been discussing this option as we’ve gotten some requests for this. I’ll definitely let you know if we put on some in-person workshops in the future!

    Best,

    Merav

Viewing 15 posts - 16 through 30 (of 109 total)