Category "r"

How to split a vcf.gz file based on the first column, keeping the header in each subset and save back to vcf.gz files

I have a large vcf.gz file (40GB) that I have to split to be able to load into R and run a script on each of the subset. I want to split it by the first column

Installing gfortran on MacBook with Apple M1 chip for use in R

I'm on a MacBook Air with an Apple M1 chip, using macOS 11.6 Big Sur. I'm on R 4.1.1. I have Xtools and gfortran for the Apple M1 installed: markwhite@marks-air

ks.test without reference sample

I'm trying to check that 2 samples follow the same unknown distribution using the ks.test function. I have two datasets: the dataset A tells me the percentage o

Setting colnames in R's cpp11

Provided that cpp11 does not provide any "sugar", we need to use attributes. I am trying to set colnames in a C++ function, as in the next MWE #include "cpp11.h

How to set axis range R

I'm having trouble setting my axis range in r. My data only has values from 2 to 9 on the x axis but I want it to go from 1 to 10. Any quick tips please? head(

R-CMD-check GitHub Actions workflow failing on warnings/notes

In the repository of my R package, I set a GitHub Actions workflow for the R CMD check command, following the examples shown in the usethis package documentatio

Extend x-axis with dates

I wish to use ggrepel to add labels to the ends of the lines of a ggplot. To do that, I need to make space for the labels. To do that, I use scale_x_continuous

ggplot2 legend items in a single horizontal row

It seems that the code I wrote and tested last week has now suddenly decided to change the output even though nothing in the code or the version of R or Rstudio

Add footer to section's start/title page

I am creating a RMarkdown template of Beamer slides and use the metropolis theme as a basis. This already includes: Numbered TOC Hiding of footer on title page

How to adjust facet size manually

I have a faceted plot with very diverse data. So some facets have only 1 x value, but some others have 13 x values. I know there is the parameter space='free' w

How to create an origin-destination matrix from two vectors (in R or Stata)

I have a dataset of commuting by individuals, like this: id Origin Destination 1 1 3 2 1 4 3 2

RPY2 error in Python script! (Conversion 'py2rpy' not defined for objects of type '<class 'pandas.core.frame.DataFrame'>')

This is my current Python code: import pandas as pd import numpy as np import rpy2.robjects.packages as rp from rpy2 import robjects as ro utils = rp.importr('

tab_stat_cpct not giving the required result

I am trying to create a table as shown in picture for multi response data with list of banner . i have tried the below way but didn't worked. library(expss) mtc

How to identify groups of interindividual revisitation?

I have an output data frame from the "recurse" package calculating the revisitation rate of several individuals based on GPS points. In the data frame I have 18

R- import CSV file, all data fall into one (the first) column

I'm new, and I have a problem: I got a dataset (csv file) with the 15 columns and 33,000 rows. When I view the data in Excel it looks good, but when I try t

R change title size in legend

I use the R base command "legend" to add a legend to a plot and I want the title of this legend to be bigger. In the help it says: cex: character expansion

mailR Error - Sending email to the following server failed: smtp.gmail.com:587 - ShinyProxy / Docker / Ubuntu

I am currently trying to publish my Shiny app via ShinyProxy and Docker. Unfortunately, my app does not work after publishing - on the PC itself it works withou

Reticulate fails automatic configuration in R package

I'm working on a R package, that makes use of reticulate to call some functions of a Python package I implemented, installable through pip. Following its docume

Cannot highlight text in R script

I am facing a rather weird issue, I am unable to highlight code in one of my R script. Highlighting works with the keyboard but not with the mouse and only for

Sarima show only plots

I have the following code that I am running in R: ```{r} library(astsa) data = c(1:500) mo1 = sarima(data,0,0,2) ``` It produces both the five plots I am inter