Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

R - lapply() and DataFrame

$
0
0

is it possible to use lapply() to dynamically fetch condition and then apply to data frame? For demonstration purpose, I have simplified example

e.g.

cond <- list("cyl==6", "mpg >= 21", "hp==110 & cyl==6")

I want to apply all conditions on mtcars and then store output to new_mtcars

I am currently using for loop and not sure if that is an efficient way to do it.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>