[R] Matrix in a Reverse order

2010-02-18 Thread Amelia Livington
Dear 'R' friends I have a sort of stupid question to ask. I have a matrix say of the order 4 X 3 as 83    98    90 21    83    84 70    39    56 65    29    38 Is there any command in R which will reverse the order i.e. I need to have same 4 X 3 matrix but as given below 65    29    38 70   

[R] how to read csv file having variables unequal column sizes

2010-02-12 Thread Amelia Livington
Dear R helpers   Suppose e.g. I have a csv file having three variables defined and each of these variables have data items of say 40, 50, 45 length. When I open this csv file in 'R', I get 10 trailing 'NA's under first column and 5 'NA' s in case of 3rd column.   How do I get rid of these NA's s

Re: [R] Readjusting the OUTPUT csv file

2010-02-10 Thread Amelia Livington
Dear Sir,   I really appreciate your suggestion. I was having the probelm of expressing my problem precisely. In fact in my earlier mail, I have tried to write my probelm in my initial few paras only. The rest content is my actual R code which I have written and its working fine except for the

[R] Readjusting the OUTPUT csv file

2010-02-09 Thread Amelia Livington
Dear R helpers   I have some variables say ABC, DEF, PQR, LMN and XYZ. I am choosing any three varaibles at random at a time for my analysis and name these files as input1.csv, input2.csv and input3.csv. So if I choose variables say ABC, DEF and PQR, I am passing the specifications of these vari

[R] How to change output 'csv' file

2010-02-03 Thread Amelia Livington
Dear R helpers   After executing the R code, where the last few lines of the code are something like given below.     ## Part of my R code     n = 20   .   final_output = data.frame(Numbers = numbers, ABC = data1, XYZ = data2, PQR = data3)   write.csv(data.frame(Scenario

[R] Mean, median and other moments

2009-12-23 Thread Amelia Livington
Hi! Suppose I have a dataset as follows pd = c(10,7,10,11,7,11,7,6,8,3,12,7,7,10,10) I wish to calculate the mean, standard deviation, median, skewness and kurtosis i.e. regular standard statistical measures. average = mean(pd) stdev    = sd(pd) median = median(pd) skew    = skewness(pd) kurt 

[R] Changing Column names in (Output) csv file

2009-12-15 Thread Amelia Livington
Dear R helpers   Following is a part of R code.   data_lab <- expand.grid(c("R11", "R12", "R13"), c("R21", "R22", "R23"), c("R31", "R32", "R33"), c("R41", "R42", "R43"), c("R51", "R52", "R53"), c("R61", "R62", "R63"), c("R71", "R72", "R73"), c("R81", "R82", "R83"),  c("R91", "R92", "R93"), c("R

[R] Combinations

2009-12-14 Thread Amelia Livington
Dear R helpers,   I am working on the scenario analysis pertaining to various interest rates. In this connection I need to form the various combinations as under :   Suppose I have two sets A = (a, b, c) and B = (x,y,z)   Then I can easily form the cominations as (ax, ay, az, bx, by, bz, cx, cy,

[R] Combinations and joint probabilities

2009-12-04 Thread Amelia Livington
  Dear R helpers   Suppose I have two sets of ranges (interest rates) as   Range 1 : (7 – 7.50, 7.50 – 8.50, 8.50 – 10.00) with respective probabilities 0.42, 0.22 and 0.36.     Range II : (11-12, 12-14, 14-21) with respective probabilities 0.14, 0.56 and 0.30 respectively.     My p