1
0
Fork 0
mirror of https://github.com/MillironX/beefblup.git synced 2024-11-13 03:03:08 +00:00

Identify columns that should be removed

This commit is contained in:
Thomas A. Christensen II 2018-09-14 10:00:39 -06:00
parent 59de539f99
commit 5ce4b06742

View file

@ -30,3 +30,21 @@ data = sortrows(data,2);
% certain id
ids = data(:,1);
animalrow = @(id) find(ids == id);
numanimals = length(ids);
% Store column numbers that need to be deleted
colstodelete = 6;
% Coerce each group to string format
for i = 7:length(headers)
data(:,i) = cellfun(@num2str, data(:,i), 'UniformOutput', false);
end
% Find any columns that need to be deleted
for i = 7:length(headers)
if length(unique(data(:,i))) <= 1
colname = headers{i};
disp(['Column "' colname '" does not have any unique animals and will be removed from this analysis.']);
colstodelete = [colstodelete i];
end
end