Function to read multiple columns automatically

Hi guys,

I have 6 columns ( 3 columns with text data, 3 more columns with numeric data ) in a data frame I need to read 3 columns (which is numeric) for now and when extra column added (numeric data) to the file dynamically my code has to read that column

How can I do that ?

Hi,

I do not understand what it is you are trying to do exactly. If you have the 6 columns already in a data frame, what do you mean by dynamically reading the data?

Please provide a reprex of your issue. A reprex consists of the minimal code and data needed to recreate the issue/question you're having. You can find instructions how to build and share one here:

Good luck,
PJ

load your data.frame with all its columns both char and numeric
use dplyr to select only the numeric ones

library(dplyr)
select(iris,
       where(is.numeric))

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.