unable to knit because the dudi.pca function from librray (ade4) - r

It is not possible to knit to a document because the function dudi.pca asks for a parameter while running, once you give the parameter shows the result. But this makes impossible to knit to get a document.
any idea how to handle these situations when working with functions like this?
Thank you!!

As Lamia said in the comments, it works for me using scannf=F, for the same issue.
Thanks!

Related

Rmarkdownon Kaggle: Can you spot what's going on?

it's been a few days that im trying to run my Rmd on Kaggle, but it simply doesn't work.
The main reason (I guess) is that, somehow the console is reading the code as an R code, but im sure that I'm using Rmarkdown.
Therefore, the console reads a Text line as a code line, giving me the code error below:
Also, i tried to copy and edit other's people markdown, but i keep getting the same error line.
You can check my code here: https://www.kaggle.com/badluckmath/kernel4c85aae59c/edit/run/39891200
He's working perfectly on my Rstudio.
I'm looking for a huge help here, please!
I've been stuck with this for a week!
If i press the buttom to run code, it will simply give me this error message.
For that, i still don't know the solution. But since this is a premade Rmarkdown and i knew that it works, i simple used the Save (Commit) options and at the end, it worked.

R cannot find the function .complete_args()

I am using the isoriX package in R and would like to update part of the source code. When I try to run it without making any changes yet, R doesn't seem to recognise any function preceded by a dot.
Am I missing any packages that should be installed in order to allow me to use those kind of functions or to update the source code?
The code I am trying to apply is quite long, but the bit R struggle with is the following function:
.complete_args()
Any ideas? Thank you!
The isoriX:::.complete_args() call worked.
You can access unexported function with ::: and in my case isoriX:::.complete_args() worked well.

Knit doesn't find dataset

I'm using R and I am trying to render a Rmd file using Knit button. I built a
S3 function
readprices.numeric<-function(y){
library(readr)
dat<-read_csv(file="data/EuStockMarkets.csv")
}
However, Knit tells me that "data/EuStockMarkets.csv" doesn't exist in current work directory, despite the fact that on the console the function works.
How can I solve this? Thanks
You should set the working directory:
setwd("absolute/path/directory")
Let us know if that works.

Parse R-Help Files for Shiny Tooltips

I am working on an R GUI with the shiny package.
In the GUI, I am trying to create tooltips for multiple functions which are provided through other R-packages.
So my idea was to parse the necessary information for the tooltips from the documentation (help-files) of the respective packages.
So, for example, one such tooltip might be to show the description text from the help files.
My current problem is that I can't find any way to parse the output of the R help into a string or other type of variable that I can then further process.
For example:
?sum
opens a help page with the description:
sum returns the sum of all the values present in its arguments.
Now if i try something like:
capture.output(?sum)
paste(?sum)
I won't get any helpful results.
Is there a way to directly parse a help file into a string etc.?
Thanks for your help ;)
Just to give a quick summary of the solution that was given to me in the comment by Nate: I wrote a short method to extract a help file by package- and method-name.
library(tools)
getMethodHelp <- function(packageName, methodName){
db <- Rd_db(packageName)
return(db[[paste0(methodName,".Rd")]])
}
And maybe a usage example:
getMethodHelp("base","sum")
Returns the helpfile of the sum function from the base-package.
Hope this helps someone in the future....

Markdown syntax: problems with superscript

This is my first time using R so this is about as basic of a question as they come.
I am making a presentation using markdown (ioslides). I want to do something very simple which is to put something in superscript. According to the manual, the syntax is the following:
Lower bound = α^Full – K^ - α^Full^
The first time I tried running this, I got a pop-up screen with some options. Too quickly, I pressed enter and inadvertently chose something. Now the syntax won't run and I can't figure out what I did to undo it.
Can someone help? Thank you in advance.
Markdown allows HTML to be used if necessary, so you should be able to use the HTML sup tag.

Resources