03 December 2016

,

The best fundamentals about Storage area networks

#storage-area-networks-all-about-fundamentals
In today’s terms, the technical description of a SAN (Storage Area Network) is a collection of computers and storage devices, connected over a high-speed optical network and dedicated to the task of storing and protecting data. In a nutshell, you use a SAN to store and protect data. A SAN uses the SCSI (Small Computer Storage Interconnect) and FC (Fibre Channel) protocols to move data over a network and store it directly to disk drives in block format.

  • Today, that high-speed network usually consists of fiber-optic cables and switches that use light waves to transmit data with a connection protocol known as Fibre Channel. 
  • (A protocol is a set of rules used by the computer devices to define a common communication language.) More and more, regular Internet protocol (IP)–based corporate networks, and even the Internet, are being used as the network part of a SAN. 
  • IP networks that are already in place can be used by other storage connection protocols such as iSCSI (internet Small Computer Storage Interconnect) to move and store data.
  • Using a network to create a shared pool of storage devices is what makes a SAN different. A SAN moves data among various storage devices, allows sharing data between different servers, and provides a fast connection medium for backing up, restoring, archiving, and retrieving data. 
  • SAN devices are usually bunched closely in a single room, but they can also be connected over long distances, making a SAN very useful to large companies. Many of today’s SAN components are pretty much plug-and-play. To create a simple SAN, you just connect all the devices together with cables, and off you go. Creating larger SANs with many storage switches can become complex.

The complete list of R Data types and structures


#R-data-types:
#R-data-types:
To make the best of the R language, you'll need a strong understanding of the basic data types and data structures and how to operate on those. Very Important to understand because these are the things you will manipulate on a day-to-day basis in R. Everything in R is an object.

The basic data types 
  • logical (e.g., TRUE, FALSE)
  • integer (e.g,, 2L, as.integer(3))
  • numeric (real or decimal) (e.g, 2, 2.0, pi)
  • complex (e.g, 1 + 0i, 1 + 4i)
  • character (e.g, "a", "swc")
The basic data structures in R
  • vector
  • list
  • matrix
  • data frame
  • factors
  • tables
Vector in R
A vector is the most common and basic data structure in R and is pretty much the workhorse of R. 
Vectors can be of two types:
  • atomic vectors
  • lists

02 December 2016

,

The best 5 points that you can do with R

#5-key-points-in-r
#5-key-points-in-r:
As a R developer in data analytics you should know what all the key points you can do with R language. R is very prominent language it can be used very much in data science.

Vectors and assignment
R operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers. To set up a vector named x,say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R command
> x <- 21.7="" 3.1="" 5.6="" 6.4="" c="" p="">This is an assignment statement using the function c() which in this context can take an arbitrary number of vector arguments and whose value is a vector got by concatenating its arguments end to end.

Reading data from files
Large data objects will usually be read as values from external files rather than entered during an R session at the keyboard. R input facilities are simple and their requirements are fairly strict and even rather inflexible. There is a clear presumption by the designers of R that you will be able to modify your input files using other tools, such as file editors or Perl1 to fit in with the requirements of R. Generally this is very simple.
If variables are to be held mainly in data frames, as we strongly suggest they should be, an entire data frame can be read directly with the read.table() function. There is also a more primitive input function, scan(), that can be called directly. For more details on importing data into R and also exporting data, see the R Data Import/Export manual.

Accessing builtin datasets
Around 100 datasets are supplied with R (in package datasets), and others are available in packages (including the recommended packages supplied with R). To see the list of datasets currently available use data()
All the datasets supplied with R are available directly by name. However, many packages still use the obsolete convention in which data was also used to load datasets into R, for example data(infert) and this can still be used with the standard packages (as in this example). In most cases this will load an R object of the same name. However, in a few cases it loads several objects, so see the on-line help for the object to see what to expect.

Grouped expressions
R is an expression language in the sense that its only command type is a function or expression which returns a result. Even an assignment is an expression whose result is the value assigned,
and it may be used wherever any expression may be used; in particular multiple assignments are possible. Commands may be grouped together in braces, {expr_1; ...; expr_m}, in which case the value of the group is the result of the last expression in the group evaluated. Since such a group is also an expression it may, for example, be itself included in parentheses and used a part of an even larger expression, and so on

Writing your own functions
As we have seen informally along the way, the R language allows the user to create objects of mode function. These are true R functions that are stored in a special internal form and may be used in further expressions and so on. In the process, the language gains enormously in power,convenience and elegance, and learning to write useful functions is one of the main ways to make your use of R comfortable and productive. It should be emphasized that most of the functions supplied as part of the R system, such as mean(), var(), postscript() and so on, are themselves written in R and thus do not differ materially from user written functions.
A function is defined by an assignment of the form
> name <- ...="" arg_1="" arg_2="" expression="" function="" p="">The expression is an R expression, (usually a grouped expression), that uses the arguments,arg i, to calculate a value. The value of the expression is the value returned for the function. A call to the function then usually takes the form name(expr_1, expr_2, ...) and may occur anywhere a function call is legitimate.

01 December 2016

, ,

How to write R Script in simple way

#How-to-write-RScript:
#How-to-write-RScript:
A script is a good way to keep track of what you're doing. If you have a long analysis, and you want to be able to recreate it later, a good idea is to type it into a script. If you're working in the Windows R GUI (also in the Mac R GUI), there is even a built-in script editor. To get to it, pull down the File menu and choose New Script (New Document on a Mac). A window will open in which you can type your script. R Script is a series of commands that you can execute at one time and you can save lot of time. script is just a plain text file with R commands in it.
How to create R Script
  1. You can prepare a script in any text editor, such as vim, TextWrangler, or Notepad.
  2. You can also prepare a script in a word processor, like Word, Writer, TextEdit, or WordPad, PROVIDED you save the script in plain text (ascii) format.
  3. This should (!) append a ".txt" file extension to the file.
  4. Drop the script into your working directory, and then read it into R using the source() function.
  5. Just put the .txt file into your working directory
  6. Now that you've got it in your working directory one way or another, do this in R.
> source(file = "sample_script.txt") # Don't forget those quotes!
A note: This may not have worked. And the reason for that is, your script may not have had the name "sample_script.txt".
if you make sure the file has the correct name, R will read it. If the file is in your working directory, type dir() at the command prompt, and R will show you the full file name.
Also, R does not like spaces in script names, so don't put spaces in your script names! (In newer versions of R, this is no longer an issue.)
What is all about script you have written
Example:
# A comment: this is a sample script.
y=c(12,15,28,17,18)
x=c(22,39,50,25,18)
mean(y)
mean(x)
plot(x,y)
What happened to the mean of "y" and the mean of "x"?
The script has created the variables "x" and "y" in your workspace (and has erased any old objects you had by that name).
You can see them with the ls( ) function.
Executing a script does everything typing those commands in the Console would do, EXCEPT print things to the Console. Do this.
> x
[1] 22 39 50 25 18
> mean(x)
[1] 30.8
See? It's there. But if you want to be sure a script will print it to the Console, you should use the print() function.
> print(x)
[1] 22 39 50 25 18
> print(mean(x))
[1] 30.8
When you're working in the Console, the print() is understood (implicit) when you type a command or data object name. This is not necessarily so in a script.
  • Hit the Enter key after the last line. Now, in the editor window, pull down the Edit menu and choose Run All. (On a Mac, highlight all the lines of the script and choose Execute.) The script should execute in your R Console.
  • Pull down the File Menu and choose Save As... Give the file a nice name, like "script2.txt". R will NOT save it by default with a file extension, so be sure you give it one. (Note: On my Mac, the script editor in R will not let me save the script with a .txt extension. It insists that I use .R. Fine!) Close the editor window. Now, in the R Console, do this:
> source(file = "script2.txt") # or source(file = "script2.R") if that's how you saved it
The "aov.out" object was created in your workspace. However, nothing was echoed to your Console because you didn't tell it to print().
Go to File and choose New Script (New Document on a Mac). In the script editor, pull down File and choose Open Script... (Open Document... on a Mac). In the Open Script dialog that appears, change Files Of Type to all files (not necessary on a Mac). Then choose to open "script2.txt" (or "script2.R", whatever!). Edit it to look like this.
print(with(PlantGrowth, tapply(weight, group, mean)))
with(PlantGrowth, aov(weight ~ group)) -> aov.out
print(summary.aov(aov.out))
print(summary.lm(aov.out))
Pull down File and choose Save. Close the script editor window(s). And FINALLY...
> source(file = "script2.txt") # or source(file = "script2.R") if necessary
Finally, writing scripts is simple.