# Testing multiple columns in R

#### pnwright

##### New Member
Morning all!

Sorry, probably another newbie question.

I have n columns of data, exported into 'R'. I want to test each column for normal distribution using Shapiro-Wilk' s test.

I know how to do this for one column, using the filename\$columnname argument. However, is there a shorter way of doing this for every column, rather than repeating the code and altering the column name each time?

I know it's not a major hassle to cut and paste each answer into another document and create a table of test stat against each column, but wondered whether R could create this table for me....

Cheers

Paul

#### Dason

apply(yourdataset, 2, shapiro.test)