0 votes
1 view
in R Programming by (50.5k points)

I want to extract a selective column (& its data) from a table. So what I executed was:

list <- list(sample_table$column)

but it stated a list of 1, with all of the data in 1 cell. Is there a way to classify them, so that each row will have a similar value from the original column?

1 Answer

0 votes
by (108k points)

For achieving that either use as.list()

data <- as.list(sample_table$column)

Or simply use split() :

data <- split(sample_table$column, seq(nrow(sample_table)))

Learn R programming from search, if you are a beginner and want to know more about R.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...