Skip to content
Prev 236576 / 398500 Next

Help its urgent

Hi Josue,

This should help, you are almost there.

# consider this
dat <- c(1, 2)
# passing TRUE/FALSE to the extraction function
dat[c(TRUE, FALSE)]

# Now moving to an array
# Create an array with dimensions 100, 13 filled with random normal numbers
dat <- array(data = rnorm(100*13), dim = c(100, 13))
# Now apply the principle above to the array
# the logical test returns TRUE/FALSE, which is used to select from column 1
dat[ ,1][dat[ ,1] < 0]

# for the entire dataset
dat[dat < 0]

Cheers,

Josh
On Fri, Oct 1, 2010 at 5:52 PM, Josue Nu?ez Rico <josue_n_r at hotmail.com> wrote: