How are we doing? Please help us improve Stack Overflow. Take our short survey

Questions tagged [r]

Lô đề online R is a free, open-source programming language and software environment for statistical computing, bioinformatics, visualization, and general computing. Please provide minimal and reproducible example(s) along with the desired output. Use `dput()` for data and specify all non-base packages with `library()` calls. Do not embed pictures for data or code, use indented code blocks instead. For statistics related questions, use http://stats.stackexchange.com.

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

I want to amend several columns in a consecutive way based on serial ID without rbind as columns headings are not identical

Instead of copy and paste corresponding columns into excel, I want to amend several columns in a consecutive way based on serial ID named addr. Assume my data sets are like these df1 <- data.frame(...
0
votes
0answers
8 views

For loop in R with time series

I am struggling to create an annual variable in my dataset. I have monthly time series data. Dates are in the format Day-Month-Year. In total, I have five years worth of data, with "id" ...
0
votes
0answers
5 views

Calculating Intra class correlation in random intercept ordered probit model (mixor package in R)

I am using Mixor package (http://www.rdocumentation.org/packages/mixor/versions/1.0.4/topics/mixor) to analyze influencing factors on individuals' injury severity. I considered individuals involved ...
0
votes
1answer
12 views

choose filter variable based on character vector and index number in a custom dplyr function

I have a function which takes a character vector with variable names and an index which determines which of the variables is chosen as input for a dplyr::filter(). I have a very clunky way of ...
1
vote
1answer
10 views

Calculate within-group covariance matrix only of numeric columns from nested list

I would like to calculate the within-group covariance matrix from a nested list, where the sub-lists represent the groups, and I am having trouble ignoring the non-numeric columns in each sub-list. ...
0
votes
1answer
20 views

How to replace every element in a matrix with the maximum of the values within a variable moving widow of size = n?

So essentially, what I want to do is replace every element in a matrix with the maximum of neighboring cells within a window that is determined by the value in that cell. The window size would be ...
0
votes
0answers
17 views

Data frame wont update using observeEVent in Shiny R

I am a novice programmer, please excuse if I am not clear or missing relevant information. I have a shiny app written that imports a dataframe from another set of code. I would like to update that ...
0
votes
1answer
18 views

R : Converting “Daily” time series to monthly

I am working with time series data (6000 observations, over 7000 days) that is said to be "daily". However, measurements do not necessarily happen everyday. Sometimes, several measurements ...
0
votes
1answer
19 views

How to compare POSIX datetime of two datasets in R

Good evening everyone! I want to do a comparison between dates in R. I have 2 datasets, maint.csv and failures.csv: > str(maint) 'data.frame': 3286 obs. of 3 variables: $ datetime : POSIXct, ...
0
votes
0answers
20 views

how to concatenate the long labels which are in multiple lines

I have a data that looks like this: The sample data can be created by codes: structure(list(tx = c("Form: Enrollment", " Field Name Data Type Field Label Units Pre-Filled ...
0
votes
1answer
13 views

RMarkdown automatic anchor-section

Well, I've been working with Markdown for a year and today, suddenly, next to the headings an a tag has been automatically added. Someone would know why these anchors have been generated automatically ...
4
votes
2answers
26 views

Is there a way to multiply the 2d matrices of a 3d array by a scalar in R?

I have a 2x2x10 array of identity matrices, created with arr = array(diag(2), dim=c(2,2,10)) I'm looking to multiply each 2x2 matrix within that array by a scalar c(1:10) z = arr[,,1:10] * c(1:10) ...
0
votes
0answers
11 views

MLEs of a probability distribution written as an infinite sum

My question relates to the use of R for the derivation of maximum likelihood estimates of parameters when a probability distributions is expressed in the form of an infinite sum, such as the one below ...
-1
votes
0answers
20 views

Why do I get this error message when working out the mean on R? And How do i fix it?

So I am trying to work out the mean for a column on my dataset. When I use the code mean(dataset$`name of column`) it returns 'argument is not numeric or logical: returning NA'. I have tried ...
-3
votes
0answers
26 views

what area does each 3 digit US zip code corresponds to [closed]

I am working on a dataset where it has a variable of 3 digit US zip code. I am just wondering is there a CSV table that can indicate which area each 3 digit zip code corresponds to, such as the county ...

15 30 50 per page
1
2 3 4 5
24796