How to determine if any list element has missing data<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Does anyone know the easiest way in JSL to determine if a list (e.g. numbers) contains at least 1 element who's data is missing? In this case it might set another variable to False (meaning the list does contain at least 1 element with missing data, else if True all elements contain non-missing data).
thx.. dj
Re: How to determine if any list element has missing dataAnother variation is to use the LOC function to find all missing values. I use this when I want to replace missing values with 0, for example:
a = {1, 2, 3, 4, ., 5, 6, .};
b = loc(a, .);
This will return the matrix [5, 8]. You could determine if any list elements are missing by checking for
nrows(b) > 0;
Re: How to determine if any list element has missing dataHi:
Perhaps:
list1 = {1,2,3,4};
list2 = {1,2,.,4};
n1 = if(N Missing(list1)>0,"True","False");
n2 = if(N Missing(list2)>0,"True","False");
Best regards,
-Matt