RStudio .rd-file - Binomial cofficient in Help file - r

I just got a minor problem which keeps bugging me:
I'm currently creating my own R package and obviously need some documentation/help files for that. I'm good so far, but I currently try to work out how to use the \choose command in .rd-files. It keeps producing some weird output in the PDF i create via the .rd-files. I currently use it like that:
\deqn{P(k \leq x \leq s) = \sum\limits_{i = k}^{s} \choose(s,j)u^j(1-u)^{s-j} }
which delivers me
which is obviously wrong. If I leave out the choose command, I get what I want here (missing the binomial coefficient of course). I tried any combination I could think of as \choose{s,k}, \choose{s}{k} and everything gives me basically the same output. Any ideas?
Thanks in advance!

choose is odd. try
{{s}\choose{j}}

Related

Why can't read_csv use my directory/path?

I am having a problem with my read_csv. I have used this function with no problem but the path/directory I am using is a little different than normal and I can't figure it out by myself.
This is the code I have been using:
X2022_03_08_habit_and_OCD_clinical <- read_csv("Box/OCD: Habit or Learning?/experiment/data/raw/survey-data/2022-03-08_habit-and-OCD_clinical.csv")
I have tired tweaking this by not using the first two arguments with no luck. Has anyone used Box in a path before (Box is in my finder, like desktop would be). I also tried updating r for that first error code but maybe it didn't take, I am not sure how to update again.
Here is the error code I have been receiving:Error Message
I would appreciate any help and I apologize if there is a simple answer I have been missing!

Trying to display regression outputs in Rmarkdown in Latex

Hi all!
I'm currently working on a paper for my university. The task is to run some regressions on a dataset and compile all results in an rmarkdown file. It should be noted that this is my first time working with R, so if the following question is really stupid, I apologize in advance. ;-)
My problem relates to the display of the regression outputs in Rmarkdown. I want to have them in Latex but somehow it won't work.
I tried to replicate this code https://www.r-statistics.com/tag/stargazer/ but when I enter it I get the following output (this happens both in the console and in Rmarkdown):
When I manually enter Latex in the Rmarkdown document with the $ notation, for instance to include formulas, it works just fine so I'm a bit puzzled.
I feel like I'm missing something very obvious but I can't quite put my finger on it. In any event, any help would be greatly appreciated!

How to show \epsilon in R Markdown

I am using R Markdown 1.0.9016 in RStudio 1.0.35 Windows.
I used to be able to render equations like
$\epsilon$
But now it just shows \epsilon instead of rendering the epsilon symbol.
What went wrong and how can I fix it?
Try this, it should work:
\(\epsilon\)
You seem to need to wrap it in double $ like $$\epsilon$$

R -- Editing the 'nnet' Package

I am trying to edit the R 'nnet' package. I have done some poking around, but am unfamiliar enough with R itself so as to not be able to make any headway.
I have tried trace("nnet", edit=TRUE), as outlined in a previous post here. This results in the editor being opened and displaying:
function (x, ...)
UseMethod("nnet")
I'm not entirely sure what to do with this...
I've also found that it is part of the "VR Bundle"; it has been suggested here that the source bundle be opened to view the code, but don't know a) how to go about doing this or b) if that would achieve anything as I would then need to modify and run the code..
My goal is to add/modify a parameter minIt that would insure a minimum number of epochs be achieved prior to termination of the training.
Thanks!
You can use:
methods(nnet)
[1] nnet.default nnet.formula
edit(nnet.formula)
As well as
trace("nnet.default", edit=TRUE)

Disabling output has no effect

I noticed that, under some, unknown to me circumstances, some functions, whether from base R (for example, gc()), or from external packages (for example, getCurlHandle() from RCurl), still produce output, even after explicitly disabling it via verbose = FALSE. I am curious about reasons for such behavior. The only workaround I found on SO is the recommendation to call invisible(), but for me it worked only for gc(), but not for getCurlHandle(). Would appreciate any comments and answers.
The command gc(verbose=TRUE):
prints some statistics and percentages,
AND prints the matrix that is returned by the function.
The command x=gc(verbose=TRUE) only prints the statistics.
The command gc(verbose=FALSE) only prints the returned matrix.
The command x=gc(verbose=FALSE)prints nothing.
While preparing a reproducible example, I figured this out. The source of the questionable output was not getCurlHandle(). It has been producing by another (next) function: curlSetOpt(). I took care of disabling its output by using invisible().
It was really not bad, comparing with the effort I've made for figuring out my previous R and RCurl problem. But, it is always fun and educational.

Resources