I am working on a real time application which is recording sensor data continuously. I need to process the data in realtime using R. Is there a way to connect and communicate with the uno board through RStudio via serial port?

  • 3
    This question appears to be off-topic because it is about a serial interface for R; Best bet would be for this to be migrated to SO.
    – Matthew G.
    Commented Feb 12, 2014 at 14:31
  • @MatthewG. Side Note: Migration paths don't exist for private betas.
    – asheeshr
    Commented Feb 12, 2014 at 15:12
  • Ahh, good point.
    – Matthew G.
    Commented Feb 12, 2014 at 16:13

2 Answers 2


If RStudio has serial support. Yes, it can talk to a Uno. If it does not. No.

This is really a question about RStudio (and actually just pure R), not arduinos.

Furthermore, RStudio is just an IDE. Therefore, no, RStudio can not communicate with an arduino, compile a program, or do much of all aside from edit source-code files. RStudio does not run your code at all. It uses an external interpreter to run your source files.

R, on the other hand probably can talk to serial interfaces. The fact that you're using RStudio is entirely irrelevant.

I'm not familliar with R, but a little googling leads me to think that R can talk to serial interfaces without too much trouble, though I have not been able to find any information about doing so on windows. What platform are you using?


I can't seem to figure out directly how to read from a serial port using R; While there does seem to have been at least one attempt to provide this, it's not clear that it ever graduated to something supported or easily installable.

Having said that, R does have read.socket and write.socket, which I believe would make it easy enough to use through ser2net, which exposes a serial-port as a socket.

Not the answer you're looking for? Browse other questions tagged or ask your own question.