The aim of The Book of R: A First Course in Programmingand Statistics is to provide a relatively gentle yet informative exposure to the statistical software environment R, alongside some common statistical analyses,so that readers may have a solid foundation fromwhich to eventually become experts in their own right. Learning to useand program in a computing language is much the same as learning a newspoken language. At the beginning, it is often difficult and may even bedaunting—but total immersion in and active use of the language is thebest and most effective way to become fluent.Many beginner-style texts that focus on R can generally be allocated toone of two categories: those concerned with computational aspects (that is,syntax and general programming tools) and those with statistical modelingand analysis in mind, often one particular type. In my experience, thesetexts are extremely well written and contain a wealth of useful informationbut better suit those individuals wanting to pursue fairly specific goals fromthe outset. This text seeks to combine the best of both worlds, by first focusing on only an appreciation and understanding of the language and its styleand subsequently using these skills to fully introduce, conduct, and interpret some common statistical practices. The target audience is, quite simply,anyone who wants to gain a foothold in R as a first computing language,perhaps with the ultimate goal of completing their own statistical analyses.This includes but is certainly not limited to undergraduates, postgraduates,academic researchers, and practitioners in the applied sciences with littleor no experience in programming or statistics in general. A basic understanding of elementary mathematical behavior (for example, the order ofoperations) and associated operators (for example, the summation symbolΣ) is desirable, however.In view of this, The Book of R can be used purely as a programming textto learn the language or as an introductory statistical methods book withaccompanying instruction in R. Though it is not intended to represent anexhaustive dictionary of the language, the aim is to provide readers with acomfortable learning tool that eliminates the kind of foreboding many havevoiced to me when they have considered learning R from scratch. The factremains that there are usually many different ways to go about any giventask—something that holds true for most so-called high-level computer languages. What this text presents reflects my own way of thinking about learning and programming in R, which I approach less as a computer scientistand more as an applied data analyst.In part, I aim to provide a precursor and supplement to the work in TheArt of R Programming: A Tour of Statistical Software Design, the other R text published by No Starch Press (2011), written by Professor Norman Matloff (University of California, Davis). In his detailed and well-received book, ProfessorMatloff comes at R from a computer science angle, that is, treating it as aprogramming language in its own right. As such, The Art of R Programmingprovides some of the best descriptions of R’s computational features I’veyet to come across (for example, running external code such as C from Rprograms, handling and manipulating R’s memory allocations, and formaldebugging strategies). Noteworthy, however, is the fact that some previousexperience and knowledge of programming in general goes a long way toappreciating some of these more advanced features. It is my hope that mytext will not only provide this experience but do so in R itself at a comfortable pace, with statistical analyses as the supplementary motivation.This text, which serves as a “traveler’s guide” as we backpack our waythrough R country, was born out of a three-day introductory R workshop Ibegan teaching at the University of Otago in New Zealand. The emphasisis on active use of the software, with each chapter containing a number ofcode examples and practice exercises to encourage interaction. For thosereaders not part of a workshop, just fire up your computer, grab a drink anda comfy chair, and start with Chapter 1.Tilman M. DaviesDunedin, New Zealand
# Search
curl -X POST "https://search.dria.co/hnsw/search" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"rerank": true, "top_n": 10, "contract_id": "k7ypc4779s-mDYzEv5t0VXFsfhLQ02AxMil_fxisz3E", "query": "What is alexanDRIA library?"}'
# Query
curl -X POST "https://search.dria.co/hnsw/query" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"vector": [0.123, 0.5236], "top_n": 10, "contract_id": "k7ypc4779s-mDYzEv5t0VXFsfhLQ02AxMil_fxisz3E", "level": 2}'