是否有R函数将回归线和回归方程添加到ggplot

时间:2019-08-04 06:52:04

标签: r

我已将ggplot用于以下2类的数据框(汽车数据集)。我需要2个类别的2个回归方程。下面是我执行的用于绘制图形的代码

$requestBody = trim('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://schemas.microsoft.com/dynamics/2013/01/datacontracts" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tem="http://tempuri.org">
   <soapenv:Header>
      <dat:CallContext>
         <dat:Company>company</dat:Company>
         <dat:Language>en-us</dat:Language>
         <dat:MessageId>?</dat:MessageId>
         <dat:PartitionKey>12345667</dat:PartitionKey>
      </dat:CallContext>
   </soapenv:Header>
   <soapenv:Body>
      <m:getMethod xmlns:m="http://tempuri.org/webService/getMethod">
         <m:parameterName soap:mustUnderstand="1">12345</m:parameterName>
      </m:getMethod>
   </soapenv:Body>
</soapenv:Envelope>
            ');

    $soapAction = 'SOAPAction: http://tempuri.org/webService/getMethod';
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, 
            array(  'Accept:text/xml',
                    'Accept-Encoding: gzip,deflate',
                    'Connection: Keep-Alive',
                    'Content-type: text/xml; charset=utf-8',
                    'Cache-Control: no-cache',
                    'Pragma: no-cache',
                    'Authorization: Bearer longstringToken',
                    'SOAPAction: http://tempuri.org/webService/getMethod'
                ));
 if ($postData != '') {
            curl_setopt($ch, CURLOPT_POSTFIELDS,$postData);             
        }
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// By default https does not work for CURL.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt ($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
// Set the option to recieve the response back as string.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
$odataURL = 'https://domainname.sandbox.ax.dynamics.com/soap/services/webService'; 
curl_setopt($ch, CURLOPT_URL, $odataURL);
// enable string response
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);

curl_setopt($ch, CURLOPT_POST, true);   

curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_HEADER, true);
// Mark as Post request
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
// $output contains the output string
$output = curl_exec($ch);

您能帮我介绍两个回归方程吗

0 个答案:

没有答案