Skip to main content
7 votes
3 answers
106 views

I have the Dataframe: df <- tibble(value_2024 = runif(4), value_2023 = runif(4), value_2022 = runif(4), selection = c(2023, 2022, 2024, 2022)) I want to rowwise calculate the sum of the columns ...
Norbi's user avatar
  • 185
0 votes
1 answer
161 views

I have dataframe Category = c("Fixed","New" ,"Fixed" ,"Regular", "Fixed", "New", "New") Day1 = c(313, NA,239, 341, 14,11,521) Day2=...
Sam's user avatar
  • 490
1 vote
3 answers
100 views

i want to create new column for row total based on column range given in text column (col_range). I tried the following and it throws me an error. Does anybody know how to do this. d = data.frame(...
krishthw's user avatar
  • 147
1 vote
1 answer
91 views

I would like to perform a rowSums() over specified columns. My trouble is that the desired columns to sum over are different for each row and given by another variable. The motivation is to check ...
Reid's user avatar
  • 37
0 votes
3 answers
112 views

I am running R in Rstudio. I have a data frame that has the following columns: y0, y1, y2, y3, .... yn and yb0, yb1, yb2, yb3... ybn where n could be as large as 1000. I want to do row sums such ...
P Wong's user avatar
  • 1
1 vote
2 answers
62 views

In RStudio, I have marray_1. I want to manipulate the array to calculate the sum of column j divided by the sum of specific rows, i and starting at the selected column, j. For example, for the follow ...
ariggs154's user avatar
0 votes
2 answers
1k views

I have a tibble like Table1, and I want to group some columns by the sum of their values for every row, creating a new column with the results and replacing the summed columns, like Table2. Table1 | ...
dq.canario's user avatar
0 votes
2 answers
48 views

Would like to count the number of times a value in the whole column of DF2(DF2$B) recedes below each cell in DF1$A. Example: DF1 <- data.frame(Q=c("fun","fun"), ...
user11057680's user avatar
3 votes
3 answers
84 views

I'm trying to create 10 or more of pseudo dataframes. The data frame dim should be 9 columns with 5 rows(Mon, Tue,Wed, Thur, Fri), and each rowsum should be 9. like below. Factor1 Factor2 ...
rocknRrr's user avatar
  • 421
2 votes
2 answers
89 views

I am working with a set of binary data for months of the year similar to the sample tibble below but with tens of thousands of rows. I am trying to add a column to the existing table that sums each ...
Brad's user avatar
  • 23
2 votes
5 answers
883 views

I am trying to use R's dplyr package to create multiple new columns for each year in my dataset that is the sum of the columns corresponding to each year's end of quarter figures (Mar, Jun, Sep, Dec). ...
StatsStudent's user avatar
  • 1,624
2 votes
3 answers
393 views

I'm trying to sum specific columns of my data that fills some condition, like the example underneath library(dplyr) library(readr) set.seed(123) data=data.frame(id=1:4, v1=sample(c(&...
Wael's user avatar
  • 1,808
0 votes
2 answers
186 views

Using R, I would like to compare values in two columns, if the values are equal I would like to keep them as is, if the values are different, I would like to sum the values in the two columns. This ...
FishyFishies's user avatar
1 vote
2 answers
101 views

I have a dataframe like this: df <- data.frame( sample1 = c(0, 1, 2, 0, 2, 1), sample2 = c(0.3, 3, 2, 0.4, 2, 3), sample3 = c(0.2, 1, 3, 0.1, 3, 3), sample4 = c(0.4, 2, 4, 0.3, 1, 1), ...
Pietro's user avatar
  • 41
0 votes
2 answers
322 views

I need to generate an m*n matrix with 1 and 0 where the sum of each row is 1 and each column is greater than or equal to 1. I'm trying this code but I don't know how to limit my condition on the ...
user21559's user avatar

15 30 50 per page
1
2 3 4 5
15