Category "r"

Loading CSV with fread stops because of to large string

This is the command I'm using : dallData <- fread("data.csv", showProgress = TRUE, colClasses = c(rep("NULL", 2), "character", rep("NULL", 37))) but I get t

Error: R studio not running, shinytheme (theme) yeti is not available theme

I am trying to edit my data using DataEditR package. I have used the R built in dataset to reproduce the problem I am facing with my data. Whenever I use data_e

Subsetting dataframe with grep

I have following data Sample_ID<-c("a1_01_01","a2_03_03","a3_07_07","a4_09_09","a5_10_10","a6_21_21") Sex<-c(M, M, F, F, M, NM) DF1<-data.frame(Sample_

How to make alpha (transparency) appear as continuous gradient in the ggplot legend?

Is it possible to make the transparency (alpha) appear as a continuous gradient in the ggplot legend? Currently, the plot looks like this: Here, the different

Obtaining summary shap plot for catboost model with tidymodels in R

I am trying to build a catboost model within the tidymodels framework. Minimal reproducible example is given below. I am able to use the DALEX and modelStudio p

regression analysis in brand funnel

What regression can I use for brand funnel? The participants who do not choose a brand in the consideration, can not pick the brand in the con

Plotly R: change hoverinfo font color according to different bar colors

I have this dataframe: df2 = data.frame(value = c(9, 2, 7, 3, 6), key = c('ar', 'or', 'br', 'gt', 'ko')) And this is the code I have to genera

How do I use {polished} package with {brochure} framework?

This was a complicating in logic execution i came across using {polished} and {brochure}. When placing secure_ui/secure_server inside of a brochure::Page() in t

R st_join return polygon with point attributes

Let's say I have the below data along with the code. The code returns point data but I want a polygon. How can I do a spatial join such that it returns a polygo

Unable to determine what type of blank, null, na or anything else in R dataframe

I have a data frame loaded from an Excel csv. One columns has many "NULL". This is what is showing up when looking at the data in RStudio. When I filter in the

Color coding in ggplot using geome_point, while maintaining size of point

I am plotting a dataset in R using three different variables (x=PassingFilerReads, y=meanCoverage, and size distribution of alignPercentageR1 over those two thi

Create unique row values in new column based on matching criteria in R

I have a dataframe with one identifier column of unique values, and one column which contains specific criteria. I want to create a new identifier column of uni

R import of stata file has problems with French accented characters

I have a large stata file that I think has some French accented characters that have been saved poorly. When I import the file with the encoding set to blank, i

Retain all columns after using group_by summarise, and mutatue dplyr on categorical variable and plot barplot with confidence intervals

I'm new to R. This is my dataset df <- tribble( ~Area_of_interst ,~Meds,~Response, "Internal Med", "asprin", "yes", "Inter

Renv and Java: "Error in rJava::.jinit() : Unable to create a Java class loader"

I have a script that works perfectly when I'm not using Renv. However, when running it in a project with Renv enabled, the last command line returns the followi

How to convert all NAs in a data set to blank values (regardless of class of vector)

I'd like to convert all the NAs in my very large data set to blank values "" I believe the issue that I have is that some columns are string, some are numeric,

Understanding the get_prior output in brms package

I'm relatively new to Bayesian modeling in R and am trying to understand how to interpret the get_prior output and how to use the information in the set_prior f

Predicted values for conditional logistic regression greater than 1

I have a multivariate conditional logistic regression model. Case and controls are matched on a 1 to many basis. I want to make predictions using the model. How

Group estimate in different direction than individual components

I have a binary outcome and five classes of grouped exposures in a BHM model. One group's summary estimate does not make sense to me given the estimates of the

I keep getting object ‘country_long’ not found

power %>% count(country_long, sort=T) %>% head(10) capacity <- power %>% group_by(country_long, primary_fuel) %>% summarize(capacity_mw) pl