daranzolin / rcanvas

R Client for Canvas LMS API
Other
90 stars 43 forks source link

get_course_items() and get_course_gradebook() error in UseMethod("mutate:_") #47

Closed LouJay closed 3 years ago

LouJay commented 3 years ago

I get the the following error message when running get_course_items() and get_course_gradebook(), using a script that previously worked (I guess because of a dplyr update):

Error in UseMethod("mutate") : no applicable method for 'mutate' applied to an object of class "list" In addition: Warning message: mutate_() is deprecated as of dplyr 0.7.0. Please use mutate() instead. See vignette('programming') for more help

LouJay commented 3 years ago

I think that just updating the last line of the get_course_items() function with [[1]] solves the issue, so that we get the data frame that is inside of the list, instead of the list itself. As in the example below:

process_response(url, args)[[1]] %>% dplyr::mutate(course_id = course_id)

tormodb commented 3 years ago

I also experienced this problems, and I made a pull request where I implemented your solution. It is updated in my fork of rcanvas.

LouJay commented 3 years ago

Thank you very much @tormodb !

LouJay commented 3 years ago

I will close this issue, given that @tormodb has already implemented a solution and made a pull request.