Message-ID: <719227861.2891301.1485253580527@mail.yahoo.com>
Date: 2017-01-24T10:26:20Z
From: Sathiaraj S P
Subject: Extract input and filter data using extracted value.
Hi,
I raised this question @ stack overflow and got below partial answer. Hope this mailing list can help on rest to complete.
library(dplyr)
library(tidyr)
input <- "1.8 - versicolor"
temp <- data.frame(input = input) %>%
tidyr::separate(input, c("Petal.Width", "Species"),sep = " - ", convert = TRUE)
filtered <- dplyr::filter(iris, iris$Petal.Width %in% temp$Petal.Width)
This work fine but my input is "A001 - Description1" and I get "Error: operations are possible only for numeric, logical or complex types". even I tried with convert as FALSE.
Any suggestion? Is there any alternative package for the solution?
Thanks