<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bhu14</title>
    <description>The latest articles on DEV Community by Bhu14 (@bhu141).</description>
    <link>https://dev.to/bhu141</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F634649%2Fde0782c6-ce21-4fda-ba08-2f7eb3362a9c.png</url>
      <title>DEV Community: Bhu14</title>
      <link>https://dev.to/bhu141</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhu141"/>
    <language>en</language>
    <item>
      <title>Creating graphs in R</title>
      <dc:creator>Bhu14</dc:creator>
      <pubDate>Thu, 02 Dec 2021 13:39:39 +0000</pubDate>
      <link>https://dev.to/bhu141/creating-graphs-in-r-f11</link>
      <guid>https://dev.to/bhu141/creating-graphs-in-r-f11</guid>
      <description>&lt;p&gt;R is very important to analysts because it has a wide range of techniques for graphically interpreting data. The main styles are: dot plot, density plot (can be classified as histograms and kernel), line graphs, bar graphs (stacked, grouped and simple), pie charts (3D,simple and expounded), line graphs(3D,simple and expounded), box-plots(simple, notched and violin plots), bag-plots and scatter-plots (simple with fit lines, scatter-plot matrices, high-density plots and 3-D plots). The foundational function for creating graphs: plot(). This includes how to build a graph, from adding lines and points to attaching a legend.&lt;/p&gt;

&lt;h2&gt;
  
  
  The plot() Function:
&lt;/h2&gt;

&lt;p&gt;The plot () function forms many foundations for R's basic graphics operations and serves as a means for creating many different types of graphics. plot () is  a placeholder for a generic function or function family. The actual function that is  called depends on the class of the object that is called.&lt;/p&gt;

&lt;p&gt;The basic syntax for plot() function is&lt;br&gt;
          *&lt;em&gt;plot(v, type, col, xlab, ylab) *&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;v&lt;/strong&gt; is a vector containing the numeric values. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;type&lt;/strong&gt; takes the value "p" to draw only the points, "l" to draw only the lines and "o" to draw both points and lines. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;xlab&lt;/strong&gt; is the label for x axis. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ylab&lt;/strong&gt; is the label for y axis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;main&lt;/strong&gt; is the Title for the chart.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;col&lt;/strong&gt; is used to give colors to both the points and lines.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples of plot function :&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Define the cars vector with 5 values 
cars &amp;lt;- c(1, 3, 6, 4, 9)
# Graph the cars vector with all defaults 
plot(cars)
The default argument of type is points 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--taFjNidX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jclt0ql9a2oyqdpj8q9l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--taFjNidX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jclt0ql9a2oyqdpj8q9l.png" alt="Image description" width="282" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Define the cars vector with 5 values 
cars &amp;lt;- c(1, 3, 6, 4, 9)
# Graph cars using blue points with lines 
plot(cars, type="o", col="blue")
# Create a title with a red, bold/italic font 
title(main="Autos",col.main="red", font.main=4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_eY2kO9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1bbli57sozds2r96v4c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_eY2kO9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1bbli57sozds2r96v4c.png" alt="Image description" width="345" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>POINTERS IN C</title>
      <dc:creator>Bhu14</dc:creator>
      <pubDate>Thu, 20 May 2021 10:38:06 +0000</pubDate>
      <link>https://dev.to/bhu141/pointers-in-c-2jo2</link>
      <guid>https://dev.to/bhu141/pointers-in-c-2jo2</guid>
      <description>&lt;p&gt;• Variables are allocated memory space in main &lt;br&gt;
memory/primary memory, to store their &lt;br&gt;
values.&lt;br&gt;
• Main memory is partitioned into cells called &lt;br&gt;
memory cells/memory word .&lt;br&gt;
• Each memory word is given address which is &lt;br&gt;
numerical that ranges from 0 , 1, 2 ….• Pointer is a data type&lt;br&gt;
• Value of pointer variable is memory address which is &lt;br&gt;
numerical value&lt;br&gt;
Declaration&lt;br&gt;
 int *P1;&lt;br&gt;
P1 is a pointer variable pointing to integer&lt;br&gt;
value of P1 is memory address of int variable&lt;br&gt;
• Address operator&lt;br&gt;
int x;&lt;br&gt;
 &amp;amp;x refers to address of x &lt;br&gt;
Address of x can be assigned to a pointer variable&lt;br&gt;
ex: P1=&amp;amp;x&lt;/p&gt;

&lt;p&gt;#VOID POINTER&lt;/p&gt;

&lt;p&gt;void pointer is a special type of pointer. &lt;br&gt;
Void pointer can point to a variable of any data type, &lt;br&gt;
 integer , float ,character.&lt;br&gt;
– The type casting or assignment must be used to turn the &lt;br&gt;
void pointer to a pointer of a concrete data type to which we &lt;br&gt;
can refer.&lt;br&gt;
– limitation is that the pointed data cannot be referenced directly &lt;br&gt;
(the asterisk * operator cannot be used on them) since its length is &lt;br&gt;
always undetermined.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;int main()&lt;br&gt;
{&lt;br&gt;
int a=5,&lt;br&gt;
double b=3.1415;&lt;br&gt;
void &lt;em&gt;vp;&lt;br&gt;
vp=&amp;amp;a;&lt;br&gt;
printf(“\n a= %d”, *((int&lt;/em&gt;)vp)); // type casting to int pointer&lt;br&gt;
vp=&amp;amp;b;&lt;br&gt;
printf(“\n a= %d”, *((double *)vp)); &lt;br&gt;
// typecasting to double pointer&lt;br&gt;
return 0;&lt;br&gt;
}&lt;br&gt;
OUTPUT:&lt;br&gt;
a= 5&lt;br&gt;
b= 3.141500&lt;/p&gt;

&lt;p&gt;One dimensional Arrays &amp;amp; pointers:&lt;/p&gt;

&lt;p&gt;• Array name is address of first element. So array name &lt;br&gt;
is a pointer&lt;br&gt;
• We can access array elements using array name &lt;br&gt;
without using subscript&lt;br&gt;
Int x[5];&lt;br&gt;
x refers to address of 0th element&lt;br&gt;
x+1 refers to address of 1st&lt;br&gt;
 element&lt;br&gt;
…..&lt;br&gt;
x+n-1 refers to address of (n-1)th or last element&lt;/p&gt;

&lt;p&gt;// accessing array elements using array name which is a pointer&lt;/p&gt;

&lt;h1&gt;
  
  
  include
&lt;/h1&gt;

&lt;h1&gt;
  
  
  include
&lt;/h1&gt;

&lt;p&gt;main()&lt;br&gt;
{&lt;br&gt;
int a[5]={10,20,30,40,50};&lt;br&gt;
clrscr();&lt;br&gt;
printf("address of a[0]=%p a[1]=%p a[2]=%p\n",&amp;amp;a[0],&amp;amp;a[1],&amp;amp;a[2]);&lt;br&gt;
printf("address of the first element of array=%p\n",a);&lt;br&gt;
printf("value of first element=%d value =%d\n",a[0],&lt;em&gt;a);&lt;br&gt;
printf("value of second element=%d value=%d\n",a[1],&lt;/em&gt;(a+1));&lt;br&gt;
printf("value of last element=%d value=%d\n",a[4],*(a+4));&lt;br&gt;
return;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Accessing array elements using pointer&lt;/p&gt;

&lt;h1&gt;
  
  
  include
&lt;/h1&gt;

&lt;p&gt;int main()&lt;br&gt;
{&lt;br&gt;
 int i,a[7]={1,2,3,4,5,6,7};&lt;br&gt;
 int &lt;em&gt;p;&lt;br&gt;
 p=a; // array name is a pointer to the first element&lt;br&gt;
 for(i=0; i&amp;lt;7; i++) &lt;br&gt;
printf("%d\t",&lt;/em&gt;(p+i)); //adding i value to pointer p&lt;br&gt;
 return(0);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Operations on pointer variables:&lt;/p&gt;

&lt;p&gt;• Pointer variable can be assigned with NULL &lt;br&gt;
 ex: int *x=NULL&lt;br&gt;
• Pointer variable can be initialized with another pointer or with address of &lt;br&gt;
another variable&lt;br&gt;
Ex: &lt;br&gt;
float x;&lt;br&gt;
float *p1=&amp;amp;x, *p2=p1;&lt;br&gt;
• Integer constant can be added to a pointer. This is useful for accessing &lt;br&gt;
array elements&lt;br&gt;
Ex:&lt;br&gt;
 int a[5]={1,2,3,4,5}&lt;br&gt;
 int *p1=a;&lt;br&gt;
 p1=p1+2 refer to third element of array&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
