If

· R
작성일자 : 2023-09-29 Ver 0.1.1 if() function if( cond ) expr if( cond ) cond.expr else alt.expr x = 1:5 x ## [1] 1 2 3 4 5 y = -2:2 y ## [1] -2 -1 0 1 2 if ( any( x < 0 ) ) print( x ) # print() is not executed if ( any( y < 0 ) ) print( abs( y ) ) # print() is executed ## [1] 2 1 0 1 2 if ( any( y < 0 ) ) { print( abs( y ) ) print( 'y contains negative values' ) } ## [1] 2 1 0 1 2 ## [1] "y contain..
Unlimited Jun
'If' 태그의 글 목록