gce_ssh_setup(instance, key.pub = NULL, key.private = NULL, ssh_overwrite = FALSE, username = Sys.info()[["user"]])You will need to generate a new SSH key-pair if you have not connected to an instance before.
Instructions for this can be found here: https://cloud.google.com/compute/docs/instances/connecting-to-instance. Once you have generated run this function once to initiate setup.
If you have historically connected via gcloud or some other means, ssh keys may have been generated automatically. These will be looked for and used if found, at file.path(Sys.getenv("HOME"), ".ssh", "google_compute_engine.pub")
Other ssh functions: gce_ssh_browser,
gce_ssh