Category "r"

R - Use Twitter API to get every tweet from an account

My goal is to get EVERY tweet ever for any twitter account. I picked the NYTimes for this example. The code below works, but it only pulls the last 100 tweets.

Issue installing spacyr on R 4.2

I am having trouble installing spacyr on R version 4.2. What is strange is that I've used this package in the past just fine. The installation is pretty basic.

1 of the 5 plots are missing in the graphic

I want to plot all ROC curves in one graphic with the plot function, but the first plot (tree.perf in blue) is separate from the others. Can someone help me out

Convert data frame into adjacency matrix format in R

My data looks like this: Sample_A Sample_B Value Rabbit Mouse 1.2 Mouse Tiger 7.89 Tiger Lion -0.9 Mouse Rabbit

How do I assign group level value - based on row level values - to df using dplyr

I have the following decision rules: RELIABILITY LEVEL DESCRIPTION LEVEL I Multiple regression LEVEL II Multiple regression + mec

Formatting the elements of a panel

This is a snippet of my interface (if choices = c () it means that the choice is managed on the server side): sidebarPanel( selectizeInput( "s1",

extract_parameter_set_dials() fails for self-written gbm engine for boost_tree()

I followed this vignette of the tidymodels package to make the gbm an engine for the boost_tree() function. I came up with the following for regression tasks: l

Calculation between vectors in nested for loops

I am struggling with an issue concerned with nested for loops and calculation with conditions. Let's say I have a data frame like this: df = data.frame("a" = c(

Pivot Longer in R Issues

I've looked quite a few different questions on here around Pivot Longer but I can't seem to figure out how to get my scenario to work. For example R Pivot multi

Column name being duplicated in recipe

This is the piece of code i'm having troubles with: pump_recipe <- recipe(status_group ~ ., data = data) %>% step_impute_median(all_numeric_predictors()

Randomizing within and across groups using group_by and sample

I'm running a study in which each participant will be presented with stimuli that have been randomized at two different levels: blocks (3 unique blocks) and tri

How do I fix this error for reticulate in Rstudio?

I searched Stack Overflow for fixes to this error and will put all the things that I have tried below that did not solve the issue. I have not had an issue on o

Add specific hovering behaviour to R plotly graphic

I am having troubles defining a specific behaviour when hovering an R Plotly graphic. Here is what I would like to do : I would like the full arrow to be respon

How to have a single download button for all datatables in R shiny webpage

I am working with a shiny app where it is desired to have a single downloadButton in the header of the application that downloads the data table present in the

fast partial match checking in R (or Python or Julia)

I have two dataset with names and I need to compare names in both datasets. I just need to keep the union of the two datasets based on the names. However, a nam

How would I create a subset by matching multiple patterns at a specific location in column names?

Sample code using dput: df <- structure(list (TCGA.OR.A5JP.01A = c(0.0980697379293791, NA, NA,0.883701102465278, 0.920634671107133),

Cobalt love.plot has asymmetric error bars that I cannot remove

I have a quasi-experimental dataset with two groups and two assessments (pre-intervention and post-intervention) that has a little bit of pre-test missingness (

How to read a textfile line by line in R and search for a special string?

I've got thousands of textfiles which 10-thousands of lines in different structure in a textfile. It looks like the following 3 lines: DATE#2020-10-08#TIME#16:0

Issues with accent when using the "separate" function from tidyverse

I am using the separate function from tidyverse to split the first column of this tibble : # A tibble: 6,951 x 9 Row.names Number_of_ana

How to send query with variables from Rstudio to Mongo database?

I'm trying to send query to my Mongo database depending on a variable producted in my R code. Unfortunately, Mongo query needs double quotes and the function "p