Confusing Error Message

Hey Guys,
I am getting a weird error message. My code was working and then I changed the csv file to an updated version with a "category" column. I then added the column "category" to my select line and my group_by line. Sadly I cannot post the data itself because it is confidential but any help would be much appreciated. Code posted below.

library(readr)
library(dplyr)
library(tidyr)
library(stringr)
library(lubridate)
library(reprex)
library(tidyverse)
library(quantreg)

top25000 <- read_csv("index_sales_export.csv")
blue_chips <- top25000 %>%
  select(graded_title,date,price,vcp_card_grade_id) %>%
  filter(date >= as.Date("2018-07-08")) %>%
  group_by(graded_title, 
           vcp_card_grade_id) %>%
  summarise(Market_Cap = sum(price),
            Average_Price = mean(price),
            count=n(),
            Standard_Deviation = sd(price),
            SD_over_Price = (Standard_Deviation/Average_Price)) %>%
  filter(Market_Cap >= 10000 & count >= 25) %>%
  rename(Total_Number_of_Sales = count)

blue_chips <- blue_chips[order(-blue_chips$SD_over_Price), ]
blue_chips

ungroup_blue_chips <- top25000 %>%
  filter(graded_title %in% blue_chips$graded_title) %>%
  select(graded_title,date,price,vcp_card_grade_id)
head(ungroup_blue_chips)

The error message I am getting is

Error in sports_top25000 %>% select(graded_title, date, price, vcp_card_grade_id,  : 
  could not find function "%>%<-"

Hi @jbeckerman!

I don't think the code you posted includes the line that is causing the error (or else maybe you pasted in the wrong error message?).

Notice that the error message tells you that it ran into problems on a line that began with sports_top25000 %>% … None of the code posted above includes any objects named sports_top25000.

I'd start by looking for a line in your code that starts with the exact text in the error message (you can even use Find/Replace for this), and then checking carefully for typos around that spot.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.