Error with setwd() when compile Rmarkdown - r

I am doing an R markdown file, I have the last versiĆ³n of R and RStudio, but I get an error when I trie to compile. My file is pretty simple, that's the reason why I don't know what it is happening.
I have already consulted this pages:
Shiny demo doesnt work: Error in setwd(old) : character argument expected #844
character argument expected #14
Error for Knit to HTML
But I can't found the problem.
This is the error:
setwd(wd): character argument expected
Error in setwd(wd) : character argument expected
Calls: <Anonymous> ... call_inline -> in_dir -> .handleSimpleError -> h -> setwd
Error in setwd(wd) : character argument expected
Calls: <Anonymous> ... in_dir -> setwd -> .handleSimpleError -> h -> setwd
Error in setwd(oldwd) : character argument expected
Calls: <Anonymous> -> setwd
Execution halted
Thank you very much.

Related

External source script not working while knitting the rmarkdown into document

I have large function in another R script. when I used it as a source and call the function, it is working fine but it does not work if I try to knit it into document.
line73 source('PATH\\function.R', local = knitr::knit_global())
line74 table1 <- demograph(arg1, arg2)
here , demograph() is the function from external R scriptfunction.R
I can get the results in the console but while trying to knit it to document I got following error:
Quitting from lines 73-81 (vision_rmd.Rmd)
Error in eval(x, envir = envir) : object 'False' not found
Calls: <Anonymous> ... eval_lang -> in_input_dir -> in_dir -> eval -> eval
Execution halted

R markdown error: non-numeric argument to binary operator

Code:
Error:
Quitting from lines 40-46 (Code.Rmd)
Error in ggplot(Fat) : could not find function "ggplot"
Calls: ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted
I can't convert this code into pdf, can anyone please tell me why this error had occurred and what should I do>

Object: "DF" not found when knitting rmd

I get this error when knitting any rmd. file using this data set (Aviste_Affect_Data).(The problem also happens with other data frames when I tried to reproduce the problem) All of the code within the files run and the data set itself appears to be fine (it was imported from SPSS). The error occurs on the first line of code in each rmd. file and if I delete that line the error just happens again on the next line of code and so on.
This is the first line of code that the error occurs on, which again runs fine (the package dplyr is being used):
Data_na2014<-Aviste_Affect_Data %>% filter(!Year==14)
Error Message:
Error in eval(las, parent, parent) : object 'Aviste_Affect_Data' not found Calls: ...withCallingHandlers -> withVisible -> eval -> eval -> $>$ ->eval ->eval Execution halted
If I try different code as the first code, the error is mostly the same:
Aviste_Affect_Data$Worry<-as.numeric(Aviste_Affect_Data$x78)
Error Message:
Error in eval(expo,envir,enclos) : object 'Aviste_Affect_Data' not found Calls: ...handle-> withCallingHandlers -> withVisible -> eval -> eval Execution halted

How to resolve this Error when knit markdown

I'm trying to knit an RMarkdown to an HTML file.
But I got an error like this
Quitting from lines 28-34 (learning_map2.Rmd)
Error in slot(p, "Polygons") :
cannot get a slot ("Polygons") from an object of type "NULL"
Calls: ... createSPComment -> lapply -> FUN -> sapply -> lapply -> slot
Execution halted
screenshot_1598604180|690x133
But I can run it on my mac. It's just doesn't run in my Window PC.
Thanks all!

Couldnt not find function "cc" Knit PDF in R

When trying to Knit PDF on R Studio i get this error. cc() is a function from package CCA(), which I've installed and loaded previously. It runs perfectly in the console as does this other function: plt.cc(), which needs the same package and library, too.
Quitting from lines 125-128 (Preview-ecc331f1f51.Rmd) Error in eval(expr, envir, enclos) : could not find function "cc" Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval Execution halted
Need some help guys, i'm 'bout to crack my display !
You should do this
require(CCA)
cc(SOMETHING) ...

Resources