Category "r"

Open CSV data in tableau

I have had problems uploading the following file to Tableau: https://www.kaggle.com/datasets/shivamb/netflix-shows/download When loaded it looks like this but

Change column name with tq_get() in Tidyquant

I'm using the tq_get() function in Tidyquant to retrieve economic data from FRED: library(tidyquant) library(tidyverse) consumer_price_index <- 'CPIAUCSL'

Filter data for whole numbers (.00)

I'm looking to extract the value of my data frame that are whole numbers, i.e. end in .00 Price 100.00 100.46 101.00 101.67 The resulting data frame would be:

Modifying a function to print NA when the a warning message is printed in R

I'm trying to modify a function to print NA when the function prints a warning message. I've tried using a return(NA) modifier, which you'll see in the functio

How to save and restore a user session in R shiny

For my shiny app I would like to add the possibility for the user to save his session and restore it later. I managed to implement functions that lets the user

ARIMA model won't work: error in optim function

hopefully someone can help me out. I want to do an autoregressive regression on some monthly logreturns (60 observations). I found that only lag 1,3,11,18 are s

Valid JSON giving JSONDecodeError: Expecting , delimiter from variable not raw string

Let's imaging the response from the server { "overriding_parameters": { "jar_params": [ "{\"aggregationType\":\"Type1\",\"startDate\":\"

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