filter object from variable

I am trying to filter objects from variables.
here is my data;

head(DfUse)
InstanceType  ProductDescription      SpotPrice       ymd_hms(Timestamp)
<chr>                 <chr>           <dbl>                    <chr> 
1	a1.2xlarge	Linux/UNIX	0.0671	06:17:23
2	a1.2xlarge	Red Hat Enterprise Linux	0.1971	06:17:23
3	a1.2xlarge	SUSE Linux	0.2171	06:17:23
4	a1.4xlarge	Linux/UNIX	0.1343	12:15:54
5	a1.4xlarge	Red Hat Enterprise Linux	0.2643	12:15:54
6	a1.4xlarge	SUSE Linux	0.2843	12:15:54

dimension of data is

dim(DfUse)
[1] 10078     4

data set structure

str(DfUse)
'data.frame':	10078 obs. of  4 variables:
 $ InstanceType      : chr  "  a1.2xlarge" "  a1.2xlarge" "  a1.2xlarge" "  a1.4xlarge" ...
 $ ProductDescription: chr  "  Linux/UNIX" "  Red Hat Enterprise Linux" "  SUSE Linux" "  Linux/UNIX" ...
 $ SpotPrice         : num  0.0671 0.1971 0.2171 0.1343 0.2643 ...
 $ ymd_hms(Timestamp): chr  "06:17:23" "06:17:23" "06:17:23" "12:15:54" ...

when i try to filter

filter(DfUse, InstanceType == 'a1.2xlarge')
0 rows

Kindly help in filtering the data set. I want to stack all filtered values group by other variables.

dplyr::filter(DfUse, trimws(InstanceType) == 'a1.2xlarge')

i dint notice white space.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.