0

I'm trying to create a function that takes a name_id as the sole parameter. I then want to use this name_id as part of a url where the function will scrape some data from a website etc..(not crucial for the Q). How do I pass the name_id parameter into the url?

Example: The function looks like this: my_function <- function(name_id) { url <- https://www.sports-reference.com/cbb/players/first-last-#.html}

I would like the name_id parameter to replace the first-last-# part of the URL so if the name_id were joe-random-2 it would run as url <- https://www.sports-reference.com/cbb/players/joe-random-2.html

Any help would be much appreciated!

Matt
  • 41
  • 4

0 Answers0