I am stuck here:
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().
Typed test_func1 but received error
Error: object 'test_fucn1' not found
Referred your old suggestions:
I exited swirl
Closed Rstudio
Open R studio
options()$editor
function (name, file, title)
{
if (missing(name))
name <- NULL
if (is.null(name) || is.function(name)) {
if (is.null(name)) {
if (!is.null(file) && nzchar(file))
targetFile <- file
else targetFile <- scratchFile
}
else {
functionSrc <- .rs.deparseFunction(name, TRUE, FALSE)
targetFile <- scratchFile
writeLines(functionSrc, targetFile)
}
if (.Call("rs_editFile", targetFile)) {
newFunc <- try(eval.parent(parse(targetFile)), silent = TRUE)
if (inherits(newFunc, "try-error")) {
stop(newFunc, "You can attempt to correct the error using ",
title, " = edit()")
}
return(newFunc)
}
else {
stop("Error occurred while editing function '",
name, "'")
}
}
else edit(name, file, title, editor = defaultEditor)
}
<environment: 0x0000014d86ee5f60>
sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
I am stuck here: 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(). Typed test_func1 but received error Error: object 'test_fucn1' not found
Referred your old suggestions: I exited swirl Closed Rstudio Open R studio options()$editor function (name, file, title) { if (missing(name)) name <- NULL if (is.null(name) || is.function(name)) { if (is.null(name)) { if (!is.null(file) && nzchar(file)) targetFile <- file else targetFile <- scratchFile } else { functionSrc <- .rs.deparseFunction(name, TRUE, FALSE) targetFile <- scratchFile writeLines(functionSrc, targetFile) } if (.Call("rs_editFile", targetFile)) { newFunc <- try(eval.parent(parse(targetFile)), silent = TRUE) if (inherits(newFunc, "try-error")) { stop(newFunc, "You can attempt to correct the error using ", title, " = edit()") } return(newFunc) } else { stop("Error occurred while editing function '", name, "'") } } else edit(name, file, title, editor = defaultEditor) } <environment: 0x0000014d86ee5f60>
Matrix products: default
locale: [1] LC_COLLATE=English_India.1252 LC_CTYPE=English_India.1252
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C
[5] LC_TIME=English_India.1252
attached base packages: [1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached): [1] compiler_4.0.0 tools_4.0.0
I am stuck after this. Please help me out of it. I am near my deadline for this course.