Count the rows that contain a column where values over or under a certain amount in R -
In a column, I would like to count the number of rows above or below a certain value. For example, I do not have the following data available:
1 ch1 1.0e +07 0.431105424 2 ch1 2.0e +07 1.4 9 8178 99 4 3 ch1 3.0e +07 0.862 939 286 4 ch1 4.0 E +07 0.735167840 5 ch1 5.0e 07 0.9 73566728 6 ch1 6.0e +07 1.77280045 9 7 ch1 7.0e +07 0.2 9 8531476 8 ch1 8.0e +07 0.728161 969 9 CH2 9.0e +07 0.768514386 10 CH2 1.0e +08 1.481 99 72 9 1 11 CH2 1.1e +08 0.00,00,000 I need to know how many rows value for each CR value More than. Anyone can help
plyr :: count one more option Is: df < - read.table (header = F, text = 'ch1 1.0e +07 0.431105424 ch1 2.0e +07 1.4 9 8178 99 4 ch1 3.0e +07 0.862 93986 ch1 4.0e +07.7735167840 ch1 5.0e + 07 .9 7 , 35,66,728 ch1 6.0e +07 1.77280045 9 ch1 7.0e +07 0.2 9 8531476 ch1 8.0e +07 0.728161 969 CH2 9.0e +07 0.768514386 CH2 1.0e +08 1.481 99 72 9 1 CH2 1.1e + 08 0.00,00,00,000 ') (plyr) calculation (subset (df is required, v3> 1, wars = "v1") & gt; Count (subset (df, v3> gt; vars = "v1") v1 freq 1 ch1 2 2 ch2 1
Comments
Post a Comment