Category "r"

Relative frequency histogram in R, ggplot

I can draw relative frequency histogram in R, using lattice package: a <- runif(100) library(lattice) histogram(a) I want to get the same graph in ggplot.

How to reactively change title of ShinyDashboard box in R?

My code looks like below where user can select location from sidebarpanel and based on user selection data is displayed in mainpanel. Next, I would like to dyna

Grouped bar plot in ggplot

I have a survey file in which row are observation and column question. Here are some fake data they look like: People,Food,Music,People P1,Very Bad,Bad,Good P

ggplot2: fill color behaviour of geom_ribbon

I am trying to colour ribbons in ggplot2. When using geom_ribbon, I am able to specify ymin and ymax and a fill color. What it now does is coloring everything t

python(or numpy) equivalent of match in R

Is there any easy way in python to accomplish what the match function does in R? what match in R does is that it returns a vector of the positions of (first) m

predict() and resid() for lavaan.survey

I want to conduct CFA with survey design weight in R. An easy option seems to be using lavaan.survey package. However, from lavaan object created by lavaan.sur

Does a plug-in selector bivariate kernel density estimator with weights exist for python?

I am trying to calculate the kernel density estimate for a set of weighted bivariate data points. I am currently using KDEpy.FFTKDE. However, this does not prov

Trying to be benchmark dplyr vs data.table

Why does this code not work? How can I benchmark these to expressions? library(data.table) library(dplyr) dt <- as.data.table(mtcars) (lb <- bench::mar

Calculate correlation with cor(), only for numerical columns

I have a dataframe and would like to calculate the correlation (with Spearman, data is categorical and ranked) but only for a subset of columns. I tried with al

[Shiny]: Add link to another tabPanel in another tabPanel

I'm trying to put a link on my "home" tabPanel to all others tabPanels of my app. The idea is as follows: ui = navbarPage("", tabPanel("home",

How to connect SQL Server with Rstudio?

I have downloaded Microsoft SQL Server on my Mac with the Docker image as described here, and also I have downloaded the database AdventureWorks2019 as an exam

Error when using DiceKriging function km: 'Error in t.default(T) : argument is not a matrix'

I'm attempting to apply the km function from the DiceKriging package to a multivariate dataset. When I use my entire dataset (dimensions = [938,13]), the algori

R - Gamma distribution - Linear Mixed-Effects Model - lmer/glmer errors

First time asking here so please let me know if anything else is needed to be able to help! I have analysed my data using lmer() which worked well. I have since

R - Gamma distribution - Linear Mixed-Effects Model - lmer/glmer errors

First time asking here so please let me know if anything else is needed to be able to help! I have analysed my data using lmer() which worked well. I have since

R - Gamma distribution - Linear Mixed-Effects Model - lmer/glmer errors

First time asking here so please let me know if anything else is needed to be able to help! I have analysed my data using lmer() which worked well. I have since

R - Gamma distribution - Linear Mixed-Effects Model - lmer/glmer errors

First time asking here so please let me know if anything else is needed to be able to help! I have analysed my data using lmer() which worked well. I have since