<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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 id="stopSpelling">Date: Sat, 18 May 2013 09:28:23 -0300<br>From: heliogallorocha@gmail.com<br>To: r-br@listas.c3sl.ufpr.br<br>Subject: [R-br] Classificar fosforo e textura do solo<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="height: 12.75pt;">
  <td width="64" height="17" style="width: 48pt; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="padding: 0cm 3.5pt; border: 1pt solid windowtext; width: 48pt; 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; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="border-style: none solid solid; padding: 0cm 3.5pt; width: 48pt; 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; 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; 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; 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; 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; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="border-style: none solid solid; padding: 0cm 3.5pt; width: 48pt; 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; 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; 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; 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; 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; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="border-style: none solid solid; padding: 0cm 3.5pt; width: 48pt; 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; 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; 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; 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; 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; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="border-style: none solid solid; padding: 0cm 3.5pt; width: 48pt; 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; 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; 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; 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; 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; 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="height: 12.75pt;">
  <td width="64" nowrap="" valign="bottom" style="border-style: none solid solid; padding: 0cm 3.5pt; width: 48pt; 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; 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; 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; 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; 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; 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 id="ecxpost-title" 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>_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forne�a c�digo m�nimo reproduz�vel.</div>                                      </div></body>
</html>