<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nistara</title>
    <link>/</link>
    <description>Recent content on Nistara</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>Nistara Randhawa</copyright>
    <lastBuildDate>Mon, 14 Nov 2022 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>About</title>
      <link>/about/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/about/</guid>
      <description>Hi, I&#39;m Nistara, an epidemiologist and data scientist working at the University of California, Davis. I bridge the worlds of animal, human, and environmental health; R programming; disease modeling; and visual story telling.  
 ul.special_bullet { list-style: none; text-indent:-20px; padding-left:15px; } ul.special_bullet li:before { color: #000; content: &#34;🎓 &#34;; }  Interests Wildlife health &amp; conservation Infectious disease epidemiology Animal movement Network analysis Infectious disease modeling GIS R programming Data science &amp; visualization     Education PhD - Epidemiology, UC Davis  MPVM - Preventive Veterinary Medicine, UC Davis MVSc - Veterinary Surgery &amp; Radiology, Himachal Pradesh Agricultural University BVSc - Veterinary Science, Himachal Pradesh Agricultural University      Skills and tools used R | Bash | QGIS | GRASS GIS | ArcGIS | Cloud computing (AWS) | SQL | Emacs</description>
    </item>
    
    <item>
      <title>About</title>
      <link>/extra/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/extra/</guid>
      <description>Research Publications Teaching Design   
x = function(z, y) { z + y return() }   
PREDICT With supporting text below as a natural lead-in to additional content. With supporting text below as a natural lead-in to additional content. With supporting text below as a natural lead-in to additional content. With supporting text below as a natural lead-in to additional content. Go somewhere    Special title treatment With supporting text below as a natural lead-in to additional content.</description>
    </item>
    
    <item>
      <title>Data Visualizations</title>
      <link>/data-viz/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/data-viz/</guid>
      <description>Examples of data visualizations made by me .card:hover { border: 1px solid #3E7DC0 !important; } .card { border: 0.2px solid #3E7DC0; background-color: #FFFAF0; border-color: #2569a8; } .btn { background-color: #F2DFE1; } code { white-space : pre-wrap !important; }  Tanzania bat tracking  Map showing tracks of multiple bats which also visually groups bats by the distance flown by them while keeping the map extent same within groups.</description>
    </item>
    
    <item>
      <title>Stills</title>
      <link>/photos/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/photos/</guid>
      <description>St. Pierre et Miquelon  div.gallery { display: flex; flex-wrap: wrap; } div.gallery a { flex-grow: 1; object-fit: cover; margin: 2px; display: flex; } div.gallery a img { height: 200px; object-fit: cover; flex-grow: 1; }                         Tanzania  div.gallery { display: flex; flex-wrap: wrap; } div.gallery a { flex-grow: 1; object-fit: cover; margin: 2px; display: flex; } div.</description>
    </item>
    
    <item>
      <title>Film</title>
      <link>/videos/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/videos/</guid>
      <description> Hummingbird Health &amp;amp; Conservation Bat tracking Global Health   
 
 
 
 
   </description>
    </item>
    
    <item>
      <title>scrap</title>
      <link>/scrap/</link>
      <pubDate>Sun, 20 Aug 2017 21:38:52 +0800</pubDate>
      
      <guid>/scrap/</guid>
      <description> Hummingbird Health &amp;amp; Conservation Bat tracking Global Health   
 
 
 
 
  Hummingbird Health &amp; Conservation  Bat tracking  Global Health              </description>
    </item>
    
    <item>
      <title>Insert screenshots into quarto or rmd files in emacs</title>
      <link>/post/2022-11-14-emacs-markdown-screenshots/</link>
      <pubDate>Mon, 14 Nov 2022 00:00:00 +0000</pubDate>
      
      <guid>/post/2022-11-14-emacs-markdown-screenshots/</guid>
      <description>Having used org-mode a lot before quarto came out, one handy thing I could do within it was insert screenshots easily with this answer I found on stackoverflow. I was writing my project notes in quarto the other day and really missed that functionality. So I tweaked the original elisp code a bit to make it work for quarto and markdown files (including Rmarkdown).
A demo of how it works: The function Edit your emacs init.</description>
    </item>
    
    <item>
      <title>Data visualization resources</title>
      <link>/post/data-viz-tools/</link>
      <pubDate>Wed, 24 Aug 2022 00:00:00 +0000</pubDate>
      
      <guid>/post/data-viz-tools/</guid>
      <description>-- 
A list of tools and resources I’ve found helpful and share with a data visualization class I teach every year.

Color palettes and pickers  Color brewer: Color picker for cartography (or even other visualizations). Chroma.js: for choosing balanced, linear colors. i want hue: choose colors for your categorical palette. Colorate: color scheme tool for designers and developers. Viridis color palette: For a nice color palette in R.</description>
    </item>
    
    <item>
      <title>Beds for COVID-19 Patients in New Delhi (2022)</title>
      <link>/post/delhi-covid-icu-beds-2022/</link>
      <pubDate>Thu, 20 Jan 2022 00:00:00 +0000</pubDate>
      
      <guid>/post/delhi-covid-icu-beds-2022/</guid>
      <description>Data scraped from: https://coronabeds.jantasamvad.org/index.html
Date accessed: 2022-01-21 08:10:53 IST | 2022-01-20 18:40:53 PDT
 Note on why it’s always helpful to visualise your data. There’s an error in the Delhi government’s coronabeds dashboard data. Galaxy Hospital in Delhi shows up in Varanasi, a different city altogether, due to an incorrect location link associated with this hospital. Mapping hospital locations (see below) makes it easy to spot this error.</description>
    </item>
    
    <item>
      <title>Available Beds for COVID-19 Patients in New Delhi</title>
      <link>/post/delhi-covid-icu-beds/</link>
      <pubDate>Mon, 19 Apr 2021 00:00:00 +0000</pubDate>
      
      <guid>/post/delhi-covid-icu-beds/</guid>
      <description>Data from: https://coronabeds.jantasamvad.org/index.html
Date accessed: 2021-04-29 06:37:54 IST | 2021-04-28 18:07:54 PDT
Number of available ICU beds for COVID-19 patients Number of available beds: 18/4809 beds
Blue: hospitals with available COVID ICU beds
Red: hospitals whose COVID ICU beds are completely occupied
Radius of circles correspond to number of ICU beds for COVID patients at each hospital.</description>
    </item>
    
    <item>
      <title>Hummingbird social distancing</title>
      <link>/post/hummer-distancing/</link>
      <pubDate>Mon, 20 Apr 2020 00:00:00 +0000</pubDate>
      
      <guid>/post/hummer-distancing/</guid>
      <description>If you’ve ever observed hummingbirds, you’ve seen that aggressive male chasing every other bird away from his floral (or feeder) kingdom. I made this cartoon from pictures of one such character who even confronted me a couple of times. There was one particularly close shave as he whizzed past me to bully another bird, when I felt I’d narrowly missed impalement by his sharp beak myself. Hyperbole aside, the other birds often managed to fool this guy and slipped in some nectar feeding on the sly.</description>
    </item>
    
    <item>
      <title>Choosing an AWS EC2 instance</title>
      <link>/post/aws-ec2/</link>
      <pubDate>Sun, 02 Feb 2020 00:00:00 +0000</pubDate>
      
      <guid>/post/aws-ec2/</guid>
      <description>AWS has been integral to my work lately, however, choosing which EC2 instance to launch always took me a bit of time. Being a student meant I had to be careful to select the most efficient instance for the lowest price possible. Being new to the subtleties of different instance types (general vs. compute vs. memory optimized, etc) meant I had to explore and find one that suited me.</description>
    </item>
    
    <item>
      <title>Fixing R package compiling issues on macOS</title>
      <link>/post/compile-issues-r/</link>
      <pubDate>Thu, 07 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/compile-issues-r/</guid>
      <description>EDIT [2022-10-09]: This post was originally written in 2019 and I recently had issues again after making updates to my OS and R. Deleting Makevars was what worked for me. See below for more details.
 Recent update After I upgraded my OS and also updated R, I got the following error when installing a package:
g++-8: error: /Library/Frameworks/R.framework/Resources/lib/libc++abi.1.dylib: No such file or directory I removed and reinstalled Xcode and it didn’t help.</description>
    </item>
    
    <item>
      <title>Conecting to an AWS instance via emacs/shell</title>
      <link>/post/emacs-aws/</link>
      <pubDate>Sat, 02 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>/post/emacs-aws/</guid>
      <description>Your setup so far Launch AWS instance Generate key pair (pem file) to securely connect to your instance  To ssh into your instance First, change the permissions of the .pem file so only the root user can read it:
chmod 400 /path/to/pem/file.pem  Then, ssh into the instance using your instance&amp;rsquo;s public DNS hostname
ssh -i /path/to/pem/file.pem ubuntu@ec2-n-nn-nnn-nnn.example.amazonaws.com  Use tramp Tramp helps me connect and work with the remote instance as if it were local.</description>
    </item>
    
    <item>
      <title>Emacs: send line or region to shell</title>
      <link>/post/emacs-send-line-or-region-to-shell/</link>
      <pubDate>Wed, 21 Feb 2018 00:00:00 +0000</pubDate>
      
      <guid>/post/emacs-send-line-or-region-to-shell/</guid>
      <description>While exploring GRASS GIS and writing scripts to run its commands, I realized it would be way more convenient to have a shortcut for sending lines to the shell for evaluation. This, instead of copy-pasting each sentence from the script to the shell buffer (ugh).
Thanks to this answer on Stackoverflow, I was able to do just that with a minor tweak.
(defun sh-send-line-or-region (&amp;amp;optional step) (interactive ()) (let ((proc (get-process &amp;quot;shell&amp;quot;)) pbuf min max command) (unless proc (let ((currbuff (current-buffer))) (shell) (switch-to-buffer currbuff) (setq proc (get-process &amp;quot;shell&amp;quot;)) )) (setq pbuff (process-buffer proc)) (if (use-region-p) (setq min (region-beginning) max (region-end)) (setq min (point-at-bol) max (point-at-eol))) (setq command (concat (buffer-substring min max) &amp;quot;\n&amp;quot;)) (with-current-buffer pbuff (goto-char (process-mark proc)) (insert command) (move-marker (process-mark proc) (point)) (setq comint-scroll-to-bottom-on-output t) ) (process-send-string proc command) (display-buffer (process-buffer proc) t) (when step (goto-char max) (next-line)) )) (defun sh-send-line-or-region-and-step () (interactive) (sh-send-line-or-region t))  And because I&amp;rsquo;ve set &amp;lt;s-return&amp;gt; to ess-eval-region-or-line-and-step, I set the same shortcut for sending commands to the shell for evaluation.</description>
    </item>
    
    <item>
      <title>Bat Diaries: A video preview</title>
      <link>/post/bat-diaries-preview/</link>
      <pubDate>Sun, 08 Oct 2017 00:00:00 +0000</pubDate>
      
      <guid>/post/bat-diaries-preview/</guid>
      <description>Cross-posted on The Health for Animals and Livelihood Improvement (HALI) Project
Before I launch into further detailed posts, I’m uploading a short video outlining the basic process of sampling/tagging the bats to give you a visual glimpse into our work.
In short, we catch the bats in mist nests before gently extricating them and bringing them to the workbench. We then note down their characteristics (weight, sex, body measurements, etc), after which they’re sampled, sedated, tagged, allowed to recover, and released.</description>
    </item>
    
    <item>
      <title>Bat Diaries: Locations</title>
      <link>/post/bat-diaries-map/</link>
      <pubDate>Thu, 14 Sep 2017 00:00:00 +0000</pubDate>
      
      <guid>/post/bat-diaries-map/</guid>
      <description>Cross-posted on The Health for Animals and Livelihood Improvement (HALI) Project
After a not so brief hiatus, I resume my posts with renewed determination. As much as I enjoy the other parts of my PhD research (which, at the moment, consists of writing up my first chapter after much coding and analysis yay), I started getting lost among the timelines and deadlines and the sometimes unrealistic goals I set for myself.</description>
    </item>
    
    <item>
      <title>Bat Diaries: Prologue</title>
      <link>/post/bat-diaries-1/</link>
      <pubDate>Mon, 01 May 2017 00:00:00 +0000</pubDate>
      
      <guid>/post/bat-diaries-1/</guid>
      <description>Cross-posted on The Health for Animals and Livelihood Improvement (HALI) Project
Slowly but surely, bit by bit, I’m going to invite you to make your your way through my field experience in Tanzania, wherein I teamed up with an amazing bunch of individuals to find out where the bats fly to.
Every evening come dusk (or a little before, truth be told), Eidolon helvum, also know as the straw-colored fruit bats, start swarming above their tree roosts like bees, imagine if you will, but bigger and spread higher and wider across the sky.</description>
    </item>
    
    <item>
      <title>Emacs and markdown preview</title>
      <link>/post/2016-07-21-emacs-marked/</link>
      <pubDate>Thu, 21 Jul 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/2016-07-21-emacs-marked/</guid>
      <description>App used: Marked 2
Reference: superuse.com
Code to include in .emacs file:
;; Getting emacs to use the &#39;Marked&#39; app (defun markdown-preview-file () &amp;quot;run Marked on the current file and revert the buffer&amp;quot; (interactive) (shell-command (format &amp;quot;open -a /Applications/Marked\\ 2.app %s&amp;quot; (shell-quote-argument (buffer-file-name)))) )  Create a key-binding to open emacs markdown file in Marked:
(eval-after-load &#39;markdown-mode &#39;(define-key markdown-mode-map (kbd &amp;quot;C-x p&amp;quot;) &#39;markdown-preview-file))  What&amp;rsquo;s cool is that as you write and save changes, they&amp;rsquo;re immediately updated in the Marked preview, with a dash at the most recent change</description>
    </item>
    
    <item>
      <title>Easier collaboration with R googlesheets package</title>
      <link>/post/google-sheets/</link>
      <pubDate>Sat, 16 Jul 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/google-sheets/</guid>
      <description>googlesheets is a really useful package developed by Jennifer Bryan, enabling users to connect to and work with google sheets through R. That’s pretty useful when you want to collaborate with others on the same document, among other things!
To get started:
# Install Google Sheets library devtools::install_github(&amp;quot;jennybc/googlesheets&amp;quot;) # Attach it to the session library(googlesheets) # Authorize user gs_auth(new_user = TRUE) ## To authorize your google account for use by googlesheets # List google sheets in your drive gs_ls() # Read in spread-sheet using shareable link (from File -&amp;gt; Share) bt = gs_url(&amp;quot;https://your/sheet&amp;#39;s/shareable/link&amp;quot;) bt # Open spread sheet in browser # gs_browse(bt) ## Opens sheet in browse # Read in sheet of your interest sh = gs_read(bt, ws = 2) # choosing sheet 2 # Convert to dataframe if you want/need df = as.</description>
    </item>
    
    <item>
      <title>Writing your own R package</title>
      <link>/post/writing-an-r-package/</link>
      <pubDate>Sun, 01 May 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/writing-an-r-package/</guid>
      <description>I made this post for an introduction to building and documenting your own R packages for the Davis R-users&amp;rsquo; group. It&amp;rsquo;ll get you started on making basic R packages, and once you get the flavor of what it&amp;rsquo;s all about, you can unleash your inner R genie to create your own tools!

The tools you&amp;rsquo;re going to need for this are:
 Git and github - Karl Broman has great, succinct instructions for getting started with both</description>
    </item>
    
    <item>
      <title>Hummingbird banding</title>
      <link>/post/2016-03-16-hummers/</link>
      <pubDate>Thu, 28 Apr 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/2016-03-16-hummers/</guid>
      <description>Last summer found me shadowing Dr. Lisa Tell, who runs the Hummingbird Health and Conservation program at UC Davis. The result is a video for the One Health Institute&amp;rsquo;s online publication, Evotis, showing you how they band these little marvels of nature!
The original post can be found at evotis.org
 </description>
    </item>
    
    <item>
      <title>Vignettes in R packages</title>
      <link>/post/2016-04-15-vignettes/</link>
      <pubDate>Fri, 15 Apr 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/2016-04-15-vignettes/</guid>
      <description>I find it very useful to go through vignettes provided by R packages, which help me figure out how to use their functions. For example, the package &amp;ldquo;dismo&amp;rdquo;, has a useful vignette named &amp;ldquo;sdm&amp;rdquo;, for species distribution modeling.
We use the functions vignette and edit to go about this.
For example,
# Vignettes within dismo package vignette(package = &amp;quot;dismo&amp;quot;) # Opening &amp;quot;sdm&amp;quot; vignette vignette(&amp;quot;sdm&amp;quot;, package = &amp;quot;dismo&amp;quot;) # Editing and going through the vignette code edit(vignette(&amp;quot;sdm&amp;quot;, package = &amp;quot;dismo&amp;quot;)) # or v = vignette(&amp;quot;sdm&amp;quot;, package = &amp;quot;dismo&amp;quot;) edit(v) # Viewing vignette print(v) # Listing vignettes from all attached packages vignette(all = FALSE) # Listing vignettes from all installed packages vignette(all = TRUE)  Thanks to this post from inside-R, which provided an excellent reference when I was searching how to do it.</description>
    </item>
    
    <item>
      <title>He who has health has hope...</title>
      <link>/post/2016-03-16-global-health-video/</link>
      <pubDate>Wed, 16 Mar 2016 00:00:00 +0000</pubDate>
      
      <guid>/post/2016-03-16-global-health-video/</guid>
      <description>I made a video for the 2104 UC Global Health Day Video Challenge, organized by the The UC Global Health Institute (UCGHI), whose mission is to “improve the lives of people in California and around the world”.
It was centered on my experiences at the COP15 climate change talks in Copenhagen, a pivotal point in my life because it stirred a deep yearning to utilize my science background while serving our planet.</description>
    </item>
    
  </channel>
</rss>