Hello,

I have a data set with test results for multiple devices (rows). I also
have an index (column) that stores the first failing test for each device.
I need to remove the results for all the tests that come after the first
failing test.

Example of a data table:

Device,first_failing_test,test1,test2,test3,test4,test5
1,test2,1,2,3,4,5
2,test4,2,3,4,5,6
3,test1,3,4,5,6,7

New table:

Device,first_failing_test,test1,test2,test3,test4,test5
1,test2,1,2,na,na,na
2,test4,2,3,4,5,na
3,test1,3,4,5,na,na

Ideally I need to pass the first table as an argument to a function and get
back the second table.

Any idea how this can be done in R?

Thanks

	[[alternative HTML version deleted]]

