Re: [R] What is the intended behavior, when subsetting using brackets [ ], when the subset criterion has NA's?

2022-04-06 Thread Jeff Newmiller
I suspect you were the victim of your own failure to use plain text email format as the Posting Guide warns you to do, or at least you let your email client try to convert your reply to HTML format... which often treats text on different lines as part of a single paragraph. As David pointed out,

Re: [R] What is the intended behavior, when subsetting using brackets [ ], when the subset criterion has NA's?

2022-04-06 Thread David Winsemius
On 4/6/22 16:17, Ebert,Timothy Aaron wrote: Based on the OP's submission I pasted the following into R and tried to run it. Here is what I think was posted (comments removed): my_data <- 1:5 my_data my_subset_criteria <- c( F, F, T, NA, NA) my_subset_criteria equals TRUE my_data[my_subset_cri

Re: [R] What is the intended behavior, when subsetting using brackets [ ], when the subset criterion has NA's?

2022-04-06 Thread Ebert,Timothy Aaron
I get an error with this: my_subset_criteria <- c( F, F, T, NA, NA) my_subset_criteria Tim -Original Message- From: R-help On Behalf Of Kelly Thompson Sent: Wednesday, April 6, 2022 4:13 PM To: r-help@r-project.org Subject: [R] What is the intended behavior, when subsetting using bracke

[R] What is the intended behavior, when subsetting using brackets [ ], when the subset criterion has NA's?

2022-04-06 Thread Kelly Thompson
I noticed that I get different results when subsetting using subset, compared to subsetting using "brackets" when the subset criteria have NA's. Here's an example #START OF EXAMPLE my_data <- 1:5 my_data my_subset_criteria <- c( F, F, T, NA, NA) my_subset_criteria #subsetting using subset retu

Re: [R] [External] replacing a value

2022-04-06 Thread Rui Barradas
Hello, The problem seems to be solved, btu maybe my answer to this thread [1] can be of help. Using Bill's dput'ed data equals <- function(x, y, tol = .Machine$double.eps^0.5) abs(x - y) < tol x <- c(0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.4p+4, 0x1.

Re: [R] I need help with this

2022-04-06 Thread Kimmo Elo
Hi! No question. No idea, what you want to achieve. So do not be surprised that we cannot give you any help. Kimmo ti, 2022-04-05 kello 21:59 -0400, ihejirika christopher via R-help kirjoitti: > install.packages("titanic") > library(titanic) > > training_set <- titanic_train#Saves the train set