Category "r"

max.col with the value not the index

If I have a matrix: mod_xgb_softprob$pred[1:3,1:3] [,1] [,2] [,3] [1,] 6.781361e-04 6.781361e-04 6.781422e-04 [2,] 2.022457e-07 2.

quarto rmarkdown code block to only display certain lines

I have a .qmd / .rmd file that wants to show the output of block of code. The code block has a lot of lines at the beginning that I'd like to hide, in the examp

In dplyr using str_detect and case_when in R

This is my df: mydf <- structure(list(Action = c("Passes accurate", "Passes accurate", "Passes accurate", "Passes accurate", "Lost balls", "Lost balls (in o

How to avoid gaps due to missing values in matplot in R?

I have a function that uses matplot to plot some data. Data structure is like this: test = data.frame(x = 1:10, a = 1:10, b = 11:20) matplot(test[,-1]) matlin

change in the structure of table

I was required a function which can give the required result below, transpose of the current output table. i want variables in rows and and row variables in col

Error Installing flipMaxDiff package from github

Relative newby here struggling with an older install for R. Trying to get flipMaxDiff from either of the remaining github repositories (Displayr doesn't provide

Can't load R packages after installation

So I have installed R 3.6.3 and I am getting errors when I am trying to load packages, after installing them. I am getting the following errors - > library(c

How to connect grouped points in ggplot within groups?

I have a dataset with two groups - Experimental and Control. Each participant contributes two responses per group, which represent different learning styles. Th

Broom.mixed exp model predictions

I would like to ask for some help with plotting prediction values from my model as well as the equations generated by the estimation of the lmer(). So, the data

Read GloVe pre-trained embeddings into R, as a matrix

Working in R. I know the pre-trained GloVe embeddings (e.g., "glove.6B.50d.txt") can be found here: https://nlp.stanford.edu/projects/glove/. However, I've had

Color a subset of vertices but not their edges with visIgraph

How can I set the color of a subset of the graph nodes without also coloring their edges using visNetwork::visIgraph? Currently, my function vis_graph_prototypi

How to omit sections from table of contents in R Markdown with officedown

I am drafting an rmd that needs a Table of Contents and needs to be knitted to Word. I am using the officedown package and while I can get a TOC, I need to have

How can I modify the font size of the node labels with visIgraph?

I am plotting a graph that I construct via the igraph package using visNetwork::visIgraph and have seen that font.size is usually used as a parameter to control

Skipping same entries in different rows of a column in SQL table

for example I have created a dataframe in R named as "Numbers" which has following output: Numbers 1 2 3 2 4 1 When I tried to insert this dataframe in SQL tab

RSelenium fails to findElement when not called individually

(Apologies for the bad title, improvements are welcome) When I run the three last lines of the code below individually everything works as expected. It finds th

Extract portions of wav file and save them in R

I have a large number of relatively large mono audio wav files each of about 2 GB that I want to annotate in Raven Pro (version 1.4). The files seem to be too l

can't uninstall packages

Hi I uninstalled a package but it still look accessible, can somebody help please? Thank u! > remove.packages("RODBC") Removing package from ‘E:/R/R-3

Plot data based on three objects as z-scores

I'm using the package "networktools" in R (https://cran.r-project.org/web/packages/networktools/networktools.pdf). I've created three "bridge"-objects: DataT5_S

Is there a way to bold part of a character string being passed to add_header_lines() when using the flextable package for R

I'm creating a couple of tables for a Word document using the flextable package, which I'm loving. However, I'm having a little trouble bolding part of the text

Hosmer-Lemeshow statistic in R

I have run the Hosmer Lemeshow statistic in R, but I have obtained an p-value of 1. This seems strange to me. I know that a high p-valvalue means that we do not