0
votes

0
replies

I want to sort a data.frame by multiple columns. For example, with the data.frame below I would like to sort by column z (descending) then by col...

asked 4 months ago

0
votes

1
replies

I have a dataframe with the following columns
userid: unique value for an user
transactionId : unique value for the transaction (an user can...

asked 4 months ago

0
votes

2
replies

I've got a dataframe df.
df <- data.frame(c(4,4,4,4,4,4), c(0,0,0,0,0,0))
colnames(df) <- c("a", "b")
> df
a b
1 4 0
2...

asked 4 months ago

1
votes

1
replies

E.g.,
library(dplyr)
df <- data.frame(a = c(1,2,3,4,1),b = c(21,28,35,42,49))
df[(df$a != 1 & df$b != 49), ]
df[!(df$a == 1 & df$b ==...

asked 4 months ago

1
votes

1
replies

data example
sommer=structure(list(tub = c(1L, 2L, 0L, 2L, 0L, 0L, 0L, 0L, 0L,
1L, 1L, 2L, 1L, 0L, 0L, 1L, 0L, 2L, 1L, 1L, 0L, 0L, 1L, 0L, 0L,...

asked 4 months ago

0
votes

1
replies

So I create the name with :=, but I want to use it in ggplot2 as y which does not seem to work.
library(tidyverse)
date_group_plot_line <- f...

asked 4 months ago

1
votes

1
replies

I am trying to calculate consecutive proportions of the target feature.
Data Set
df <- data.frame(ID = c(11, 11, 11, 11, 11, 11, 11, 11, 11,...

asked 4 months ago

0
votes

1
replies

I have written a query that gives the number of false positives based on a percentage (A). I want to work out how many false positives different...

asked 4 months ago

1
votes

1
replies

This question already has an answer here:
How to select the row with the maximum value in each group...

asked 4 months ago

1
votes

2
replies

I want to relevel the factors in a dataset, however I'm really struggling with the fct_relevel syntax and using it with mutate_at. I get a series...

asked 4 months ago

1
votes

1
replies

I have a data.table with three id groups. The first group (batch1) has fixed dx and varied dy. The 2nd group (batch1) and 3rd group (batch2) have...

asked 4 months ago

0
votes

1
replies

I have a table called df. This table contains three columns (Code,Description and Rate).
#CODE
df<-data.frame(
Code=c("01","0101","0101...

asked 4 months ago

2
votes

2
replies

I have a dataset with two columns, ID and Start_Date as shown below
ID Start_Date
19 2016-11-24
19 2016-11-26
3C...

asked 4 months ago

4
votes

2
replies

I have a data set with time periods, that may overlap, showing me if somebody was present (example_df). I want to get a data set that splits a la...

asked 4 months ago

1
votes

0
replies

I have the following data:
Name <- c("Sam", "Sarah", "Jim", "Fred", "James", "Sally", "Andrew", "John", "Mairin", "Kate", "Sasha", "Ray", "Ed...

asked 4 months ago

2
votes

2
replies

This question already has an answer here:
Calculate the mean by group
3 answers...

asked 4 months ago

0
votes

0
replies

I have a data set of open-answer responses in a survey. I have a set of topics that I want to assign to these open answer responses according to...

asked 4 months ago

-1
votes

0
replies

I have a large network in R. I use igraph to plot and analyze the graph. Now I want to compute the shortest path distances and the edge betweenne...

asked 4 months ago

2
votes

2
replies

I have a table that (after some initial processing) has multiple rows with the same main identifier but with different column values (either 0 or...

asked 4 months ago

2
votes

2
replies

I have a dataframe of percentages. I want to add a "%" at the end of each cell so that I can export/display them properly. It looks something lik...

asked 4 months ago

1
votes

1
replies

Starting with the following:
library(tidyverse)
library(lubridate)
df <- tibble(
date = seq.Date(ymd("2018-01-01"), by = "month", length.o...

asked 4 months ago

0
votes

2
replies

I have a dataframe composed of a grouping variable, mean, and sd. I'd like to generate a number of means (eg., 10) for each group based on their...

asked 4 months ago

0
votes

0
replies

I have a dataframe that was put together from 6 other data frames using dplyr's "bind_rows" command. This worked nicely in terms of merging the c...

asked 4 months ago

1
votes

1
replies

I have a dataframe like this
ID <- c("A","A","A","A","A","A","B","B","B","B","B","B")
Day <- c("Mon","Mon","Mon","Fri","Fri","Fri","Tue",...

asked 4 months ago

2
votes

1
replies

library(tidyverse)
df <- tibble(`Roman Numeral` = c(rep("I", 3), rep("II", 3)),
Letter = c("A", "B", "C", "D", "E", "F"),...

asked 4 months ago