<div dir="ltr">Tiago, obrigado pela ajuda, deve ter dado um trabalhão<div style>rodei o CRM enviado, usei como teste,</div><div style><br></div><div style><div>psolo= c(2,2.69,2.7,2.79,5.39,5.4,5.5,7.99,8,8.01,11.99,12,12.01)</div>
<div>argila=rep(60.01,13)</div><div><br></div><div style>Sou novato no R, mas não consegui resposta</div><div style><br></div><div style>Garto</div><div style><br></div><div style>Hélio</div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">Em 20 de maio de 2013 12:41, Tiago de Souza [via R-br] <span dir="ltr"><<a href="mailto:ml-node+s2285057n4659359h97@n4.nabble.com" target="_blank">ml-node+s2285057n4659359h97@n4.nabble.com</a>></span> escreveu:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hélio tente o seguinte comandos: <br> <br><font face="Courier New">recP<-function(argila,Psolo){<br>t<-numeric(0)</font><br><font face="Courier New"> if(100>=argila && argila>=60 && 2.7>=Psolo && Psolo>=0){<br>
t<-c(t,"Multo Baixo")<br>}</font><br><font face="Courier New"> if(100>=argila && argila>=60 && 5.4>=Psolo && Psolo>2.7){<br> t<-c(t,"Baixo")<br>}</font><br>
<font face="Courier New"> if(100>=argila && argila>=60 && 8>=Psolo && Psolo>5.4){<br> t<-c(t,"Médio")<br>}</font><br><font face="Courier New"> if(100>=argila && argila>=60 && 12>=Psolo && Psolo>8){<br>
t<-c(t,"Bom")<br>}</font><br><font face="Courier New"> if(100>=argila && argila>=60 && Psolo>12){<br> t<-c(t,"Muito Bom")<br>}</font><br><font face="Courier New"> if(60>argila && argila>=35 && 4>=Psolo && Psolo>=0){<br>
t<-c(t,"Multo Baixo")<br>}</font><br><font face="Courier New"> if(60>argila && argila>=35 && 8>=Psolo && Psolo>4){<br> t<-c(t,"Baixo")<br>}</font><br><font face="Courier New"> if(60>argila && argila>=35 && 12>=Psolo && Psolo>8){<br>
t<-c(t,"Médio")<br>}</font><br><font face="Courier New"> if(60>argila && argila>=35 && 18>=Psolo && Psolo>12){<br> t<-c(t,"Bom")<br>}</font><br><font face="Courier New"> if(60>argila && argila>=35 && Psolo>18){<br>
t<-c(t,"Muito Bom")<br>}</font><br><font face="Courier New"> if(35>argila && argila>=15 && 6.6>=Psolo && Psolo>=0){<br> t<-c(t,"Multo Baixo")<br>}</font><br>
<font face="Courier New"> if(35>argila && argila>=15 && 12>=Psolo && Psolo>6.6){<br> t<-c(t,"Baixo")<br>}</font><br><font face="Courier New"> if(35>argila && argila>=15 && 20>=Psolo && Psolo>12){<br>
t<-c(t,"Médio")<br>}</font><br><font face="Courier New"> if(35>argila && argila>=15 && 30>=Psolo && Psolo>20){<br> t<-c(t,"Bom")<br>}</font><br><font face="Courier New"> if(35>argila && argila>=15 && Psolo>30){<br>
t<-c(t,"Muito Bom")<br>}</font><br><font face="Courier New"> if(15>argila && argila>=0 && 10>=Psolo && Psolo>=0){<br> t<-c(t,"Multo Baixo")<br>}</font><br>
<font face="Courier New"> if(15>argila && argila>=0 && 20>=Psolo && Psolo>10){<br> t<-c(t,"Baixo")<br>}</font><br><font face="Courier New"> if(15>argila && argila>=0 && 30>=Psolo && Psolo>20){<br>
t<-c(t,"Médio")<br>}</font><br><font face="Courier New">if(15>argila && argila>=0 && 45>=Psolo && Psolo>30){<br> t<-c(t,"Bom")<br>}</font><br><font face="Courier New">if(15>argila && argila>=0 && Psolo>45){<br>
t<-c(t,"Muito Bom")<br>}</font><br><font face="Courier New">return(t)<br>} </font><br> <br>De acordo com a classificação gerada pela função <font face="Courier New">recP()</font> você pode conectar estes comandos a outros de forma que ele retorne a quantidade de fertilizante a ser utilizada para uma determinada cultura.<br>
<br>Att.<br> <br>Tiago.<br> <br>#############################################################################################################<br> <br>Graduando em Agronomia pelo CCA-UFES<br> <br>Bolsista da FAPES na área de Genética e Melhoramento de plantas<br>
<br>############################################################################################################# <br> <br><div><hr>Date: Sat, 18 May 2013 09:28:23 -0300<br>From: <a href="http://user/SendEmail.jtp?type=node&node=4659359&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a><br>
To: <a href="http://user/SendEmail.jtp?type=node&node=4659359&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a><br>Subject: [R-br] Classificar fosforo e textura do solo<div><div class="h5"><br>
<br><div dir="ltr">Bom dia a todos,<div><br></div><div>Para recomendar adubação fosfatada é necessário classificar a quantidade de fósforo da análise em conjunto a textura do solo.</div><div><br></div><div><table width="412" style="width:311pt;border-collapse:collapse" border="0" cellspacing="0" cellpadding="0">
<colgroup><col width="64" style="width:48pt">
<col width="128" style="width:96pt">
<col width="50" style="width:38pt" span="3">
<col width="70" style="width:53pt">
</colgroup><tbody><tr height="17" style="min-height:12.75pt">
<td width="64" height="17" style="width:48pt;min-height:12.75pt"> Tabela da quinta aproximação <table width="415" style="width:311pt;border-collapse:collapse" border="0" cellspacing="0" cellpadding="0">
<tbody><tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="padding:0cm 3.5pt;border:1pt solid windowtext;width:48pt;min-height:12.75pt">
<span style="font-family:Arial;font-size:10pt"> </span><br>
</td>
<td width="351" nowrap valign="bottom" style="border-style:solid solid solid none;padding:0cm 3.5pt;width:263pt;min-height:12.75pt;border-top-color:windowtext;border-right-color:windowtext;border-bottom-color:windowtext;border-top-width:1pt;border-right-width:1pt;border-bottom-width:1pt" colspan="5">
<p align="center" style="text-align:center"><span style="font-family:Arial;font-size:10pt">Nível de Fósforo mg/dm3</span></p>
</td>
</tr>
<tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="border-style:none solid solid;padding:0cm 3.5pt;width:48pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-left-color:windowtext;border-right-width:1pt;border-bottom-width:1pt;border-left-width:1pt">
<span style="font-family:Arial;font-size:10pt">Argila%</span><br>
</td>
<td width="130" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:97.7pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">muito
baixo</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">Baixo</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">Médio</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">Bom</span><br>
</td>
<td width="70" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:52.5pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">Muito Bom</span><br>
</td>
</tr>
<tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="border-style:none solid solid;padding:0cm 3.5pt;width:48pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-left-color:windowtext;border-right-width:1pt;border-bottom-width:1pt;border-left-width:1pt">
<span style="font-family:Arial;font-size:10pt">60-100</span><br>
</td>
<td width="130" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:97.7pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt"><2.7
(menor e igual)</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">2.8-5.4</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">5.5-8</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">8.1-12</span><br>
</td>
<td width="70" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:52.5pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">>12</span><br>
</td>
</tr>
<tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="border-style:none solid solid;padding:0cm 3.5pt;width:48pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-left-color:windowtext;border-right-width:1pt;border-bottom-width:1pt;border-left-width:1pt">
<span style="font-family:Arial;font-size:10pt">35-60</span><br>
</td>
<td width="130" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:97.7pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt"><4</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">4.1-8</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">8.1-12</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">12.1-18</span><br>
</td>
<td width="70" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:52.5pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">>18</span><br>
</td>
</tr>
<tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="border-style:none solid solid;padding:0cm 3.5pt;width:48pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-left-color:windowtext;border-right-width:1pt;border-bottom-width:1pt;border-left-width:1pt">
<span style="font-family:Arial;font-size:10pt">15-35</span><br>
</td>
<td width="130" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:97.7pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt"><6.6</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">6.7-12</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">12.1-20</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">20.1-30</span><br>
</td>
<td width="70" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:52.5pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">>30</span><br>
</td>
</tr>
<tr style="min-height:12.75pt">
<td width="64" nowrap valign="bottom" style="border-style:none solid solid;padding:0cm 3.5pt;width:48pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-left-color:windowtext;border-right-width:1pt;border-bottom-width:1pt;border-left-width:1pt">
<span style="font-family:Arial;font-size:10pt">0-15</span><br>
</td>
<td width="130" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:97.7pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt"><10</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">10.1-20</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">20.1-30</span><br>
</td>
<td width="50" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:37.6pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">30.1-45</span><br>
</td>
<td width="70" nowrap valign="bottom" style="border-style:none solid solid none;padding:0cm 3.5pt;width:52.5pt;min-height:12.75pt;border-right-color:windowtext;border-bottom-color:windowtext;border-right-width:1pt;border-bottom-width:1pt">
<span style="font-family:Arial;font-size:10pt">>45</span><br>
</td>
</tr>
</tbody></table></td><td width="348" style="width:263pt;border-left-style:none" colspan="5"><br></td></tr></tbody></table></div><div><div><br></div><div><br></div><div>Fiz o seguinte:</div><div><div>
solo=c(1:50) # resultado da análise do solo</div><div>argila=c(60,35,15,0) # teor de argila</div><div>p1=c(0,2.7,5.4,8,12) # fósforo com + de 60% de argila</div><div>p2=c(0,4,8,12,18) # fósforo com 35 a 60% de argila</div>
<div>p3=c(0,6.6,12,20,30) # fósforo com 15 a 35% de argila</div><div>p4=c(0,10,20,30,45) # fósforo com < 15% de argila</div><div>res=c("Muito.Baixo","Baixo", "Medio", "Alto", "Muito.alto")</div>
<div><br></div><div>Assim se o resultado de P é 3.5 :</div><div>60% de arg, seria classificado como Baixo</div><div>35% de arg. seria classificado como muito baixo</div><div><br></div><div>andei dando uma olhada na solução do post </div>
<h1 style="color:rgb(51,51,51);font-family:GillSans,Trebuchet,Calibri,Arial,sans-serif;font-size:1.8em">Uso do ifelse</h1><div><br></div></div><div>A saida desta função seria casada com uma recomendação,</div>
<div><br></div><div>Grato a todos</div><div><br></div>-- <br>Hélio Gallo Rocha<br>IFSULDEMINAS - Câmpus Muzambinho<br>
</div></div>
<br></div></div>_______________________________________________
R-br mailing list
<a href="http://user/SendEmail.jtp?type=node&node=4659359&i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</div> </div><div class="im">
<br>_______________________________________________
<br>R-br mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=4659359&i=3" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="nofollow" link="external" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.
<br>
<br>
<hr noshade size="1" color="#cccccc">
</div><div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div class="im">
<div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
</div><a href="http://r-br.2285057.n4.nabble.com/R-br-Classificar-fosforo-e-textura-do-solo-tp4659355p4659359.html" target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Classificar-fosforo-e-textura-do-solo-tp4659355p4659359.html</a>
</div><div class="HOEnZb"><div class="h5">
<div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
To unsubscribe from R-br, <a href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3357982&code=aGVsaW9nYWxsb3JvY2hhQGdtYWlsLmNvbXwzMzU3OTgyfC0xMzQ3NTkwMDY4" target="_blank">click here</a>.<br>
<a href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank">NAML</a>
</div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Hélio Gallo Rocha<br>IFSULDEMINAS - Câmpus Muzambinho<br>
</div>