Adding expected results to function before changing RCurl → httr