[ 
https://issues.apache.org/jira/browse/SPARK-9316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14718267#comment-14718267
 ] 

Felix Cheung commented on SPARK-9316:
-------------------------------------

The string form is not listed in the code example in the documentation, please 
see:

{code}
#'   # Columns can be selected using `[[` and `[`
#'   df[[2]] == df[["age"]]
#'   df[,2] == df[,"age"]
#'   df[,c("name", "age")]
#'   # Or to filter rows
#'   df[df$age > 20,]
#'   # DataFrame can be subset on both rows and Columns
#'   df[df$name == "Smith", c(1,2)]
#'   df[df$age %in% c(19, 30), 1:2]
#'   subset(df, df$age %in% c(19, 30), 1:2)
#'   subset(df, df$age %in% c(19), select = c(1,2))
{code}

To clarify, I wanted to keep the code simple thus I had opt'ed to take out that 
implementation instead. Therefore
{code}
df["age in (19, 30)",]
{code}
is not supported at this point. As you have pointed out, Deborah, one could use 
`transform` with that syntax if needed.


> Add support for filtering using `[` (synonym for filter / select)
> -----------------------------------------------------------------
>
>                 Key: SPARK-9316
>                 URL: https://issues.apache.org/jira/browse/SPARK-9316
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SparkR
>            Reporter: Shivaram Venkataraman
>            Assignee: Felix Cheung
>             Fix For: 1.6.0, 1.5.1
>
>
> Will help us support queries of the form 
> {code}
> air[air$UniqueCarrier %in% c("UA", "HA"), c(1,2,3,5:9)]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to