It can be frustrating trying to get RStudio going for the first time. Persist and it will work out.
Writing to a OneDrive folder can sometimes be a problem with R. First of all, try navigating to a folder that you know you can write into locally on a local drive. Perhaps something in My Documents. Just avoid OneDrive for now, even though you know you can write stuff to it outside R.
When you do try the write, try write.table(), as it is a simple routine that should work. I've seldom had to use dput() as it is normally only needed to write the ASCII representation of an R object, and that is not all that common.
Good luck.
Stephen