Thank you - it seems like a Windows problem and it worked when I set cores=1 in the sample function.
I wish the error message was a bit more obvious… I didn’t even know “cores” was a relevant function input or what that means. Since I thought it was dependency/package errors and I tried to solve it that way, I kept getting various different error messages, Perhaps I should have read the documentation more closely! But I’m very grateful for your help, thank you so much.