Search
 
SCRIPT & CODE EXAMPLE
 

R

r apply functions over list of data frames

For the first required apply this

dflist <- lapply(dflist, function(x) {
    names(x) <- ifelse(startsWith(names(x), "Q"), 
    gsub("[Q_0-9]+", "" , names(x)), names(x))
    x})
and the second
col_keep <- c("ID", "Period", "subjects", "A", "B")
dflist <- lapply(dflist, function(x) subset(x , select = col_keep))
Comment

PREVIOUS NEXT
Code Example
R :: r select column names starting with 
R :: how to rename variables in r 
R :: XLConnect 
R :: parent folder for working directory in r 
R :: ggplot in R how to show information by hovering 
R :: excecute a for loop line by line in r 
R :: conditional mean statement r 
Rust :: rust reverse range 
Rust :: rust string to char array 
Rust :: how to read from stdin rust 
Rust :: rust count occurrences of a substring 
Rust :: How to know the data type in rust 
Rust :: get length of vector rust 
Rust :: rust error handling 
Rust :: optional arguments rust 
Rust :: armanriazi•rust•smartpointer•box•cons 
Rust :: rust new tuple 
Rust :: armanriazi•rust•box•vs•refcell 
Rust :: rust BMI 
Rust :: armanriazi•rust•error•error[E0382]: borrow of moved value: `val` ... thread 
Rust :: rust•armanriazi•borrowchecker•ownership 
Rust :: rust•armanriazi•slice•vs•char•vec 
Rust :: rust month to quarter 
Lua :: roblox get player from character 
Lua :: roblox difference between index and newindex 
Lua :: lua loop 
Lua :: for i in pairs lua 
Lua :: lua list of all keys 
Lua :: to the power of in lua 
Lua :: roblox rotate head with camera 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =