How to calculate percentage from each row of two different columns in R -


please let me know how calculate percentage row wise in r.as i'm using prop.table function not giving me solution

empid        presentdays        empid      absentdays   1              5                1             10   2              2                2              4   3              6                3             12 

i want calculate percentage respect each empid performance

empid         presentdays       empid      absentdays    perfom%   1                 5             1          10            50   2                 2             2           4            50 

how in r i've tried prop.table() function doesn't work

assuming dataframe called df:

df$perform <- df$presentdays/df$absentdays*100 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -