Category "r"

lrtest() not working: posthoc testing for multinomial with vglm() not working with lrtest()

I am running a multinomial analysis with vglm(). It all works, but then I try to follow the instructions from the following website (https://rcompanion.org/hand

match rownames and colnames of correlation matrix

I have a vector with 3990 names (these are the column names of my dataframe) and I want to match them with the rows of my data. My data contains correlation val

Create new column based on presence/absence of string in other column by group

I have this dataset about vessels locations, where the same "id" can correspond to two levels. Corresponds to a defined category, such as "fishing" and may also

Sequence with stopping values

This is like a regular tribonacci sequence, however, I want the sequence to stop whenever the term is at the min or max value. This is what I have started seque

Comparing Dates Across Multiple Variables

I'm attempting to figure out the amount of days in between games and if that has an impact on wins/losses, this is the information I'm starting with: schedule:

How to use pivot_longer in this case?

I have the following data frame: df =structure(list(Country = c("DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE", "DE",

Shortest Path calculations crashes with igraph r - maximum number of nodes?

Is there a maximum number of nodes for the igraph::shortest.paths function? The following code crashes Microsoft R Open 4.0.2 in RStudio Version 1.4.1106 under

Caused by error in `as.POSIXlt.character()`: ! character string is not in a standard unambiguous format. How can I change CHR to POSIXCT?

I have a huge data frame called 'cyclist_trip_data_all' head(cyclist_trip_data_all) The most important columns of dates have chr class and I need it to be con

Trying to represent hashtags in a bar chart

I have downloaded tweets and I am trying to represent the different hashtags and how often they are tweeted. Some data screen_name location text

Make a radiobutton list for the stored rpivottable configuration name

The following is a link to a code that allows you to make several configuration savings, which you can load anytime as long as you don't clear your cookies. I w

Dropping NA-values with a MAX threshold and not MIN threshold

Is there any way to remove columns from a dataframe that has LESS NA-values than for instance 200? So instead of df.dropna(threshold = 200) we want the opposite

What function in R extracts the dB values from a .wav file

I have some sound data in .wav format and I would like to extract Sound Pressure Level data from this file in dB for different timepoints of the recording so I

Remove not increasing rows based on other columns values

I have a data frame on R and I want to remove all rows that are not increasing in my column 3. Each row have to be higher or equal than the previous one. But m

How to recover fitted values from BSTS poisson model (in R)?

I am trying to recover in-sample predictions (fitted values) from a bsts model with a specified poisson response using the bsts package in R. The following res

Subset with only consecutive numbers

I want to generate all subset of {1,2,3,4} with only consecutive numbers. (For example I want subset {1}, {1,2} or {2,3,4} but not {2,4}. ) This is what I have

How to correctly use data in extdata/data folder

I am working on an R package that I would like to submit to CRAN and have had issues with the size of the data, therefore I moved it into the extdata/data folde

lme4 1.1-27.1 error: pwrssUpdate did not converge in (maxit) iterations

Sorry that this error has been discussed before, each answer on stackoverflow seems specific to the data I'm attempting to run the following negative binomial m

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