Re: [R] na.omit not omitting rows

2020-06-04 Thread Ted Stankowich
bject: Re: [R] na.omit not omitting rows CAUTION: This email was sent from an external source. Use caution when replying, opening links or attachments. Perhaps indexing with rowSums(is.na(dfrm))? — David Sent from my iPhone > On Jun 4, 2020, at 4:58 PM, Ted Stankowich > wrote: >

Re: [R] na.omit not omitting rows

2020-06-04 Thread David Winsemius
, 2020 2:49 PM > To: Ted Stankowich ; William Dunlap > > Cc: r-help@r-project.org > Subject: Re: [R] na.omit not omitting rows > > CAUTION: This email was sent from an external source. Use caution when > replying, opening links or attachments. > > > Hello, > &g

Re: [R] na.omit not omitting rows

2020-06-04 Thread Ted Stankowich
This worked! Thank you! -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Thursday, June 4, 2020 2:49 PM To: Ted Stankowich ; William Dunlap Cc: r-help@r-project.org Subject: Re: [R] na.omit not omitting rows CAUTION: This email was sent from an external source

Re: [R] na.omit not omitting rows

2020-06-04 Thread Rui Barradas
Named int [1:2] 2 3 From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, June 4, 2020 12:39 PM To: Ted Stankowich Cc: r-help@r-project.org Subject: Re: [R] na.omit not omitting rows CAUTION: This email was sent from an external source. Use caution when replying, opening links or a

Re: [R] na.omit not omitting rows

2020-06-04 Thread Ted Stankowich
ursday, June 4, 2020 12:39 PM To: Ted Stankowich Cc: r-help@r-project.org Subject: Re: [R] na.omit not omitting rows CAUTION: This email was sent from an external source. Use caution when replying, opening links or attachments. Does droplevels() help? > d <- data.frame(size = factor(c(&quo

Re: [R] na.omit not omitting rows

2020-06-04 Thread William Dunlap via R-help
Does droplevels() help? > d <- data.frame(size = factor(c("S","M","M","L","L"), levels=c("S","M","L")), id=c(101,NA,NA,104,105)) > str(d) 'data.frame': 5 obs. of 2 variables: $ size: Factor w/ 3 levels "S","M","L": 1 2 2 3 3 $ id : num 101 NA NA 104 105 > str(na.omit(d)) 'data.frame': 3 o

[R] na.omit not omitting rows

2020-06-04 Thread Ted Stankowich
Hello! I'm trying to create a subset of a dataset and then remove all rows with NAs in them. Ultimately, I am running phylogenetic analyses with trees that require the tree tiplabels to match exactly with the rows in the dataframe. But when I use na.omit to delete the rows with NAs, there is sti