Try this httr code:
library(httr)POST("https://ssl.reddit.com/api/v1/access_token", body = list( grant_type = "password", username = "MyUserName", password = "MyPassword" ), encode = "form", authenticate("p-jcoLKBynTLew", "gko_LXELoV07ZBNUXrvWZfzE3aI"))