Category "r"

Algorithm name in nlminb's PORT routines? [duplicate]

I'm using gnls function of nlme package to fit a curve. When I try to know what optimizer it was using, I was directed to nlminb function docu

Using dplyr to conditionally replace values in a column

I have an example data set with a column that reads somewhat like this: Candy Sanitizer Candy Water Cake Candy Ice Cream Gum Candy Coffee What I'd like to do

Using dplyr to conditionally replace values in a column

I have an example data set with a column that reads somewhat like this: Candy Sanitizer Candy Water Cake Candy Ice Cream Gum Candy Coffee What I'd like to do

Excel Cell Coloring using xlsx

Initial code: Lets assume we're using this command to create the dummy data: Data <- data.frame( X = paste(c(sample(1:10),sample(1:10)), collapse=";")

Creating a symmetric matrix in R

I have a matrix in R that is supposed to be symmetric, however, due to machine precision the matrix is never symmetric (the values differ by around 10^-16). Si

Barplot of summed values per category in R - currently plotting highest value only

I have a data set (named data) as follows site year month supplier FG total 540853 2015 1 790122 T25 3 540853 2015 3 7901

Calculate percentage within a subgroup in R

I am new to R and I am struggling with calculating the percentage of certain observations in a data frame. My data frame is coming from an excel table with many

Add text to R mosaicplot

I am trying to add text to individual tiles within a mosaicplot built using the base R function. However, I cant determine the coordinates of each center tile.

Determining when there is a decrease in the rate of change

I have created plots of heart rate recovery against time, using ggplot2. I have noticed them seem to have an inflection point where the heart rate levels off. I

Rtools with R portable

Hello Fellow enthusiasts, I use portable version of R for a project in a computer where I have no administrator privilege. I use zip function to encrypt & z

How do I limit the range of the viridis colour scale?

I have two sets of data, which I want to present using a heat map with the viridis color scale. For the first data set, my values range from 0 to 1.2 and I can

Does markercluster work together with leafletProxy() and option iconCreateFunction?

Am I doing something wrong, or why does the below example not work? I am trying to make leaflet markercluster plugin work with leafletProxy() in an R Shiny app,

Making an adjusted Kaplan Meier Surve Curve

I am doing a study looking at the long-term survival of patients admitted to an Intensive Care Unit. I have done a multivariate Cox regression to describe the a

apply box plots to multiple variables

I have this dataframe: set.seed(50) data <- data.frame(age=c(rep("juv", 10), rep("ad", 10)), sex=c(rep("m", 10), rep("f", 10)),

dcast warning: ‘Aggregation function missing: defaulting to length’

My df looks like this: Id Task Type Freq 3 1 A 2 3 1 B 3 3 2 A 3 3 2 B 0 4 1 A 3 4 1

How to display all the months (axis ticks/breaks) on the following dygraph? (R)

Following R code and data provided, uses the dygraph library (R interface for the js dygraph) library(xts) library(htmlwidgets) library(dygraphs) date <- c(

Levelplot color key - range and extremes

Is it possible in R to create a color key like the one below? (this one comes from the software Grid Analysis and Display System - Grads). There are two fe

Colors for heatmap in R

I'm making a heatmap in R, but being very new to R, I have some questions: My data is a big matrix 21 columns and 89 rows, containing numbers from 0 to 16. I w

R-Package Building: How to Modify @source Line While Documenting Data to be Included in My R Package

I am trying to include data in a package I am just building, I included the data object as follows: set.seed(289805) x <- room(10, mean = 0, var = 1) I got

How to add a total distance column in 'flights' dataset? DPLYR, Group_by, Ungroup

I am working with 'flights' dataset from 'nycflights13' package in R. I want to add a column which adds the total distance covered by each 'carrier' in 2013. I