Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 206180 articles
Browse latest View live

R Shiny with flexdashboard; benefits

Why should I incorporate Shiny into my flexdashboard? I know shiny brings reactivity into the mix , but say I was using the library crosstalk which allows you to share data to different widgets and...

View Article


for loop in R — generating and calculate different results

Giving rnorm(100) I need to create a for loop in R to calculate the mean and the standard deviation generating 100 different numbers each time, and store those results in a vector. How can I accomplish...

View Article


R not identifying column headers as object- data read from xlsx

I'm learning to run linear regressions in r. I have a simple data set that I have read in with read.xl function. I get the column names fine but they aren't identified as objects so I can't do anything...

View Article

How can I extract files directly from a RAR archive in SFTP to .rda?

I need to read files from a RAR archive located in a STFP directly to R and there's no need to know the file names inside. Is that possible?My code is this (I omit declaration of variables):# Ruta SFTP...

View Article

Handling R function

I have codedcanada_raw <- readOGR(dsn = "data/gcd_000b11a_e", layer = "gcd_000b11a_e", use_iconv=TRUE, encoding="CP1250") canada_raw_json <- geojson_json(canada_raw) canada_raw_sim <-...

View Article


Confused about two dimensional factor in R

I have the following data frame:dat <- data.frame(toys = c("yoyo", "doll", "duckie", "tractor", "airplaine", "ball", "racecar", "dog", "jumprope", "car", "elephant", "bear", "xylophone", "tank",...

View Article

How do I explain a complicated function in Rmarkdown?

I have a somewhat complicated R function (different parts refer to various equations I'd like to explain.) I want to write my code using R Markdown, but I need to be able to explain the different parts...

View Article

Issue with gganimate installation

Trying to install gganimate and I run into the following error regardless of whether I install from the CRAN repo or from the git source (thomasp85/gganimate). * installing *source* package 'gganimate'...

View Article


How can I convert Ensembl ID to gene symbol in R?

I have a data.frame containing Ensembl IDs in one column; I would like to find corresponding gene symbols for the values of that column and add them to a new column in my data frame. I used bioMaRt but...

View Article


library(pryr) returns a massage. Registered S3 method overwritten by 'pryr':...

When i active a package called "pryr". It returns a massage->library(pryr) Registered S3 method overwritten by 'pryr': method from print.bytes Rcpp. I would like to know what is that meaning?...

View Article

calculate AUC using trapz function in R for each mmol/ dl per each ID? I want...

strong text#calculate of AUC per each IDcalculate AUC per ID, for CONC>12?sapply(split(data.f, data.f$ID), function(data.f) trapz(data.f$time, data.f$conc)) data.f=ID1 time2 conc3 2 5 12 3 7 6 4 12 15

View Article

R function/package to standardize wrongly ocr-ed words?

I am scrapping/'ocr-ing' hundreds of pages with the wonderful pdftools package which include repeatedly names of the same persons. By and large the extraction works well, but in a few instances names...

View Article

Data Scraping with R

I am very new at using R and I am trying to scrape a table off a webpage. I think I am having trouble identifying the CSS selector and that's why I am getting an error message but I'm not sure. Can...

View Article


Sys.timeDate takes local time zone if converted to dataframe ? Probably a bug?

Why does the SYs.timeDate considers local time if converted to dataframe ?timeDate::Sys.timeDate(FinCenter = "America/Mexico_City") America/Mexico_City [1] [2019-11-28 03:31:07] (timestamp =...

View Article

Gather all the unique values from 2 columns into a new column

I have a dataframe which includes all the nodes' connections in a network and I want to create a new dataframe named 'nodes' with all the unique nodes. Im trying to do something like...

View Article


Add column to R dataframe that is length of string in another column

This should be EASY but I can't figure it out and search didn't help. I'd like to add a column to a dataframe that is just the length of the strings in another column. So say I have a data frame of...

View Article

R - Filter rows by columns - column names contained in an other dataframe

An other basic question, but I can't seem to find a solution.Take mtcars as an example. I would like to know the number of rows, where vs AND am are above 0.5. ANDdf<- mtcars x <- subset(mtcars,...

View Article


data.table: calculation condition on presence of value within group

With some datalibrary(data.table); set.seed(42) dat <- data.table(id=1:5, group=c(1,1,1,2,2), time=c(1,2,3,1,2), val=runif(5)) > dat id group time val 1: 1 1 1 0.9148060 2: 2 1 2 0.9370754 3: 3 1...

View Article

Date slider not doing anything, Objective is to filter data based on slider...

COPY is name of my data frame (libor interest rates fred st.lious), see the picture attached or link below image. Year (COPY[,14]) column is numeric, Earlier I tried working with date type but that...

View Article

How to make a for loop test for matches between columns of different data...

I am trying to create a for loop in R that will make a new data frame ("results") when values of a column ("areaName2") in one data frame (df2), matches the value in a column ("ISLAND") from a...

View Article
Browsing all 206180 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>