 So welcome, we are now beginning the R example, and Sima will show. Yeah, so what we have here in the document editor page are many different examples of our R users. First things first, we need to get R self on version of R. So we can do that by looking for different versions of R with the module spider command. And we will see that there are plenty of these different versions. So what we want to probably do is take the latest one and let's use that one. And we load the module, and now we have R at our disposal. So we can launch R with R if we want to test out code interactively here. But of course, what we really want to do is to write something that can be run on the queue. I'll make the shell a bit smaller so it fits. Yeah, and we don't want to save the workspace image. So let's do something in the queue itself. So we have here a small serial example, serial R example. So let's copy it to the clipboard and write this slurm file for this example. So what we have here is that we ask for five minutes of time. We run with 100 megabytes of memory and then we write the output to this R serial output. And we load R, let's specify the version that we had. I'll quickly check, save this and check what version we had. So we had this version of R. Let's write that specific version into our requirements. So over here. And here we see that we are using this R script to run R. And what this R script basically does is that it's a wrapper for R. There's also this R command batch that you can use to run R non interactively. But this R script is even better. So what it does, it runs a single R file that we have. And it won't save on a workspace state afterwards. And it won't load any previously existing workspace environment. So in R, if you're running it interactively, like you noticed at the start when I opened the R interpreter, it will ask to save the state of the situation. And you might want to do that, but you also might not want to continue where you left off. And in these cases, the R script is better because it runs these clean slate, especially with the vanilla setting where it doesn't load any existing environment that you have currently in the folder. It also will produce the output straight to the standard output. So you will see the output when you run the code. So all the print statements and so forth will be produced to the standard output. So basically makes it look run like a standard program instead of something for interactive. Otherwise you will get these R out files that are normally produces with when you run with our command batch. So let's run this small R script. It's a bit fancy because we use the command arguments here, but this is just to demonstrate how you could use, for example, a task ID is within the other program itself. So what we are doing here is we are reading the command line arguments. We were giving these two values, the N and M, to this R script. So it reads them in and turns them into numbers within R so we can use them in R. It prints them. And then it creates matrices. First matrices of size N, N times M matrices. First is A matrix and then this B matrix. And then it creates this C matrix. And then it does this matrix calculation where it does a matrix multiplication between A transpose of B and then adds two times C to it. So this is like just a simple mathematics operation. Whoops. So let's copy this also and let's create this R script that we want to run. So let's copy this here and save the buffer. So now we have R script and then we have our serial job. Let's first try running this R, with R script, this R serial without any S-run statements or anything like that. So just to check that it works. Normally, of course, we would want to run this somewhere to, well, maybe I'm not allowed to test that it works. So when we run this, we see with values 4 and 3, we see that we have four rows and three columns. And then when we create this matrix multiplication, we create this 4 by 4 matrix. So this seems to work. Now let's run it with S-run in a node. So with S-run, it's as simple as adding S-run and maybe some requirements of time. So let's put like a 15-minute time requirement of maybe two gigabytes of memory. It's overkill, but nevertheless, it should work. Okay, it works in the queue. We see here that we got something like LC measurement failed using C. So what this means is that the environment when we were running it, it was a bit different than what we're running now. There was something, some language setting missing, but it doesn't affect our results. So it's not something we should worry about. Okay, let's try submitting the script with S-patch. So let's use the R-serial slurm and let's submit it with S-patch. And we see that it's submitted. It has already run. If we look at last few jobs, we see here we have the previous job that we run with S-run ourselves. And here we have the slurm script. And we see that it actually didn't use almost any memory, of course, because it was so simple and it finished quite quickly. And now if we look at the R-serial out that it was creating, because we had defined the output file, we see that here are the startup error messages that we had previously. They don't really matter. We can define this language if we want some to get rid of these messages, but it doesn't matter. And then we get the end results. Yeah, okay. So let's do another quick example of running this with its internal parallelization. So over here we have a link to this. Okay. Okay, it seems to be that we have to update this information. Okay. This R benchmark is something, it's a famous R benchmark, but we probably need to update the link to it. But anyways, if we were to run some R script that we would want to use the internal parallelization within R. R has been compiled with these libraries that can use the internal parallelization. We would just need to specify the number of tasks and set that the number of threads that we want to use is the number of tasks. And that's it. And we could submit it. We'll have to update this. Then there is also a possibility of using this R parallel package to run this parallelization. In that case, we would set the number of threads to one because we will use the parallel package to do the parallelization. And then we would run these, use these MCL applies, which are these parallel applications. There's other statements that we can use to test out, let's say, this matrix inversion here. There's plenty of ways of running R in parallel, these parallel packages. Okay. And that's about it. Great. Thanks for the example.