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).
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
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.
This question already has answers here: How to import multiple .csv files at once? (15 answers) Closed 4 years ago.
I have 13 quantitative variables in a data.frame (called \'UNCA\'). The variables are named q01_a, q01_b, ...q01_m.
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)})
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.
(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
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).
I was wondering whether it is possible to use the lapply() function to alter the value of the input, similar to: