Logical Function In R Programming