We have a data frame as below : 

```
raw<-data.frame(v1=c("A","B","C","D"),v2=c(NA,"B","C","A"),v3=c(NA,"A",NA,"D"),v4=c(NA,"D",NA,NA))

```

I need a result data frame in the following format : 

```
result<-data.frame(v1=c("A","B","C","D"), v2=c(3,2,2,3))

```

Used the following code to get the count across one particular column :

```
count_raw<-sqldf("SELECT DISTINCT(v1) AS V1, COUNT(v1) AS count FROM raw GROUP BY v1")

```

This would return count of unique values across an individual column. 

Any help would be highly appreciated.