According to Phil Lord and Chris Miller, writer/directors of
The Lego Movie, R2-D2 almost played a major role in the film. In early drafts of the script, the droid was a key player, a "Batman-level character." “Part of the appeal for us was that ‘Roger Rabbit’ thing that you can get these characters together that you couldn’t get in any other type of movie." Having a non-human character, who only speaks in beeps and whistles, seemed like an advantage, but, ultimately, it came down to rights.
(Source:
Cinemablend)