Category "r"

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

quesion of loading the packages of Rstudio

Everytime I load the packages of Rstudio and always get the following messages.something &

ee$Reducer$mean: Extract mean several bands/indices with GEE in R

I'd like to get "B2","B3","B4","B8","NDVI","SAVI" and "TVI" average data from COPERNICUS/S2_SR collection by date/tile. I like to extract these bands and vegeta

$ operator is invalid for atomic vector

I'm using rugarch::ugarchforecast to do a 1 step ahead rolling forecast. I keep getting the error message $ operator is invalid for atomic vector, but I'm not u

Creating a regression summary table with multiple regressions, adding 1 independent variable at a time (R/Python)

I would like to know, whether there is a pre-built function / package which does a simply OLS regression, by adding one independent variable from a pre-defined

Is there an R Function to add a scale/ axis to a mosaic plot

Im trying to make a mosaic plot and it currently looks like this. It does not have an axis for some reason even though I have data and added the variables alrea

How can I find the nearest date after another date in a different column in grouping by ID using R?

I am looking for a method that will look at each date in "Date A" and find the next nearest date after that value in "Date B" by ID (group_by). I then want to c

Why do factors get coerced to a number subsetting a data frame?

I was trying to get the diagonal of the iris data set and wrote the following for loop: diagonal_list <- list() for (j in seq_len(ncol(iris))) { diagon

How to use fairseq's Megatron in r-text?

I am using R 4.1.2, reticulate 1.22 and text 0.9.50. # install.packages("devtools") devtools::install_github("oscarkjell/text") library(text) temp <- textEmb

How to combine all datasets into a data frame after multiple imputation (mice)

I read this article (https://journal.r-project.org/archive/2021/RJ-2021-073/RJ-2021-073.pdf) about multiple imputation and propensity score matching - here is t

Scraping two-column PDF

I try to scrape the texts of hundreds of PDFs for a project. The PDFs have title pages, headers, footers and two columns. I tried the packages pdftools and tabu