Most voted "lapply" questions
lapply is a function in R that returns a list of the same size as argument X, each of its elements being the result of the application of the function to the corresponding element of X.
Learn more…8 questions
Sort by count of
-
16
votes2
answers4769
viewsApply, sapply, mapply, lapply, vapply,rapply, tapply, replicate, Aggregate, by and correlates in R. When and how to use?
What is the difference between the functions apply, sapply, mapply, lapply, vapply, rapply, tapply, replicate, aggregate, by and correlates in the R? When and how to use each of them? There are…
-
7
votes1
answer213
views -
4
votes1
answer89
viewsSelect data from df according to data from a list
Dear(as) as given below: nr <- c(100:199) dt <- rep("data",100) x <- data.frame(nr,dt) y <- c(110:115) I need to get,the common numbers between the first column of the date.frame x and…
-
2
votes1
answer389
viewsChanging the row name of a list in R using lapply from a list variable
I have a list called dataList and I would like the name of the lines to be equal to a variable called CNPJ that is within that list. For that, I first applied: dadosLista<-lapply(dadosLista,…
-
2
votes1
answer39
viewsUse lapply (replacement for) to leave only columns in common for multiple dataframes in a new list
dput of the list: structure(list(col1 = structure(list(a = 1:5, b = 1:5, c = 1:5), .Names = c("a", "b", "c"), row.names = c(NA, -5L), class = "data.frame"), col2 = structure(list( a = 6:10, c =…
-
2
votes2
answers130
viewsCheck if there are different elements in a list in R
I have a list that each element is one data frame containing various information on a particular pension institution. In the column CLASSE there can only be one type and I need to know who owns more…
-
2
votes1
answer58
viewsLapply does not return the desired result for some functions
My list: structure(list(col1 = structure(list(a = 1:5, b = 1:5, c = 1:5), .Names = c("a", "b", "c"), row.names = c(NA, -5L), class = "data.frame"), col2 = structure(list( a = 6:10, c = 6:10), .Names…
-
1
votes2
answers52
viewsR regression on same line data
I have the following data: mes <- c("jan","fev","mar","abr","maio","jun","ago","set","out") a <- c(32.3,32.7,32.6,33.1,33.0,33.5,33.4,33.4,34.9) b <-…