"Results do not have equal lengths" using ldply in R package plyr I've found a few similar questions, but I am new to R and can't figure out how it applies to my specific problem. Here is my code:

library(rvest)
library(plyr)
library(stringr)

#function passes in letter and extracts bold text from each page
fetch_current_players&lt;-function(letter){
  url&lt;-paste0("http://www.baseball-reference.com/players/", letter, "/")
  urlHTML&lt;-read_html(url)
  playerData&lt;-html_nodes(urlHTML, "b a")
  player&lt;-html_text(playerData)
  player
}

#list of letters to pass into function
atoz&lt;-c("a","b","c","d","e","f","g","h",
        "i","j","k","l","m","n","o","p","q","r",
        "s","t","u","v","w","x","y","z")
player_list&lt;-ldply(atoz, fetch_current_players, .progress="text")


So what this code is trying to do is use the URL structure of this website to pass a list of the letter A through Z into my function to produce a list of names that are in bold. I think the problem is that each list of players it returns is of different lengths and that is producing an error as when I manually type in each letter into the function the function appears to work.

Any help is appreciated, thanks!
Here's a slightly modified version using some newer "tidyverse" packages:

library(rvest) 
library(purrr) # flatten/map/safely
library(dplyr) # progress bar

# just in case there isn't a valid page
safe_read &lt;- safely(read_html)

fetch_current_players &lt;- function(letter){

  URL &lt;- sprintf("http://www.baseball-reference.com/players/%s/", letter)
  pg &lt;- safe_read(URL)

  if (is.null(pg$result)) return(NULL)

  player_data &lt;- html_nodes(pg$result, "b a")

  html_text(player_data)

}

pb &lt;- progress_estimated(length(letters))
player_list &lt;- flatten_chr(map(letters, function(x) {
  pb$tick()$print()
  fetch_current_players(x)
}))