i  want to print in the console and to have an excel file like this 

no_GWP                NbOfPolicyClass1[0-1000]     NbOfPolicyClass2[1000-3000]        NbOfPolicyClass3[> 3000]
No_GWPMax=8    NbpolicyClass1=5                   NbpolicyClass2=4                            NbpolicyClass3 =3              

i have do it like this:!!!
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
> No_GWPMax <- nrow(data1)-nrow(M)
> (NbOfPolicyWithoutGWPMax <- nrow(data1)-nrow(M))
[1] 8
> M$GWP_Max <- as.numeric(as.character(M$GWP_Max))
> class1 <- M[(M[,25]> 0 & M[,25]<1000) ,]
> NbpolicyClass1 <- nrow(class1)
> class2<- K[(K[,25]>1000 & K[,25]<3000),]
> NbpolicyClass2 <-  nrow(class2)
> class3 <- K[(K[,25]>3000),]
> NbpolicyClass3 <- nrow(class3)
> Output<- "No_GWPMax ,NbpolicyClass1[0-1000],NbpolicyClass2[1000-3000],NbpolicyClass3[>3000]"
> Output <- paste(No_GWPMax ,NbpolicyClass1,NbpolicyClass2,NbpolicyClass3,sep=",")
> cat(Output,file="Output2.csv",fill=TRUE,append=TRUE)

but that doesn't give me the title juste 8 5 4 3 

any ideas??

thank you a lot


      
	[[alternative HTML version deleted]]


