{"id":76042,"date":"2020-01-31T11:48:12","date_gmt":"2020-01-31T06:18:12","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=76042"},"modified":"2020-01-31T11:48:12","modified_gmt":"2020-01-31T06:18:12","slug":"r-debug","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/r-debug\/","title":{"rendered":"Debugging in R &#8211; How to Easily Overcome Errors in Your Code?"},"content":{"rendered":"<p><strong>It doesn&#8217;t matter how careful you are or how simple your logic is, bugs are always there to surprise you. <\/strong><strong>Learn the process of debugging in R with few functions. <\/strong><\/p>\n<p>In this article of our R tutorial series, we will learn about the process of debugging. We will look at popular approaches for debugging your code and about the functions in R that help with this process. We will then study the error handling functions. Finally, we will take a look at the errors and bugs that R packages may contain and how to deal with them.<\/p>\n<h3>What is Debugging?<\/h3>\n<p>Bugs and errors are ever-present phenomena for programmers all over the world. The larger your code, <span style=\"font-weight: 400\">the more chances of it having bugs<\/span>.<\/p>\n<p>Since there does not seem to be a way to write bugless code. We need to remove the bugs after writing the code. This process of removing bugs from the code is known as <strong>debugging<\/strong>.<\/p>\n<h3>The Debugging process<\/h3>\n<p>If you were to search for a single documented debugging process, you would not find any, or you would find many different ones. The truth is that there is no single fixed debugging process. In fact, every programmer has their own process that is derived from their programming experience. With practice and experience, you will find what errors and bugs you are prone to, and you will adjust your debugging approach according to that.<\/p>\n<p>While there may not be any dedicated debugging process for any programming language, here is a general process to start you with. You can adjust it with experience and practice.<\/p>\n<h4>1. Search for the error on the internet<\/h4>\n<p>The first thing recommended by most programmers and us as well would be to search for the error on the internet. Just copy the error statement and search it. If you are lucky, it would be a common error, and you would find how to debug it. Even if you don\u2019t find a proper solution, you may get a general idea of what could be producing the error.<\/p>\n<h4>2. Isolating faulty code<\/h4>\n<p>Honestly, there is no magic solution to locate where your code is faulty. The only way is to go through your code and find what might not be working.<\/p>\n<blockquote><p>\u201cFinding your bug is a process of confirming the many things that you believe are true \u2014 until you find one which is not true.\u201d<br \/>\n\u2014Norm Matloff<\/p><\/blockquote>\n<p>There are ways in which you can reduce this hard work. One popular approach is to split the code into parts. You test these individual parts and try to figure out which one is not working. Then you split the faulty code further and further until you isolate the part where the problem is occurring.<\/p>\n<h4>3. Making it repeatable<\/h4>\n<p>Once you have isolated a part of the code that you believe is the root of the problem, you will have to repeatedly execute it with different changes to identify the bug and debug it. You have to make it so that you can execute that part of the code on its own again and again. After that, make small changes in the code and execute it. Every try will give you more insight into the problem and its causes.<\/p>\n<h4>4. Fixing and testing<\/h4>\n<p>As you finally identify the problem, correct it and test it again with different scenarios to ensure that the fix works. After that, you can put it back into the whole code and test the entire code again.<\/p>\n<h2>R Functions that Help in Debugging<\/h2>\n<p>In R programming, there are a few functions that help in the debugging process. They can help in isolating the bugs or even show you the behind-the-scenes details of the code so that you can identify where the problem is actually occurring. These functions are:<\/p>\n<ol>\n<li>traceback()<\/li>\n<li>debug()<\/li>\n<li>browser()<\/li>\n<li>trace()<\/li>\n<li>recover()<\/li>\n<\/ol>\n<p>Let\u2019s look at these functions one-by-one.<\/p>\n<h3>1. traceback() Function<\/h3>\n<p>The <strong><code>traceback()<\/code><\/strong> function acts as a <strong>history viewer<\/strong>. It shows you which functions and statements were executed before the error occurred. This way you only have to check the functions that were executed before the error occurred and not all of them. This function shows us the <strong>call stack<\/strong> of the error i.e it shows us the list of the calls that lead to that error. In RStudio, when an error occurs, the IDE gives you the option to run the <strong><code>traceback()<\/code><\/strong> function automatically. You can easily call the function by clicking the <strong>Show Traceback<\/strong> option.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">a &lt;- function(x){\n  return(x+b(x))\n}\nb &lt;- function(x){\n  return(x*c(x))\n}\nc &lt;- function(x){\n  r&lt;-log(x)\n  if(r&gt;10){\n    return(r^2)\n  }else{\n    return(r^3)\n  }\n}\ny &amp;lt;- a(-10)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-treceback-function.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76060 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-treceback-function.png\" alt=\"treceback() function - debugging in r\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h3>2. debug() Function<\/h3>\n<p>The <strong><code>debug()<\/code><\/strong> function allows you to see the execution of the code step-by-step. It executes the program one step at a time and only proceeds when prompted. When the <strong><code>debug()<\/code><\/strong> function is called, your IDE enters the <strong>debug mode<\/strong>. In the debug mode, the part of the code that is suspected to be faulty is highlighted. You can see the state of the variables and objects at every step of the code\u2019s execution. This way, you can see at exactly which step the problem started and correct it.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">d &lt;- function(x,v){\n  sub &lt;- v-x\n  sq &lt;- sub^2\n  tot &lt;- sum(sq)\n  tot\n}\nset.seed(1000)\nv &lt;- rnorm(100)\ndebug(d)\ndr &lt;- d(2,v)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76061 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-debug.png\" alt=\"debug() - debugging in r\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h3>3. browser() Function<\/h3>\n<p>The <strong><code>browser()<\/code><\/strong> function is similar to the <strong><code>debug()<\/code><\/strong> function. It stops the execution of code and proceeds only when prompted. You can insert a call to the <a href=\"https:\/\/www.rdocumentation.org\/packages\/base\/versions\/3.6.2\/topics\/browser\">browser<\/a>() function anywhere in your code and its execution will pause when the function is called.<\/p>\n<p>As soon as the <strong><code>browser()<\/code><\/strong> function is called, the IDE enters the debug mode and the execution of the code continues in a step-by-step fashion. You can check the state of the program and continue if you wish to.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">fun &lt;- function(x){\n  r &lt;- log(x)\n  browser()\n  if(r&gt;5){\n    r*(r+1)\n  }else{\n    r*r\n  }\n}\nfun(-10)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-browser.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76062 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-browser.png\" alt=\"bbrowser() - debugging in r\" width=\"1299\" height=\"742\" \/><\/a><\/strong><\/p>\n<h3>4. trace() Function<\/h3>\n<p>The <strong><code>trace()<\/code><\/strong> function allows you to insert bits of code inside your program. You can use this to insert alerts and corrections into your code. The most common use of this function is to insert a call to the <strong><code>browser()<\/code><\/strong> function before a suspected break-point in the code. Let\u2019s observe the following code.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">set.seed(5656)\ntrace_test &lt;- function(x){\n  r &lt;- log(x)\n  if(r&gt;=10){\n    return(r)\n  } else{\n    return(2*r)\n  }\n}\nval &lt;- rnorm(50)\ntrace_test(val)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trace_test.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76063 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trace_test.png\" alt=\"trace_test() - debugging in r\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<p>As you can see, the <strong><code>rnorm()<\/code><\/strong> function, which generates random numbers have produced values that return non-numeric values when passed to the <strong><code>log()<\/code><\/strong> function. The function gives a warning about the <strong><code>NAN<\/code><\/strong> values and returns a <strong><code>NAN<\/code><\/strong> output.<\/p>\n<p>Here, using the <strong><code>debug()<\/code><\/strong> function would be very difficult, and a long process as the function makes a lot of calls. Instead, we can use the <strong><code>trace()<\/code><\/strong> function to insert a line that would pause the function when a <strong><code>NAN<\/code><\/strong> value is produced and enter debug mode.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">trace(trace_test,quote( if(any(is.nan(r))){browser()} ), at=3, print=F)<\/pre>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">trace_test(val)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trace.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76064 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trace.png\" alt=\"trace() - debugging in r\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h3>5. recover() Function<\/h3>\n<p>The <strong><code>recover()<\/code><\/strong> function shows you the state of the variables in the upper-level functions. We can use it as an <strong>error handler<\/strong>. It halts the execution at the point of failure and shows the environment of the program at that time. It is very similar to the <strong><code>browser()<\/code><\/strong> function in its working. The <strong><code>recover()<\/code><\/strong> function forces the IDE into the debug mode, and the program continues step-by-step. Using the <strong><code>recover()<\/code><\/strong> function, you can see the state of all the objects and variables after every statement is executed. The execution moves to the next step only when prompted.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">fun &lt;- function(x){\n  r &lt;- log(x)\n  recover()\n  if(r&gt;5){\n    r*(r+1)\n  }else{\n    r*r\n  }\n}\nfun(-10)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-recover.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76065 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-recover.png\" alt=\"recover() - debugging in r\" width=\"1299\" height=\"741\" \/><\/a><\/strong><\/p>\n<h3>try() and trycatch() Functions<\/h3>\n<p>The <strong><code>try()<\/code><\/strong> and the <strong><code>trycatch()<\/code><\/strong> functions are two functions provided in R that help with exception handling. We can encapsulate a block of code that we suspect to be faulty or error-prone inside the <strong><code>try()<\/code><\/strong> function. If the code block throws an error, the try block bypasses its execution, and the program continues. We use the <strong><code>trycatch()<\/code><\/strong> function to catch the failed execution of the <strong><code>try()<\/code><\/strong> function and give an appropriate response or warning to show the failed execution of the <strong><code>try()<\/code><\/strong> function block.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">trycatch_test &lt;- function(x){\n  tryCatch(\n      expr={\n        print(sqrt(x))\n      },\n      error=function(e){\n        print(e)\n      },\n      warning=function(w){\n        print(w)\n      }\n  )\n}\ntrycatch_test(-10)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trycatch.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76066 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/debugging-in-r-trycatch.png\" alt=\"trycatch() - debugging in r\" width=\"1299\" height=\"742\" \/><\/a><\/strong><\/p>\n<h3>Errors from Installed Packages<\/h3>\n<p>There are more than 15,000 packages on CRAN repository. Developers from all over the world submit hundreds of new packages every month. The CRAN repository has a checking process, but bugs still make it through them. As a result, the packages uploaded on the CRAN repository may also have bugs in them. You can either choose some alternative if such a problem occurs or try to debug them yourself. There are a few ways to debug R packages: Read the package\u2019s documentation, it may provide clues to why the error is occurring when it does and is it intentional for some reason. It may also tell you how to rectify it.<\/p>\n<ol>\n<li>By setting options(error=recover), the execution will stop when a function inside a package fails. Then you can go through the code to identify the bug.<\/li>\n<li>You can download the source code of the package and go through it to isolate, identify, and rectify the problem.<\/li>\n<li>You can also use the devtools package to make this process much easier for you.<\/li>\n<\/ol>\n<p>You can even <a href=\"https:\/\/techvidvan.com\/tutorials\/r-packages\/\"><strong>manage R packages<\/strong><\/a> if the problem continues.<\/p>\n<h2>Summary<\/h2>\n<p>Like any other programming language, bugs are an unfortunate certainty in R. By employing a systematic debugging approach, you can make the debugging process easier for you.<\/p>\n<p>In this <strong>TechVidvan<\/strong> tutorial, we looked at the tools and functions that help with the debugging process in R. We learned the recommended ways to approach a debugging issue. We studied the exception handling functions. Finally, we looked at the errors caused by the downloaded packages and how we can resolve those.<\/p>\n<p>Still, if you have any doubts related to debugging in R, feel free to share in the comment section below.<\/p>\n<p>If you like our work then do share our article with your friends as well.<\/p>\n<p>Keep learning!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It doesn&#8217;t matter how careful you are or how simple your logic is, bugs are always there to surprise you. Learn the process of debugging in R with few functions. In this article of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":76059,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1020],"tags":[1564,1565,1566,1567,1568,1569,1570,1571],"class_list":["post-76042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-debugging-in-r","tag-r-browser","tag-r-debug","tag-r-debug-process","tag-r-debugging-functions","tag-r-recovery","tag-r-trace","tag-try-functions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Debugging in R - How to Easily Overcome Errors in Your Code? - TechVidvan<\/title>\n<meta name=\"description\" content=\"There are few functions that help in the debugging process. In this article, learn a systematic debugging approach in R, you can make the debugging easier.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/r-debug\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging in R - How to Easily Overcome Errors in Your Code? - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"There are few functions that help in the debugging process. In this article, learn a systematic debugging approach in R, you can make the debugging easier.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/r-debug\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-31T06:18:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Debugging in R - How to Easily Overcome Errors in Your Code? - TechVidvan","description":"There are few functions that help in the debugging process. In this article, learn a systematic debugging approach in R, you can make the debugging easier.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/r-debug\/","og_locale":"en_US","og_type":"article","og_title":"Debugging in R - How to Easily Overcome Errors in Your Code? - TechVidvan","og_description":"There are few functions that help in the debugging process. In this article, learn a systematic debugging approach in R, you can make the debugging easier.","og_url":"https:\/\/techvidvan.com\/tutorials\/r-debug\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-01-31T06:18:12+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Debugging in R &#8211; How to Easily Overcome Errors in Your Code?","datePublished":"2020-01-31T06:18:12+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/"},"wordCount":1549,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg","keywords":["Debugging in R","R browser","R Debug","R debug process","R Debugging Functions","R recovery","R trace()","try() Functions"],"articleSection":["R Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/r-debug\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/","url":"https:\/\/techvidvan.com\/tutorials\/r-debug\/","name":"Debugging in R - How to Easily Overcome Errors in Your Code? - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg","datePublished":"2020-01-31T06:18:12+00:00","description":"There are few functions that help in the debugging process. In this article, learn a systematic debugging approach in R, you can make the debugging easier.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/r-debug\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/debugging-functions-in-r.jpg","width":802,"height":420,"caption":"debugging in r"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/r-debug\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Debugging in R &#8211; How to Easily Overcome Errors in Your Code?"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/76042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=76042"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/76042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/76059"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=76042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=76042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=76042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}