for-loop

Applying some functions to multiple objects

吃可爱长大的小学妹 提交于 2020-11-28 02:09:31
问题 I am on Mac OS 10.10 with R 3.1.1 Suppose I have the following data frames a and b with the same attributes: a<- structure(list(X1 = 1:5, X2 = 6:10), .Names = c("X1", "X2"), row.names = c(NA, -5L), class = "data.frame") b<- structure(list(X1 = 11:15, X2 = 16:20), .Names = c("X1", "X2" ), row.names = c(NA, -5L), class = "data.frame") and suppose I need to do some cleaning/apply some functions (like dropping column and multiply the first column by 2) on both a and b at the same time such that

Applying some functions to multiple objects

拈花ヽ惹草 提交于 2020-11-28 02:09:29
问题 I am on Mac OS 10.10 with R 3.1.1 Suppose I have the following data frames a and b with the same attributes: a<- structure(list(X1 = 1:5, X2 = 6:10), .Names = c("X1", "X2"), row.names = c(NA, -5L), class = "data.frame") b<- structure(list(X1 = 11:15, X2 = 16:20), .Names = c("X1", "X2" ), row.names = c(NA, -5L), class = "data.frame") and suppose I need to do some cleaning/apply some functions (like dropping column and multiply the first column by 2) on both a and b at the same time such that

Applying some functions to multiple objects

久未见 提交于 2020-11-28 02:08:14
问题 I am on Mac OS 10.10 with R 3.1.1 Suppose I have the following data frames a and b with the same attributes: a<- structure(list(X1 = 1:5, X2 = 6:10), .Names = c("X1", "X2"), row.names = c(NA, -5L), class = "data.frame") b<- structure(list(X1 = 11:15, X2 = 16:20), .Names = c("X1", "X2" ), row.names = c(NA, -5L), class = "data.frame") and suppose I need to do some cleaning/apply some functions (like dropping column and multiply the first column by 2) on both a and b at the same time such that