educative.io

Didnt work the command in cmd last part in page

Hi, please when i want do the step 4 in last part in cmd appear error. could someone help me.
thanks

Step 4: Copy the following command

view_id ← filter(ga_accounts, accountName == “personal-website”, webPropertyName == “personal-website-property”) %>%pull(viewId)


Course: Launching a Personal Website Using R - Learn Interactively
Lesson: Use R for Data Analysis - Launching a Personal Website Using R

Hi @ayman !!
It seems like you encountered an error because the %>% operator from the dplyr package was not recognized. The %>% operator is used for piping, which allows you to chain together multiple operations in a more readable and concise manner.

To resolve the error, make sure you have the dplyr package installed and loaded in your R environment. You can install it using the following command:

install.packages("dplyr")

After installing the package, load it into your R session using the library function:

library(dplyr)

Once you have dplyr loaded, you can try running the code snippet again:

ga_accounts <- ga_account_list()
view_id <- filter(ga_accounts, accountName == "<account_name>", webPropertyName == "<website_property_name>") %>%
  pull(viewId)
print(view_id)

Replace <account_name> with your Google Analytics account name and <website_property_name> with your website’s property name. This code should filter the ga_accounts table based on the specified account and property names and retrieve the corresponding view ID.
I hope it helps. Happy Learning :blush:

2 Likes

well thank you very much, but the same problem happen in step 9 even i load all packages

plot_ly(

  • data = users_by_device_type,
  • x = ~deviceCategory,
  • y = ~users,
  • type = “bar”
  • ) %>%
  • layout(title = “Device type of users”)

result:

Error in eval(expr, data, expr_env) : 
  objeto 'deviceCategory' no encontrado


Course: Launching a Personal Website Using R - Learn Interactively
Lesson: Use R for Data Analysis - Launching a Personal Website Using R

any help please!!


Course: The Complete Guide to Spring 5 and Spring Boot 2 - Learn Interactively
Lesson: https://www.educative.io/courses/guide-spring-5-spring-boot-2/JY3oNnPK7yo

Hi @ayman!!
It appears that the issue stems from the usage of the dplyr package in Step 9. To address this error, you can take the following steps:

  1. Check package loading: Firstly, ensure that the necessary packages (googleAnalyticsR, dplyr, plotly, DT) are successfully loaded at the beginning of your code. Make sure there are no error messages or warnings during the package loading process.

  2. Straighten quotation marks: Specifically, try replacing the quotation marks around “bar” with standard straight quotation marks. This may help resolve the issue.

  3. Restart R session: If the problem persists despite the previous steps, consider restarting your R session and rerunning the code from the beginning. This action can potentially resolve any conflicts or issues associated with the R environment.

If you continue to encounter the problem after following these suggestions, please provide any additional error messages or further details about the issue.
I hope these recommendations prove useful in resolving the error. Let me know if you need further assistance.

1 Like

Hi, many thanks and i appreciate your help.

1 Like