saving . . . saved Assignment has been deleted. Assignment has been hidden .
Assignment
Title
Question
In the assignment i have worked out got the solution but with an error. Kindly help sir

<pre class="GNKRCKGCGSB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" tabindex="0"><span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">subData <- subset(captaincy,played>20,lost<14, select = c("names","played","lost")) </span><span class="GNKRCKGCASB ace_constant" style="color: rgb(197, 6, 11);">Error in `[.data.frame`(x, r, vars, drop = drop) : object 'lost' not found </span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;">> </span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">print(subData) </span><span class="GNKRCKGCGSB" style="outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important;"> names played won 1 Mahi 45 22 2 Sourav 49 21 6 Dravid 25 8</span></span></pre>

R Indexing-and-Slicing-Data-Frames 12-13 min 30-40 sec 15-05-20, 8:05 p.m. Alamu

Answers:

Please note that you need to use an & symbol to combine multiple conditions, as shown below:
-----------------------------------------------------------------------------------------------------------------------
subData <- subset(captaincy, played>20 & lost<14, select = c("names","played","lost"))
-----------------------------------------------------------------------------------------------------------------------
15-05-20, 8:33 p.m. sudhakarst
Thank you sir
15-05-20, 8:38 p.m. Alamu

Login to add comment


Thank you so much sir.
15-05-20, 8:38 p.m. Alamu


Log-in to answer to this question.