Буду признателен, если кто-нибудь посоветует мне, как установить связь между двумя переменными.Это может быть очень просто, но я новичок в R. Я не могу прикрепить фотографии того, как выглядит мой набор данных (X2015_11_metropolitan_stop_and_search), но вот dput по двум интересующим меня переменным:
dput(X2015_11_metropolitan_stop_and_search$Object of search)
c("Offensive weapons", "Controlled drugs", "Controlled drugs", "Fireworks", "Controlled drugs", "Stolen goods", "Controlled drugs", "Controlled drugs", "Offensive weapons", "Controlled drugs", "Fireworks", "Controlled drugs", "Controlled drugs", "Evidence of offences under the Act", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Offensive weapons", "Stolen goods", "Controlled drugs", "Controlled drugs", "Offensive weapons", "Offensive weapons", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs", "Controlled drugs" )
dput(X2015_11_metropolitan_stop_and_search$Outcome)
c("Suspect arrested", "Nothing found - no further action", "Suspect arrested",
"Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Offender given drugs possession warning",
"Nothing found - no further action", "Offender given drugs possession warning",
"Nothing found - no further action", "Nothing found - no further action",
"Suspect arrested", "Suspect arrested", "Offender given drugs possession warning",
"Suspect arrested", "Suspect arrested", "Nothing found - no further action",
"Nothing found - no further action", "Suspect arrested", "Nothing found - no further action",
"Nothing found - no further action", "Suspect arrested", "Suspect arrested",
"Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Nothing found - no further action",
"Suspect arrested", "Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Nothing found - no further action",
"Suspect arrested", "Nothing found - no further action", "Nothing found - no further action",
"Suspect arrested", "Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Suspect arrested", "Suspect arrested",
"Nothing found - no further action", "Nothing found - no further action",
"Nothing found - no further action", "Offender given drugs possession warning",
"Suspect arrested", "Offender given penalty notice", "Nothing found - no further action")
Существует небольшое количество возможных значений для переменных «Объект поиска» и «Результат».Я хотел бы видеть значение «Объект поиска» для тех отдельных инцидентов, в которых значение «Результат» было «Подозреваемый арестован».Возможно ли это?
Если мне нужно добавить дополнительную информацию, пожалуйста, дайте мне знать.