[R] Difference beetwen element in the same column

David Winsemius dwinsemius at comcast.net
Thu Jun 18 00:10:09 CEST 2009


On Jun 17, 2009, at 5:49 PM, Carletto Rossi wrote:

> my goal is to compute this variable
>
> tauw = 0.00095* velocity:0 (of the second row: 0.00367781) /  
> (0.0003035 - 0)

I'm sorry, you have exceeded your daily quota of homework help. Read  
some introductory material and come back after you know what a valid  
object name is in R, and when you do, bring with you a dataset that  
does not require extensive editing for input and has the same number  
of items in the headers as there are items per line.

>
> and
>
> tauw1 = 0.00095* velocity:0 (of the third row :  0.232017) /  
> (0.0003035 - 0)
>
> and put tauw e tauw1 in a new variable
>
>
>
> 2009/6/17 Carletto Rossi <nuovodna at gmail.com>
>
>> Hi, i have this file
>>
>> pressure,k,eps,zeta,f,velocity:0,velocity:1,velocity: 
>> 2,vtkValidPointMask,Point
>> Coordinates:0,Point Coordinates:1,Point Coordinates: 
>> 2,vtkOriginalIndices
>>
>> 0.150545,0.000575811,0.0231277,0.000339049 
>> ,-0.0193008,0.00318629,-6.24066e-07,5.39599e-05,^A,7,0,0,0
>>
>> 0.150546,0.000782719,0.0226157,0.000497957 
>> ,-0.0192084,0.00367781,5.09813e-06,5.90689e-05,^A, 
>> 7,0.0003035,0.000225,1
>>
>> 0.056182,0.00501745,0.022044,0.00919293 
>> ,-0.040201,0.232017,3.84469e-06,4.93005e-06,^A,7,3.0347,2.24977,9999
>>
>> 0.0561819,0.00475808,0.0218272,0.00853701 
>> ,-0.0412128,0.227424,3.23064e-07,4.8063e-06,^A,7,3.035,2.25,10000
>>
>>
>> I have to compute the difference beetwen the Second Element in Point
>> Coordinates:1 column and the First Element in Point Coordinates:1
>>
>> 0.0003035 - 0
>>
>> and the difference beetwen the Fourth Element in Point Coordinates: 
>> 1 column
>> and the Third Element in Point Coordinates:
>>
>> 3.035 - 3.0347
>>
>> and i'd like to put this two results in a new variable named y
>>
>> in what way i can do that?
>>
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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




More information about the R-help mailing list