Search
 
SCRIPT & CODE EXAMPLE
 

R

if not na in r

which( !is.na(p), arr.ind=TRUE)
Comment

if not na in r

> which( !is.na(p), arr.ind=TRUE)
     row col
[1,]   1   2
[2,]   1   3
[3,]   2   4
[4,]   4   5
[5,]   2   7
Comment

if not na in r

lapply(apply(p, 1, function(x) which(!is.na(x)) ) , paste, collapse=", ")
Comment

if not na in r

> apply(p, 1, function(x) which(!is.na(x)) )
[[1]]
[1] 2 3

[[2]]
[1] 4 7

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
integer(0)
Comment

PREVIOUS NEXT
Code Example
R :: how to itterate through a character in r 
R :: find length of a list or vector in r 
R :: skewness in r 
R :: r: rename a column 
R :: how to convert negative values to positive in R 
R :: na by column r 
R :: vars() in R 
R :: r convert to factor 
R :: how to summarise data but keep columns R 
R :: find row with na r 
R :: for R 
R :: geom_point transparency 
R :: make the first row as header in r 
R :: r remove spaces in column names 
R :: empty environment r 
R :: show unique R 
R :: kable thousand mark 
R :: rmarkdown how to load workspace 
R :: norm,s,inv in r 
R :: pdlyr mutate string extract 
R :: create datframe on r 
R :: Iteration in R 
Rust :: array as a parameter rust 
Rust :: rust case 
Rust :: loop rust 
Rust :: struct in rust 
Rust :: error handling rust 
Rust :: Find the next smaller positive integer containing the same digits 
Rust :: armanriazi•rust•unsafe•extern•mangling 
Rust :: how to get text from a file and store it in a variable rust 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =