An error reported on Rstudio, bash: syntax error near unexpected token `('

Dear,

I am learning how to Identify transmission clusters in the this Tutorial"https://training.galaxyproject.org/training-material/topics/evolution/tutorials/mtb_transmission/tutorial.html#identifying-tuberculosis-transmission-links-from-snps-to-transmi"

But when I run R studio within Galaxy, Copy the above code into the Rstudio session:

# Get the SNP distance matrix object from Galaxy
distance <- gx_get(2)

The number of the dataset of my SNP distance matrix is 2.
And then appear a error report: bash: syntax error near unexpected token `(’

Can anyone help me. Thank you.

Hi @Jane

This seems like a technical problem. Which server are you working at for this tutorial? This is the first part of the URL from the very top of the browser window that includes your Galaxy history.

Let’s start there, thanks! :slight_smile:

Update: I remember what is going wrong now when this error presents.

You were typing the gx_get() command into the terminal window, correct?

Instead, toggle to the console tab of the RStudio environment and run it there.

You could also create a new Rscript and put your commands into there, and run them from inside your new script.

More details about navigating this environment are in our tutorial here, which is a good cheatsheet if you are not sure how it works. Scroll down to the graphic to learn where the console/terminal windows are in the default view.

Hope this helps and let us know if it works now! :hammer_and_wrench: