Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有不同类变量的大型数据框。我只想将函数应用于类因子的变量。我怎样才能做到这一点?
尝试这样的事情:
lapply(data, function(x) if(is.factor(x)) foo(x) else x)