Enter Onedrive and in the file context menu take the "Embed" option. It will generate something like:
<iframe src="https://onedrive.live.com/embed?cid=E8F4DCBDA1CF1243&resid=E8F4DCBDA1CF1243%21177&authkey=AAbiQULpERX5A_I" width="98" height="120" frameborder="0" scrolling="no"></iframe>
Copy link and replace embed for download: https://onedrive.live.com/download?cid=...
. If the function you use to read the file has URL support, use the direct link, otherwise download and read:
# CSV de exemplo no meu OneDrive
link.csv <- "https://onedrive.live.com/download?cid=E8F4DCBDA1CF1243&resid=E8F4DCBDA1CF1243%21177&authkey=AAbiQULpERX5A_I"
> read.csv(link.csv)
letra numero
1 A 1
2 B 2
3 C 3
4 D 4
Or by downloading to a temporary file first:
link.xls <- "https://onedrive.live.com/download?cid=E8F4DCBDA1CF1243&resid=E8F4DCBDA1CF1243%21178&authkey=AJMJUl3aej0ZnAk&em=2"
temp <- tempfile()
download.file(link.xls, temp)
readxl::read_xlsx(temp)