[R] Nested functions.

2007-08-28 Thread nalluri pratap
Hi All,
   
  I have two variables X, Y. The question is if the value of X is equal to 
one, then the values in Y have to be reversed other wise it should not perfom 
any action. I think this should be done using lapply function?
   
  Example
   
  Y values : 1 2 3  NA
  X  Y (ORIGINAL) Y (REVERSED)
  1 NA   1
  0   ---
  1   2 3
  1   1 4
  1   3 2
  ...
   
  Can anyone provide solution to this?
   
  Thanks,
  Pratap  
   

   
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Differentiation

2007-08-20 Thread nalluri pratap
try 
   
  library(numDeriv)
?genD
   
  Pratap
  
Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote:
  Hi,



Could anyone tell me what is the command used in R to do 

1. Differentiation
2. Newton Raphson method (Numerical Analysis in general...)



Are there any packages separately for this?



Thanks for your help!



BR, Shubha


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


   
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] combine 2 data frames with missing values

2007-08-16 Thread nalluri pratap
Hi All,
   
  I have 2 data frames as follows:
   
  abc
  1   NA  1
  2   NA  2
  NA  3   3
   
  So a, b are the input values and c is the output which I am interested 
in.
  NA - Missing values. I used rbind, but its not working.
   
  Let me know if anyone can help me
   
  Thanks,
  Pratap

   
-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] reading text file not table

2007-02-21 Thread nalluri pratap
Hi,
   
  You can read a CSV file using the following way
   
  MyData-read.csv(file.choose())
   
  Regards,
  Pratap

[EMAIL PROTECTED] wrote:
  On 17-Feb-07 H. Paul Benton wrote:
 Hello all,
 
 I'm looking for a way to be able to read a text file into R.
 It's a csv file but when I do
 txt -read.table(F00.csv, header=T, sep=,)
 It doesn't read the file properly, and I only get 2 columns.
 If I open it up in OOc or Excel it open right with 7 columns.
 What I would really like to do is read the file as text and
 then split it and read the bottom section where the 7 columns are.
 Then I would re-read the table with read.table.
 
 Thank you for any help,
 
 Paul

What's wrong with using read.csv? (Or have I misunderstood
your query?)

Ted.


E-Mail: (Ted Harding) 
Fax-to-email: +44 (0)870 094 0861
Date: 17-Feb-07 Time: 00:39:37
-- XFMail --

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



-
 Here’s a new way to find what you're looking for - Yahoo! Answers 
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Weighting Data

2007-01-04 Thread nalluri pratap
Hi All,
   
  Weighting is the procedure to correct the distributions in the sample data to 
approximate those of the population from which it is drawn. This is partly a 
matter of expansion and partly a matter of correction or adjustment for both 
non response and non coverage. It serves the purpose of providing data that 
look like the population rather than like the sample.
   
  The Questions is:
   
  Can anyone help me with an small example how to weight data in a survey on 
Gender,Age ( considering two variable) at a time. (in R)
   
  Gender
  2
2
1
2
2
   
  Age
  61
32
35
26
25
   
  Thanks and Regards,
  Pratap


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error in names-.default

2006-10-04 Thread nalluri pratap
Hi All,
   
  Can some one explain me the following error-
   
   Error in names-.default
  'names' attribute [1199] must be the same length as the vector [17].
   
  Thanks,
  Pratap


-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] convert vector to matrix

2006-10-04 Thread nalluri pratap
Hi All,
   
   
  I have vector containing 10 elements(odservations). I need to put this into a 
matrix, where the matrix should contain only one column.
I need this to be done using the cbind command because in the final table I 
should have a column of attributes( from adifferent vector) and a column of 
vectors from the matrix above

  Please suggest me how this can be done
   
  Thanks and Regards,
  Pratap



-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] creation of new variables

2006-09-26 Thread nalluri pratap
Hello All,
   
  I have 8 variables named 
   
   a b c d e f g h
   
  I need to create four variables from these 8 vraibles in R.
   
  the new variables are ab,cd,ef,gh.
   
  Can anyone pleas help me
   
  thanks,
  Pratap
   
   


-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Pooled Covariance Matrix

2006-09-21 Thread nalluri pratap
Hi,
   
  Can some one please explain me with an example what is 
   
  Symbolic Number Coding in R.
   
  Thanks and Regards,
  Pratap



-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.