lapply
Read multiple CSV files into separate data frames
Suppose we have files file1.csv, file2.csv, ... , and file100.csv in directory C:\\R\\Data and we want to read them all into separate data frames (e.g. file1, file2, ... , and file100).[详细]
2023-02-17 14:21 分类:问答which list element is being processed when using snowfall::sfLapply?
Assume we have a list (mylist) that is use as input object for a lapply function. Is there a way to know which element in mylist is being evaluated? The method should work on lapply and snowfall::sfAp[详细]
2023-01-24 14:03 分类:问答setting levels inside lapply loop in r
I´m trying to clean the f开发者_运维百科actor variables in a dataframe from trailing spaces. However the levels assignment doesnt work inside my lapply function.[详细]
2023-01-15 03:49 分类:问答How do you read multiple .txt files into R? [duplicate]
This question already has answers here: How to import multiple .csv files at once? (15 answers) Closed 4 years ago.[详细]
2023-01-10 13:56 分类:问答R question. Using lappy on a data.frame and creating new variables w/ output
I have 13 quantitative variables in a data.frame (called \'UNCA\'). The variables are named q01_a, q01_b, ...q01_m.[详细]
2022-12-29 22:06 分类:问答can lapply not modify variables in a higher scope
I often want to do essentially the following: mat <- matrix(0,nrow=10,ncol=1) lapply(1:10, function(i) { mat[i,] <- rnorm(1,mean=i)})[详细]
2022-12-27 00:01 分类:问答How to tell lapply to ignore an error and process the next thing in the list?
I have an example function below that reads in a date as a string and returns it as a date object.If it reads a string that it cannot convert to a date, it returns an error.[详细]
2022-12-26 12:31 分类:问答How to create a column containing a string of stars to indicate levels of a factor in a data frame in R
(second question today - must be a bad day) I have a dataframe with various columns, including a concentration column (numeric), a flag highlighting invalid results (boolean) and a description of the[详细]
2022-12-26 01:01 分类:问答Subset a data.frame by list and apply function on each part, by rows
This may seem as a typical plyr problem, but I have something different in mind. Here\'s the function that I want to optimize (skip the for loop).[详细]
2022-12-21 17:28 分类:问答Can you use the lapply() function to alter the value of input?
I was wondering whether it is possible to use the lapply() function to alter the value of the input, similar to:[详细]
2022-12-08 15:24 分类:问答