How does R work?