The error message suggests that there is an unknown or uninitialized column called G in the data frame X.

To troubleshoot this issue, you can try the following steps:

  1. Check if the column G exists in the data frame X using the names() function:

    names(X)
    

    Make sure that G is one of the column names.

  2. Verify if the column G is properly initialized and has valid values. Check if there are any missing or NA values in the G column, as this could cause the error.

  3. If the column G exists but is not initialized or has missing values, you can consider removing or replacing those rows before subsetting. For example, you can use the complete.cases() function to remove rows with missing values:

    X <- X[complete.cases(X$G), ]
    
  4. If the column G does not exist in the data frame X, you need to check if it is present in a different form or with a different name. Double-check the spelling and capitalization of the column name.

  5. If the above steps do not resolve the issue, please provide more information about the data frame X and the code you are using so that we can assist you further

Error in XX$G == 1 -1! Cant subset rows with X$G == 1✖ Logical subscript X$G == 1 must be size 1 or 410 not 0Run rlanglast_trace to see where the error occurredWarning messageUnknown or uninitialised