i have written this in R, 

> data1 <- read.csv2("c:/Total1.csv",sep=",")
> data2 <- read.csv2("c:/GWPMax1.csv",sep=",")
> M <- merge(data1, data2, by.x = "Policy.Number", by.y = "Policy.Number")
> nrow(data1)
[1] 20
> nrow(M)
[1] 12
> NbOfPolicyWithoutGWPMax <- nrow(data1)-nrow(M)
> NbOfPolicyWithoutGWPMax
[1] 8
> M$GWP_Max <- as.numeric(as.character(M$GWP_Max))
> m1 <- M[(M[,25]> 0 & M[,25]<1000) ,]
> nrow(m1)
[1] 5
> m2 <- K[(K[,25]>1000 & K[,25]<3000),]
> nrow(m2)
[1] 3
> m3 <- K[(K[,25]>3000),]
> nrow(m3)
[1] 4
> 

and i want to have in output a table like this 
GWP_Max NumberOfPolicy 
withoutGWP 8 
0-1000 5 
1000-3000 3 
>3000 4 

Someone have an idea? 

thank you a lot !!


      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to