Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in x[[length(x)]] : attempt to select less than one element in integerOneIndex #821

Closed
xinzhuohkust opened this issue Mar 5, 2024 · 3 comments

Comments

@xinzhuohkust
Copy link

I’ve stored my files on OneDrive. I saved a file named 'sample' using the pin_write function on one computer. However, when I try to open this file on another computer using pin_read, I encounter the following error:

Error in x[[length(x)]] :
  attempt to select less than one element in integerOneIndex
@juliasilge
Copy link
Member

Can you create a reprex (a minimal reproducible example) for this? The goal of a reprex is to make it easier for us to recreate your problem so that we can understand it and/or fix it. If you've never heard of a reprex before, you may want to start with the tidyverse.org help page. Thanks! 🙌

Here is an example of what would be helpful to see:

  • Step 1
## write the data
library(pins)
drv <- Microsoft365R::get_personal_onedrive()
#> Loading Microsoft Graph login for tenant 'consumers'
board <- board_ms365(drv, "pins-testing")
board |> pin_write(sample(1:100, 10), "really-great-numbers", type = "json")
#> Creating new version '20240305T182506Z-66f83'
#> Writing to pin 'really-great-numbers'

## delete the cache locally, so it is like we're starting fresh
fs::dir_delete(board$cache)

Created on 2024-03-05 with reprex v2.1.0

  • Step 2

Restart R and then:

## read the data
library(pins)
drv <- Microsoft365R::get_personal_onedrive()
#> Loading Microsoft Graph login for tenant 'consumers'
board <- board_ms365(drv, "pins-testing")
board |> pin_read("really-great-numbers")
#>  [1] 82 23 57  4  6 21  2 88 41 63

Created on 2024-03-05 with reprex v2.1.0

@juliasilge
Copy link
Member

Let us know if you continue to have any problems! 🙌

Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants