Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
98 views

I wrote the codes below. First, I defined a function called 'dist_function' and then run this function in lapply. While the column 'cyl' is fixed, lapply function returns x does not exist. Don't know ...
Abdullah Mamun's user avatar
2 votes
3 answers
80 views

I am writing a function in R which allows for Differential Gene Expression data to be plotted while grouping different genes based on a user's interest. For example, GO terms contain genes that are ...
Nick M's user avatar
  • 23
5 votes
2 answers
103 views

I have a list of objects. If I separately ask for the class, I get: > for (i in 1:2) print(class(tmp[[i]])) [1] "emmGrid" attr(,"package") [1] "emmeans" [1] "...
Russ Lenth's user avatar
  • 7,060
0 votes
2 answers
99 views

I would like to create a dataset in the format below of workbook names and sheet names of all the excel files in a folder. workbook sheetname a aphid1 a aphid2 b ...
h09812349's user avatar
  • 173
4 votes
3 answers
99 views

I have a dataframe with a list of consecutive measurements of temperature over a period of time. I would like to split these up into separate dataframes based on when the temperature is consecutively ...
Nadka's user avatar
  • 73
7 votes
4 answers
163 views

I would like to append each element of a list to each list of a list of lists. l1 <- list(list("a", "b", "c"), list("d", "e", "f&...
Melierax's user avatar
0 votes
1 answer
73 views

I created a function that splits a string by ":" and takes the first element, which is the information I need from a vcf: remove_semicolon = function(x){ newstr = strsplit(x,":"...
Max's user avatar
  • 789
2 votes
1 answer
91 views

I often have code that looks like rbind.oc.by <- function (indata, INDICES, FUN, ...) { result <- by( indata, INDICES, FUNIN, ... ) t(simplify2array(result)) } mynewdata <- rbind.oc....
ivo Welch's user avatar
  • 3,098
2 votes
1 answer
64 views

I am trying to find the earliest date in a column split by a delimiter ("\n" in this case), and creating a new column. data.frame(x = c("2023-1-2\n2034-02-10", "2023-1-2\n2001-...
Jo Lo's user avatar
  • 51
0 votes
1 answer
60 views

I have mylist a list of lists as follows: list1 <- list(label = c(2,8,9,5,9,10,0,1), code = c(585,652,756,255,365,123), name = c("cow", "sheep", "fox", "dog",...
user2299015's user avatar
0 votes
1 answer
50 views

I have many labels under a variable for which I want to filter on that label and create new separate data frames for each label. I’m interested in the best way of doing this. Currently I am trying to ...
James's user avatar
  • 589
0 votes
1 answer
40 views

I am trying to place a unique ID in the Site.Name column of 8 similar dfs using a list of names. I tried site<-c("Smith","Sledd Creek","Crooked Creek","Duncan&...
Tammy Wilson's user avatar
0 votes
3 answers
136 views

I am working with climate data that I have added dates to and subsetted down to just including the data that has the temperature above the 90th percentile for 3 or more days. set.seed(12368) A <- ...
user26711711's user avatar
1 vote
2 answers
97 views

I asked participants to write three words and to assign a number to each word. Some words have been written by several participants, other words by only one participant. Now I'm trying to create a set ...
Silvia's user avatar
  • 45
1 vote
2 answers
99 views

I have a list of data frames that each have year, month, day, and temperature columns along with some other stuff. I have already figured out (with stack overflow help thanks guys) how to subset the ...
user26711711's user avatar
0 votes
1 answer
68 views

I have a function (more specifically prophet::add_regressor()) which appends values to an object. I recreated a similar function to make sure my point is clear: add_to_a_list = function(object, ...
Mesozoik's user avatar
  • 131
0 votes
4 answers
71 views

The actual issue: I'm trying to rearrange a bunch of names, street addresses, states, etc. into a nice list of addresses without any weird bracketed [row numbers], quotation marks, awkward breaks, etc....
silima's user avatar
  • 1
3 votes
2 answers
109 views

I am trying to apply a function over data.table columns, and grouping by columns value. I am using the lapply fuction, but my script is quite slow. To give some context, I am working of probability ...
la_turz's user avatar
  • 33
0 votes
1 answer
500 views

Let's assume I have two lists in R, a long one and a shorter one, for example: list1 = list(571,572,573,574,561,562,563,564,595,570,571,573) list2 = list(c(571,564,565,600)) Please note that numbers ...
Tortuga's user avatar
0 votes
1 answer
44 views

I used readLines from gutenbergr to read my list of legal cases into R. The code looks like this: my_list <- list.files(path = "C:\\Users\\Ben Tice\\Documents\\R Stuff\\UW Job\\Cases\\data\\...
Benjamin Tice's user avatar
0 votes
0 answers
34 views

I have a list containing 12 data frames. I would like to subset/split the list after every third elements based on a sequence. And make a new data frame of the new subsetted list . # my_list ...
Alis Mohd's user avatar
0 votes
1 answer
45 views

I have a dataset which is like this. library(dplyr) set.seed(505) tempdf1 <- data.frame( y = rnorm(400), x1 = rnorm(400), x2 = rnorm(400), x3 = sample(1:5, 40, replace = TRUE), ...
Ahir Bhairav Orai's user avatar
1 vote
2 answers
99 views

I have two vectors of unequal length. One vector is a list of dataframes and the other vector is made up of unique values. How can I use map() to iterate the vectors over a custom function? Dummy data ...
William's user avatar
  • 412
0 votes
2 answers
65 views

I have a vector in R which is like this: vec <- c('abc','def') Here is my dummy input data frame: Gen value abc 12 def 34 abc 12 abc 13 def 1 abc 4 abc 6 ghi 23 I am using sapply on this vec like ...
user3138373's user avatar
2 votes
3 answers
191 views

I have 4 data frames that I created to be a list dfs <- list(bio_w, bio_k, demo_w, demo_k) Now what I want to do is move my id column to the very front. I spent hours trying to get it to apply to ...
Steven Haworth's user avatar

1
2 3 4 5
82