{"id":40,"date":"2015-02-11T11:04:59","date_gmt":"2015-02-11T18:04:59","guid":{"rendered":"https:\/\/blogs.ubc.ca\/wtamagi\/?p=40"},"modified":"2015-02-12T23:37:44","modified_gmt":"2015-02-13T06:37:44","slug":"converting-scientific-notation-range-values-for-frequency-plots","status":"publish","type":"post","link":"https:\/\/blogs.ubc.ca\/wtamagi\/2015\/02\/11\/converting-scientific-notation-range-values-for-frequency-plots\/","title":{"rendered":"Converting scientific notation range values for frequency plots"},"content":{"rendered":"<p>Print Fixed Numeric Notation &#8211; To print values in fixed numeric notation instead of scientific notation use the command:<\/p>\n<p>options(scipen=999)\u00a0 # positive integer for scipen.\u00a0 negative for showing scientific notation.<\/p>\n<p>&nbsp;<\/p>\n<p>This example is for demonstrating the usage of the dig.lab parameter for setting the number of digits to display for the frequency ranges.\u00a0 Removing the dig.lab parameter will default the ranges listed in scientific notation.\u00a0 In this case the range numbers are set to 4 digits. e.g. [7000, 7300)<\/p>\n<p>A &lt;- read.csv(&#8220;Altitudes.csv&#8221;, header=FALSE, stringsAsFactors=FALSE)\u00a0 #import data<br \/>\nA\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #view A<br \/>\nAltitudes&lt;-A[[1]]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #extract Altitudes<br \/>\nrange(Altitudes)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #identify range of data;<br \/>\nbreaks=seq(7000,9100,by=300)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #break data into 7 classes with width = 300<br \/>\nbreaks\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #view breaks<br \/>\nA.cut&lt;- cut(Altitudes,breaks,right=&#8221;False&#8221;, <strong>dig.lab=4<\/strong>)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #assign observations to classes<br \/>\nA.cut<br \/>\nA.freq&lt;-table(A.cut)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #make frequency counts<br \/>\nA.freq\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #view frequency distribution<br \/>\ncbind(A.freq)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Print Fixed Numeric Notation &#8211; To print values in fixed numeric notation instead of scientific notation use the command: options(scipen=999)\u00a0 # positive integer for scipen.\u00a0 negative for showing scientific notation. &nbsp; This example is for demonstrating the usage of the dig.lab parameter for setting the number of digits to display for the frequency ranges.\u00a0 Removing [&hellip;]<\/p>\n","protected":false},"author":25150,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/users\/25150"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":3,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/posts\/40\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ubc.ca\/wtamagi\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}