Quantcast

Dynamic update of variable without redrawing the entire graph (proxy)

I am trying to display a graph using echarts4r in a Shiny application, where the user can adjust a dynamic threshold (Threshold).I want only the "Threshold" series to update without redrawing the...

View Article


Image may be NSFW.
Clik here to view.

Issues using DHARMa plots when including an offet

I'm fitting a model using GLMMadaptive that takes the following form:library(GLMMadaptive)library(DHARMa)dat <- structure(list(subjectId = c("1", "1", "2", "2", "3", "3", "4", "4", "5", "5"),...

View Article


caret optimizing models hyperparameter for sensitivity [closed]

In my research, I am dealing with data sets that are quite unbalanced towards a ‘non-fraud’ class. My goal is to accurately identify the smaller ‘fraud’ class.As well as balancing my datasets and...

View Article

plot from sankeyNetwork in networkD3 does not show output (issue is not...

There are already many questions about this on this site, e.g. this one: plot from sankeyNetwork in networkD3 does not show output neither generates any warning/error in Rbut my issues seems to be...

View Article

How to search and replace text in PowerPoint, using OfficeR

I am using officer to manipulate a PowerPoint template in order to fill placeholders with values calculated in r.Is there a way to do a search-and-replace to the texts in a slide?

View Article


Image may be NSFW.
Clik here to view.

Creating a custom color scale in R

I have this plot I made in R for a equation:library(plotly)w2 <- 5w3 <- 3w4 <- 8p_vals <- seq(0.1, 1, by = 0.05)calculate_B <- function(p1, p2, p3, w2=5, w3=3, w4=8) { return((w4 / w2) *...

View Article

Image may be NSFW.
Clik here to view.

Showing the thumbnail preview (Windows 11) with the r package KeyboardSimulator

My browser is open and therefore I have the browser icon in my task bar. And I want to see the thumbnail preview of the browser via hover over the icon.With mouse.get_cursor() I get the position of my...

View Article

R keep getting error Error unimplemented type 'list' in 'EncodeElement'

Here is an example of the df I have:df <- data.frame( id = c(1, 2, 3, 4, 5), age = c(30, 45, 50, 60, 35), sis_num = c(0,1, 2, 3, 4), sis1_bca_status = c(0, 1, 0, 1, 0), sis2_bca_status = c(0, 0, 1,...

View Article


I'm getting an error "cannot open the connection" when trying to scrape a...

library(tidyverse)library(rvest)fruits <- read_html("https://tmarketonline.bg/category/plodove-zelenchuci-i-yadki?page=1")fruits_df <- fruits %>% html_elements("._product") %>% map_dfr(~...

View Article


Image may be NSFW.
Clik here to view.

How do I convert a spatial dataset from one CRS to another? [duplicate]

I am trying to conduct a spatial join of two dataframes and am having difficulty converting the coordinate systems. One data frame is Ontario's provincial electoral boundaries (here). The second is...

View Article

barplot multiple aggregation

I have a dataframe "count" that look like this:# Date Code Number_of_events#1 01-04 022003 5#2 01-06 022003 9#3 01-08 022003 3#4 01-11 022003 2#5 01-13 022003 5#...#3754 03-11 396001 4#3755 03-16...

View Article

Regression with aggregated predictors [migrated]

Say I have individual-level information about students (eg age, gender) and about schools (eg % of students who failed math test). I would like to investigate the effect of the student covariates on...

View Article

Image may be NSFW.
Clik here to view.

Web scraping on tipti page that requires login

I'm trying to extract the name and prices of the AKI supermarket in Ecuador. There is a page called tipti that gathers products from several supermarkets.However, it requires login and the page seems...

View Article


Image may be NSFW.
Clik here to view.

rmarkdown using kable with list of data.tables loses table formatting

I have a rmarkdown document where I want to use a list of data.tables and include them in a PDF/HTML/MS Word document. Each component of the list contains one data.table.What I'm trying to achieve is...

View Article

Image may be NSFW.
Clik here to view.

Plotly Legend Not Showing or Colors Getting Reordered in R [duplicate]

I'm trying to plot a network visualization using plotly in R. The nodes represent animals, and the edges represent connections between them. A smaller mock dataset is given for easy...

View Article


Live logging with doParallel and cmdstanr

I have defined a Bayesian A/B test power analysis (sample size calculator) using cmdstanr.Since it is a computationally expensive process, I tried to save output as each loop ended in...

View Article

Issues integrating shinychat into a modular R Shiny app

I am having problems integrating this chat feature into a modular shiny app. Using the chat_ui example and some slight modifications to make it modular generate this error. I think it has something to...

View Article


R: invalid use of XX < 0 in 'X11_MetricInfo'

I compiled R 4.1.0 from source code on my Fedora 34 Worstation.Now when I try to plot something on screen, the following error appears:> plot(s)Hit <Return> to see next plot: Error in...

View Article

generatePartialDependenceData function returns Error when used for multiclass...

I have build an XGBoost multiclass classification model using mlr and i want to visualize the partial dependence for some features. However, if i try to do so using generatePartialDependenceData() i...

View Article

Image may be NSFW.
Clik here to view.

ggplot based on predictions(), get_datagrid(), and get_predicted() functions

I have this data:library(tidyverse)library(marginaleffects)data(efc, package = "ggeffects")efc <- efc %>% na.omit()efc <- datawizard::to_factor(efc, c("c161sex", "c172code"))and I run this...

View Article

Start a PowerShell script in R via system2()

My line of code in the R console is like this:system2("powershell", args=c("-File", "C:\\Path To File\\PowerShellScript.ps1"))And the PowerShell script itself is very simple. It just should start...

View Article


Find the first row in a data frame that satisfies a condition and delete...

I have a dataframe in R: col1 col2 col3 col4 col51 1 a x 10.5 FALSE2 2 b y 20.3 TRUE3 3 c z 30.7 FALSE4 4 apple pie: w 40.1 TRUE5 5 e v 50.9 applesample_df <- structure(list( col1 = c(1, 2, 3, 4,...

View Article


Image may be NSFW.
Clik here to view.

Creating one legend for multiple plots

I have this R code where I am making multiple 3d plots.First, I defined some functions below to generate these plots:library(plotly)library(dplyr)library(htmltools)calculate_b_values <- function(p1,...

View Article

Any other options besides the traditional CLD bar graph?

I am looking for an alternative approach to plotting results from pairwise comparisons than traditional bar plots. If possible, I would like to create a plot like the one shown below [1], but for a...

View Article

combine two columns while using read_table

I have many files with the formatdatetime variable valueDate Time name xxx.ye.g.datetime variable value2011-01-01 01:00:00 precipitation 10.02011-01-01 02:00:00 precipitation 5.02011-01-01 03:00:00...

View Article


Image may be NSFW.
Clik here to view.

modelsummary tabulate single factor variable

How can I tabulate a single factor variable with modelsummary?I tried this:> modelsummary::datasummary_crosstab(cyl ~ 1, data = mtcars)Error in datasummary(formula = stats::as.formula(d_formula),...

View Article

.Rdata not loading cannot allocate vector of size...memorylimit not supported

I am using the latest RStudio and R 4.4.2.I tried to load a big .Rdata but get the error:cannot allocate vector of size 16.2which is my maximum amount of physical RAM. I think that before my update of...

View Article

Image may be NSFW.
Clik here to view.

Create custom point with fixed width for ggplot figure

I'm trying to create a linear representation of a data set in ggplot to compare patterns of data density between sets. There are several thousand values per set that can belong to one of two states....

View Article

How can I read this file in R? [closed]

I found this website over here that has an ivt file: https://borealisdata.ca/file.xhtml?fileId=428826&version=1.1I downloaded the .ivt file, and tried to read it with R:data <-...

View Article



Reading in a data file with staggered column names into R

I have a text file with the following format:* +---------------- Station Code* | +----------- Schedule Arrival Day* | | +-------- Schedule Arrival Time* | | | +----- Schedule Departure Day* | | | | +--...

View Article


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>