Reputation: 556
For the code below, I need to select the first row of the data frame.
IDD_mapdata_1 <- reactive ({
IDD_nhmap$race_black <- round(IDD_nhmap$race_black, 1)
out_map_1 <- IDD_nhmap %>%
filter (ProjectID %in% input$Disability_map)
return(out_map_1)
#list(cat)
})
Upvotes: 0
Views: 41
Reputation: 96
To get the first row only of the dataframe you could do this:
head(out_map_1) or out_map_1[1,]
This gives you the dataframe headers if you want just the row as a vector of strings, or numbers just wrap this. For example, if you need just a :
as.character(out_map_1[1,])
To get a specific value from the select statement you can do something like this:
df[1,] %>% select('Age') %>% pull()
Upvotes: 1