Tumgik
Text
Bye bye WordPress on CodingRaptor.com.
We are migrating to a different platform, so there will be some disruption in services for next couple of days.
Excited!
View On WordPress
0 notes
Text
Functions in R
There are two kinds of functions in R – inbuilt functions and user defined. R as a statistical package comes with a whole lot of common functions predefined.  These functions are typically the ones which are repeatedly used in the tasks of statistical programming.
Nevertheless, users can define and use their own functions. This can be particularly powerful if you want to use R as more than just…
View On WordPress
0 notes
Text
Factors in R
Factors in R are data structures for representing categorical variables i.e. data which can assume only finite number of distinct values. Although it is possible to store such data in any of the data structures that we have already covered, viz. vectors, matrices, arrays, lists and data frames, doing so will not take advantage of the fact that these variables can take only finite number of…
View On WordPress
0 notes
Text
Basic Data Structures V: Arrays in R
Basic Data Structures V: Arrays in R
What are Arrays in R?
Arrays in R are multidimensional (sometimes called n-d) data structures that hold members of a single data type.
From an implementation point of view, an array is a vector that has one or two additional attributes – dim and dimnames. Only dim attribute is mandatory for an array.
Another way of looking at arrays is to percieve them as a collection of matrices. You will find…
View On WordPress
0 notes
Text
Basic Data Structures IV: Lists in R
Basic Data Structures IV: Lists in R
What are Lists in R?
Lists in R are a collection of heterogeneous data types. Therefore, lists in R can contain elements of different types.
One way of viewing lists in R is to perceive them as vectors that don’t care (at least while adding elements) about the types of its members.
Yet another way of viewing lists in R is to think of them as a bag. A list is an assortment of Robjects. They may be…
View On WordPress
0 notes
Text
Basic Data Structures III: Data Frames in R
Basic Data Structures III: Data Frames in R
What are Data Frames in R?
Data Frames in R are a two dimensional data structure used to hold data of heterogeneous types in a table-like format.
A data frame comprises of rows and columns. Columns are the variables that you record in an experiment. Rows are the observation. More specifically, each row is an instance of an observation.
Another way of looking at data frame is to view it as a matrix
View On WordPress
0 notes
Text
Basic Data Structures II: Matrices in R
Basic Data Structures II: Matrices in R
What are Matrices in R?
Matrices in R are vectors in two dimensions. A matrix comprises of a rectangular layout of homogeneous data-type members arranged in rows and columns.  Most often you will find yourself dealing with matrix of numerics, though you can have a matrix of any R object.
For example, following is a matrix of numerics containing 2 rows and 3 columns –
[,1] [,2] [,3] [1,] 1 3 5…
View On WordPress
0 notes
Text
Basic Data Structures I: Vectors in R
Basic Data Structures I: Vectors in R
Vectors are the most frequently used data structures. Vectors in R are as fundamental as arrays in C and PHP, cons in Lisp, lists in Python, and classes in Java.
What are Vectors in R?
N.B. This article assumes that you have complete understanding of basic data types in R. If you don’t, read atomic data types in R, it shouldn’t take more than half an hour.
A vector is a linear collection of…
View On WordPress
0 notes
Text
Atomic or Basic Data Types and Scalars in R
Atomic or Basic Data Types and Scalars in R
There are six prominent basic data types in R, or data types of scalars.
R is a special programming language because it’s a special purpose programming language. R is designed and implemented bottom-up for staistical analysis. Since statistical analysis seldom (read never) occurs on a single observation of a variable, it makes little sense for R to have a sophisticated model for scalars.
A scalar…
View On WordPress
0 notes
Text
Getting Started with R: Packages, Help & Workspace (Part 2)
Getting Started with R: Packages, Help & Workspace (Part 2)
In the last article we learnt about downloading, installing and getting started with R. We will now learn about R packages, using the help system and managing your workspace.
Packages in R
The base R or the core R installation contains a plethora of functionality relating to common statistical analysis and visualization of data. These functions or commands are part of the core R platform and are…
View On WordPress
0 notes
Text
Getting Started with R: Installing and Running R (Part 1)
Getting Started with R: Installing and Running R (Part 1)
Congratulations for getting started with R!
If you are reading this sentence you have probably made up your mind to harness the power of R. This article prepares you for take-off in your flight with R, it provides a gentle introduction to R and how to go about setting it up on your computer. While we taxi on the runway doing preflight checks, you will also be introduced to some of the jargons of…
View On WordPress
0 notes
Text
Floating-Point in Java: Representation, Comparison, Equality & A Few Shockers
Floating-Point in Java: Representation, Comparison, Equality & A Few Shockers
Floating-point in Java, as in any other modern day programming language, is a complex subject. The versatility, power and the complexity of floating-point numbers is cloaked in innocent looking, simple digits. To harness the real power of floating-point numbers and to use them correctly in Java, it is essential to understand how they are represented internally in JVM and how they are so very…
View On WordPress
0 notes
Text
Java Ternary Operator a.k.a Conditional Operator
Java Ternary Operator a.k.a Conditional Operator
The conditional operator is very similar to the if/else or switch conditional statements and is the only operator in Java that takes three operands. Therefore, conditional operator is also known as ternary operator. This operator not only has three operands but can also be used in variety of ways to make the code more concise. So, we take a deeper than usual look on this operatorand present the…
View On WordPress
0 notes
Text
Arrays In JavaScript
Arrays in JavaScript
This article examines the most popular data structure in JavaScript – arrays. We have already examined arrays in Java in a great detail. This post was written as one of the readers asked a comparison of the most popular data structure viz. array in two of the most popular programming languages viz. Java & JavaScript.
What are arrays?
Arrays are one of the most versatile and…
View On WordPress
0 notes
Text
Coding Raptor Turns 1
Coding Raptor Turns 1
Today is the first birthday of Coding Raptor. The hatchling raptor is soon to be out of its diapers.
Truth cannot be wished away. I must admit that the performance of http://codingraptor.com has been below par in the last year. Fixing this issue is our top most priority.
Stay tuned.
Enjoy and love programming.
codingraptor dot com at gmail dot com
View On WordPress
0 notes
Text
Java EnumMap with Example
Java EnumMap with Example
Java EnumMap is a Java Map that uses keys of a single enum type. EnumMap utilizes the inherent associative nature of arrays and is therefore the most efficient implementation of Map.  In a nutshell, EnumMap is a one-trick-pony designed to be used when the keys of your Map are constants and therefore can be made static and final.
Constructors of EnumMap
Unlike EnumSetwhich is abstract, EnumMap is…
View On WordPress
0 notes
Text
LinkedHashMap Example: LRU Cache Implementation
LinkedHashMap Example: LRU Cache Implementation
LRU cache can be implemented fairly easily using LinkedHashMap. In this article we examine what is LRU cache and how to implement it in Java.
What is LRU Cache?
LRU cache stands for least-recently-used cache. Before we examine the LRU policy, let’s take a moment to see what a cache is.
What is a cache?
In computer science a cache is a limited storage facility where items are stored for faster…
View On WordPress
0 notes