Rename multiple columns by names

setnames from the data.tablepackage will work on data.frames or data.tables Note that changes are made by reference, so no copying (even for data.frames!)

Categories R

No non-missing arguments warning when using min or max in reshape2

You get this warning because the min/max are applied to numeric of length 0 argument. This reproduces the warning. Note that for mean you don’t get the warning : It is just a warning that don’t have any effect in the computation. You can suppress it using suppressWarnings: EDIT Above I am just answering the question: What’s the … Read more

Categories R

MLE error in R: initial value in ‘vmmin’ is not finite

The value of R becomes zero at some point; it leads to a non-finite value of the function to be minimized and returns an error. Using the argument log=TRUE handles better this issue, see function LL3 below. The following gives some warnings but a result is returned, with parameter estimates close to the true parameters.

Categories R Tags