Hello, Can someone please help me know hoe i can make a new dataset, based on conditions.
I want new dataset based on product - Russian banana and Vermillion, but don't know how to adjust one more condition here:
df <- read.csv("F:/SASUniversityEdition/myfolders/jar.csv", stringsAsFactors = F)
colnames(df)[1] = "assessor"
#subset of 2 samples
newdata <- df[ which(df$product=='Russian banana' ), ]
Created on 2020-09-25 by the reprex package (v0.3.0)
Here is dataset:
squads <-tibble::tribble(
~assessor, ~product, ~category,
1L, "Russian banana", 2L,
1L, "Vermillion", 1L,
1L, "Atlantic", 1L,
1L, "POR12PG28-3", 2L,
1L, "Valery", 1L,
1L, "Rio colorado", 1L,
1L, "CO99076-6R", 2L,
1L, "Purple majesty", 2L,
1L, "AC99330-1P/Y", 2L,
1L, "CO05068-1RU", 1L,
1L, "Masquerade", 2L,
1L, "Canela ruset", 2L,
2L, "Russian banana", 3L,
2L, "Vermillion", 3L,
2L, "Atlantic", 2L
)
head(squads)
#> # A tibble: 6 x 3
#> assessor product category
#> <int> <chr> <int>
#> 1 1 Russian banana 2
#> 2 1 Vermillion 1
#> 3 1 Atlantic 1
#> 4 1 POR12PG28-3 2
#> 5 1 Valery 1
#> 6 1 Rio colorado 1
Created on 2020-09-25 by the reprex package (v0.3.0)