Logical Operators < less than <= less than or equal to > greater than >= greater than or equal to == exactly equal to != not equal to !x Not x x | y x OR y x & y x AND y isTRUE(x) test if X is TRUE x & y and x && y and x | y or x || y or xor(x, y) element wise or isTRUE() Creating a Subset of Data So for example, to create a new data frame that contains only data for the Gulf Coast fish use the line snook.g <- snook[snook$water.body=='Gulf',] Note that data transformations can be embedded in function calls. For example plot(log(wgt.mean)~length,data=snook.g) This should get you started on manipulating data. A few special topics are omitted here such as working with factors and date-time variables. This I will cover in the future.
Logical Operators < less than <= less than or equal to > greater than >= greater than or equal to == exactly equal to != not equal to !x Not x x | y x OR y x & y x AND y isTRUE(x) test if X is TRUE x & y and x && y and x | y or x || y or xor(x, y) element wise or isTRUE() Creating a Subset of Data So for example, to create a new data frame that contains only data for the Gulf Coast fish use the line snook.g <- snook[snook$water.body=='Gulf',] Note that data transformations can be embedded in function calls. For example plot(log(wgt.mean)~length,data=snook.g) This should get you started on manipulating data. A few special topics are omitted here such as working with factors and date-time variables. This I will cover in the future.