Category "r"

Linear graphics

I have a dataset in this way: maximum <- c(10) #for each time minim <- c(2) #for each time Quantity c(4, 2, 10, 2, 10, 6, 2) How can I structure my datas

How do I use regex to match a substring before/after the colon?

I want to split info into Refseq ID, cDNA level change and Protein level change, where Refseq ID represents the substring from the start to the first colon :, c

How do I create a list containing new data frames from an existing data frame?

I have a csv file containing 5 columns, 225 rows containing my data. The columns pertain to the experiments' Subject_ID, treatment (9 types), replicate(5), time

data.table foverlaps with as.yearmon wrong result

I am trying to use foverlaps from the data.table package. When I use it together with as.yearmon I get wrong results. Here is a small example: library(data.tabl

Dynamic `case_when` that allows for different number of conditions and conditions itself

I'm looking for a dynamic way to specify some "condition parameters" and then feed that to a case_when operation or something else if better suited for that pro

Getting word count of doc/docx files in R

I have a stream of doc/docx documents that I need to get the word count of. The procedure so far is to manually open the document and write down the word count

How to change tickmode for all subplots of facet_grid

I want to change the tickmode of all xaxis/yaxis in all subplots to "auto" but the number of subplots changes. I tried the following code. It works for the firs

Convert Canadian Postal Code to Longitude and Latitude

I have a list of 100 Canadian postal codes (e.g. M4B 1C7). Is there anyway to convert these postal codes into approximate longitude and latitude values? Current

package from Bioconductor has a dependency from CRAN that requires version of R that is not compatible

A particular situation we've encountered is when we try to install a specific R package version from Bioconductor. Dependencies of this package may not be pinne

Filtering using multiple variables and retaining those variables that meet criteria

I would like to filter using multiple variables in R. I got a way of doing so. How about if I only want to select the variables that meet the filtering criteria

I would like to use R Shiny to upload csv data to MySQL table and display

Apologies for the long question. I wrote the following R script to upload/append some csv files i get on a regular basis to a MySQL database. The examples files

Calculating Similarity Between Pairs of Documents in R [closed]

How can I calculate the cosine semantic similarity between pairs of word documents in R? Specifically, I have the plot (i.e., descriptions) of

Rstudio - cannot save files or open Rscripts 'The system cannot find the path specified'

Error when saving Rscripts Error when opening Rscripts Hi guys, Have been stuck on this problem for the past year or so and would really appreciate any help. I

lift chart R with glm model or multi class classification

Is it possible to create a lift chart for glm models in R ? I know it is more meant for binary classification model but my idea was to cut the target variable i

Rstudio very slow when editing large code

RStudio is working well in general (v 2021.09.1 Build 372). But when a large code (7000 lines, a collection of functions) is being edited, even a click on the t

How to change values in the dataset in R?

I need to calculate the average waste generated per week. But as seen in the dataset below. Some of the data is collected on a fortnightly basis and some on a w

How to export thousands of constants in an R package?

Goal I want to expose built-in constants from a package I am developing that come originally from C source code, being defined with #define directives. OpenGL

Listing to knitr environment (R-markdown error when using list2env in R chunks)

Edit: I figured out that the issue stems from the yaml code. It comes from applying this solution to dynamically name files. I believe it creates a parent envir

How to Authenticate with LDAP in R Shiny App

My company uses an LDAP server for authentication against an Active Directory. I need to authenticate users of a remotely hosted Shiny app using this. I managed

Getting the text values using Rvest

The page in question is this: https://tolltariffen.toll.no/tolltariff/headings/03.02?language=en (Click on OPEN ALL LEVELS to get the complete data) I'm using R