I guess these issues can be ignored because
> 1.0000000000001
[1] 1
So, even if he did have 1.0000000000001 in his data, as soon as it's in R, he doesn't have it anymore.
> On Wed, Apr 4, 2018 at 2:59 PM, Scott Devine <
smde...@ucdavis.edu <mailto:
smde...@ucdavis.edu>> wrote:
>
> This base R approach should also work for you. If you have NAs in your numeric column, you will need to modify this approach.
>
> #test the approach of logical indexing. returns a TRUE when a decimal point is not found in a numeric vector converted to a character vector
> test <- c(1.1, 1, 2, 1.48, 5)
> class(test)
> !grepl('\\.', as.character(test))
>
> #implement logical indexing approach on a data.frame
> df1 <- data.frame(a=test, b=c('no', 'yes', 'yes', 'no', 'yes'))
> df1
> df2 <- df1[!grepl('\\.', as.character(df1$a)), ]
> df2
>
> On Wed, Apr 4, 2018 at 2:27 PM, Ryan Byrnes <
ryby...@gmail.com <mailto:
ryby...@gmail.com>> wrote:
>
> Hi All,
>
> A silly question, perhaps but here goes. I have a data frame with multiple columns one of the columns has numerical values. I am interested in keeping only the rows of this data frame that within this column of interest are whole numbers and a few thousand of them unfortunately have decimals. I won't go into why I want to remove the decimal values but was wondering if there's a way to remove numerical values with decimals from a data frame and keep the remaining whole numbers? All my searches have come up blank so far...
>
> Thanks!
> Ryan
>
>
> --
> Check out our R resources at
http://d-rug.github.io/
> ---
> You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
davis-rug+...@googlegroups.com <mailto:
davis-rug+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/davis-rug <
https://groups.google.com/group/davis-rug>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
>
>
>
> --
> Scott Devine
> PhD candidate in Soils and Biogeochemistry <
http://soils.ucdavis.edu/>
> Dept of Land, Air, and Water Resources
> University of California, Davis
>
smde...@ucdavis.edu <mailto:
smde...@ucdavis.edu>
(530) 333-7925
> --
> Check out our R resources at
http://d-rug.github.io/
> ---
> You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
davis-rug+...@googlegroups.com <mailto:
davis-rug+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/davis-rug <
https://groups.google.com/group/davis-rug>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
>
>
>
> --
> Vince Buffalo
> @vsbuffalo <
https://twitter.com/vsbuffalo> ::
vincebuffalo.com <
http://vincebuffalo.com>
> Coop Lab <
http://gcbias.org/> :: Population Biology Graduate Group
> University of California, Davis
> --
> Check out our R resources at
http://d-rug.github.io/
> ---
> You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
davis-rug+...@googlegroups.com <mailto:
davis-rug+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/davis-rug <
https://groups.google.com/group/davis-rug>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
>
>
>
> --
> Scott Devine
> PhD candidate in Soils and Biogeochemistry <
http://soils.ucdavis.edu/>
> Dept of Land, Air, and Water Resources
> University of California, Davis
>
smde...@ucdavis.edu <mailto:
smde...@ucdavis.edu>
(530) 333-7925
> --
> Check out our R resources at
http://d-rug.github.io/
> ---
> You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
davis-rug+...@googlegroups.com <mailto:
davis-rug+...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/davis-rug <
https://groups.google.com/group/davis-rug>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
>
> --
> Check out our R resources at
http://d-rug.github.io/
> ---
> You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
davis-rug+...@googlegroups.com <mailto:
davis-rug+...@googlegroups.com>.