Category "r"

How to aggregate row values with multiple row criteria

I'm trying to aggregate values present in rows in which repeated values present in other columns must be used as a criteria: This is what I have: Candidate, Cit

Divide Legend by multiple groups

In am looking a solution to a different representation of the legend to the example given here: https://rpubs.com/ageek/ggplot-adv-part2 The code below gives th

Connect to googlesheets via shiny in R with googlesheets4

I'm trying to use an updated version of this example to connect to a private googlesheet via shiny, and deploy this app on the shinyapps.io server. The user is

Replication for SVAR

I am using Stata and studying VAR, Orthogonalized VAR, Structural VAR. I successfully replicated VAR and OVAR, but I failed to do that for SVAR. Could anyone su

How to read dirty csv file in R?

I have a very dirty data that I need to read in R. The csv file seperated with comma, but there are also some commas in the first column of my data that puts me

R Shiny, shinjqui get orderInput after modification

I have an orderInput from the shinyjqui library and I would like the server to set which items are in the orderInput. Afterwards I would like the user to modify

R Shiny, shinjqui get orderInput after modification

I have an orderInput from the shinyjqui library and I would like the server to set which items are in the orderInput. Afterwards I would like the user to modify

How to loop over on different files and save the output with filename in R?

I have several files with the names RTDFE, TRYFG, FTYGS, WERTS...like 100 files in txt format. For each file, I'm using the following code and writing the outpu

Converting character to date turning all dates to NA & x-axis of ggplot not in chronological order [duplicate]

I am using an online ONS dataset of inflation and trying to chart it, but when plotting it with ggplot the x-axis is not in chronological orde

How to copy multiple row and column headers in a rendered table when using DT table copy function?

A similar question was posted but never answered: r shiny problem with datatable to copy a table with table head (colspan) When running the below reproducible c

Unable to import from Sharepoint Excel file to an R dataset

I am trying to download an Excel in Sharepoint site into an R dataset. But I keep getting errors. I have also tried searching for solutions across forums for th

Problems installing kb-python on R software (Windows 10)

I am trying yo install to make an RNA-seq analysis from raw-data (fastq extension) and I am trying to install kb-python by running the next lines: conda create

R incongruity when copying a column in R with ifelse

After loading lots of xlsx sheets of multiple workbooks, I want to create a double check of the tidiness and cleanliness of the data source. I created a data fr

Formating tbl_svysummary() outputs in R

I'm doing descriptive analysis of survey data, I'm using the gtsummary package which have been working nicely. I use this code, I don't provide any data because

How can I get reactlog to render on its own webpage using flexdashboard?

I am successful in rendering 'reactlog' when I use flexdshboard, but it renders within the dashboard and is way too small in size - even for this minimal exampl

How to change class character to class date in R without getting NA results

I've got a data table with a column of dates: ex_dates <- c("2022-01-01", "2022-05-28") they are now at class character, how can I change them to class date?

How can I get reactlog to render on its own webpage using flexdashboard?

I am successful in rendering 'reactlog' when I use flexdshboard, but it renders within the dashboard and is way too small in size - even for this minimal exampl

Create dataframe based on matching

I want to create a df in R with two variables, they have different number of rows. This is an abstract example: I want to match a 3 to "Fail" (without writing i

Merging csv files in R and adding a column with file names [duplicate]

I want to merge multiple csv files stored in a single folder, and to add a column containing the name of each csv file on the rows that corres

Using RPostgres, what should I use to "set role..." for the table I will write to a db?

I'm new to connecting to databases via R, and I am trying to find best practices to minimize errors and problems. I am uploading a table from R to a postgres da