From: Don Armstrong Date: Thu, 22 Mar 2012 23:13:33 +0000 (-0700) Subject: first draft of variables and objects X-Git-Url: https://git.donarmstrong.com/?p=don.git;a=commitdiff_plain;h=c59addd0181f96ee272c447a76d44f057f3c1d87 first draft of variables and objects --- diff --git a/r/learning_r/variables_and_objects.mdwn b/r/learning_r/variables_and_objects.mdwn index 8a32e92..202dd8b 100644 --- a/r/learning_r/variables_and_objects.mdwn +++ b/r/learning_r/variables_and_objects.mdwn @@ -1,21 +1,32 @@ [[!meta title="Learning R: Basic Variables and Objects"]] -Eventually here, you'll see some explanation of basic usage of -variables and objects in R. For the time being, there are just some -tests of my -[sweavealike](http://git.donarmstrong.com/?p=ikiwiki_plugins.git;a=blob;f=sweavealike.pm;hb=HEAD) -plugin for IkiWiki. +Variables and Objects +--------------------- +Like most computer languages, R uses variables as a means of storing +information in memory and retrieving it later. A variable + +In R, variables are more correctly called objects, because they have +structure and do not directly refer to a memory. + +Basic Types +---------- + +Vectors +======= + +A vector is the major data type used in R. You can think of it as a +line of cells, each containing a value of the same type. +[Type here means a number or a string.] + + +Lists +===== + + +Object Attributes +----------------- -[[!sweavealike echo=1 code=""" -a <- 1 -a <- a + 10 -print(a) -"""]] -[[!sweavealike fig=1 echo=1 results="hide" code=""" -plot(1:10,(1:10)^2,xlab="x",ylab="x^2",main="Example Figure") -"""]] -testing