Re: [R] Question on Variabeles

2009-03-08 Thread Uwe Ligges



David1234 wrote:

Hi everyone,

Im quite new to R an I have the following Question:


I would like to define Variables which I can add and multiply etc. and that
R can simplyfy the terms.

The variables should stand for integers. 
For example I would like to have an entry in an array with variable   z   
and if I  addb+zthe field should now contain 2z+b.  Or if the field

contains   1and I addzthe field should contain 1+z.

How can I solve this problem?

I tried to set z=integer and then for example matrix[1,1]=i
But this does only work if I assign a value for z first.

I am very grateful for any help.


Thank you very much!

David


R is not an algebra system but a system for numerical computations. You 
can write a function that represents (i.e. generates and returns) your 
matrix and uses its arguments to fill different elements of that matrix.


Best wishes,
Uwe

__
R-help@r-project.org 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] Question on Variabeles

2009-03-07 Thread David1234

Hi everyone,

Im quite new to R an I have the following Question:


I would like to define Variables which I can add and multiply etc. and that
R can simplyfy the terms.

The variables should stand for integers. 
For example I would like to have an entry in an array with variable   z   
and if I  addb+zthe field should now contain 2z+b.  Or if the field
contains   1and I addzthe field should contain 1+z.

How can I solve this problem?

I tried to set z=integer and then for example matrix[1,1]=i
But this does only work if I assign a value for z first.

I am very grateful for any help.


Thank you very much!

David
-- 
View this message in context: 
http://www.nabble.com/Question-on-Variabeles-tp22388117p22388117.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Question on Variabeles

2009-03-07 Thread David Winsemius
I fear that you are looking for a symbolic algebra system, and R is  
not that sort of platform. If I am correct and you still want to  
access a symbolic algebra system from R, then you should look at YACAS  
and the interface to it, Ryacas.


--
David Winsemius


On Mar 7, 2009, at 9:52 AM, David1234 wrote:



Hi everyone,

Im quite new to R an I have the following Question:


I would like to define Variables which I can add and multiply etc.  
and that

R can simplyfy the terms.

The variables should stand for integers.
For example I would like to have an entry in an array with  
variable   z
and if I  addb+zthe field should now contain 2z+b.  Or if  
the field

contains   1and I addzthe field should contain 1+z.

How can I solve this problem?

I tried to set z=integer and then for example matrix[1,1]=i
But this does only work if I assign a value for z first.

I am very grateful for any help.


Thank you very much!

David
--
View this message in context: 
http://www.nabble.com/Question-on-Variabeles-tp22388117p22388117.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org 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.