-
Notifications
You must be signed in to change notification settings - Fork 591
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
R Programming / Functions - nothing loads in modify script question #289
Comments
Does this still occur after restarting RStudio and Making sure you have no r script files open? |
Hi Sean, Thank you - If I quit RStudio and reopen, I get a file deleted message, If I select Yes, load swirl package, start swirl, and start Functions exercise from the start, the same thing happens - no script appears to modify. If I open R in Terminal and load the swirl package, I get: | Hi! I see that you have some variables saved in your workspace. To keep | Type ls() to see a list of the variables in your workspace. Then, type | Type swirl() when you are ready to begin.
If I clear the workspace, return to RStudio, load swirl packages, start swirl, return to R functions, the same thing happens - no script appears. Thanks for any help you can provide. Regards,
|
Never mind! I didn’t realize the script appears in the source work area of R, which I had collapsed so as to give me more work area in the console. you might consider adding ‘in the source work area above the console’ to the end of 'you will be asked to modify a script that will appear’. Sorry for the trouble.
|
I'm so happy it works! I was stumped! |
I am reading these others errors people are having. I used RStudio, I used the RGUI, I tried using the newest RGUI 3.2.5, and still after saving the Rscript with the function as shown AND with out the '#' in front of the x, I get the same dialogue box, over, and over, ... again. You're about to write your first function! Just like you would assign a valueto a variable with the assignment operator, you assign functions in the followingway:function_name <- function(arg1, arg2){# Manipulate arguments in some way# Return a value}The "variable name" you assign will become the name of your function. arg1 andarg2 represent the arguments of your function. You can manipulate the argumentsyou specify within the function. After sourcing the function, you can use thefunction by typing:function_name(value1, value2)Below we will create a function called boring_function. This function takesthe argument
|
What happens if you skip the question?
|
you’re not doing anything w/in your function to return a value, so try return x
|
Hi, """"""""" Error in editor(file = file, title = title) : | Leaving swirl now. Type swirl() to resume. """""""
| Hi! I see that you have some variables saved in your workspace. To keep things | Type ls() to see a list of the variables in your workspace. Then, type | Type swirl() when you are ready to begin. Warning message:
| Welcome to swirl! Please sign in. If you've been here before, use the same name as What shall I call you? Soumik | Would you like to continue with one of these lessons? 1: R Programming Functions Selection: 1 Best Regards, |
See #434 (comment) |
boring_function(x) doesn't work properly in swirl. Its always give delete pound sign comment. And even mentor of Coursera are not helping with it |
Hello, for this issue please delete pound '#' first, then you click Run on console side bar. Nex, Save it and reopen the source, you then click "Run" again, now you type submit() --> Enter. I hope it would run well for you, and the error will be fixed. |
Hi there, I have the same problem. I did what brianhuynh27 said, but I get the next message from R: Try again. Getting it right on the first try is boring anyway! | Make sure to delete the pound sign so the last expression in the function is just x. I can't continue with that lesson. I hope someone can help me. Regards. |
Hi. My function works. I delete pound sign, click Run, click save, and then wrote "submit()"in the console and click Run, and it finally works. |
It worked.
|
save the function(just select the function part and save it) before typing submit() in the console |
R Studio in Mac OS 10.10.3
Below is what I get. There's no script to modify.
|============== | 12%
| In the following question you will be asked to modify a script that will appear as soon as you move on from this question. When you have finished modifying the script, save your changes to the script and type submit() and the script will be evaluated. There will be some comments in the script that opens up, so be sure to read them!
...
|================ | 15%
| The last R expression to be evaluated in a function will become the return value of that function. We want this function to take one argument, x, and return x without modifying it. Delete the pound sign so that x is returned without any modification. Make sure to save your script before you type submit().
The text was updated successfully, but these errors were encountered: