removing null element from vector

Hi everyone,
I have a little problem, i need to do somithings like this:


A and B will be used in a "for cycle", in this cycle B will contain some index refered to a value of A
i need to remove the future value of B from A


obviously in the first loop i need B empty, cuz i'll take the value inside the cycle.

But if i use A=A[-B], with empty B the system tell me that the elemente is an invalid operator.
How can i subtract empty element for the first time?

i need to see if the product of all the element of two vector is inside a range.


for(i in K){
for(j in A){
if (i*j>min(range) & i*j<max(range)) {

Error in -B : argomento non valido per l'operatore (invalid argument for the operator)

thank you!

you could test if B is null so as to decide to not omit it from A

if(!is.null(B)) A=A[-B]

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.