Suresh_FSFM
2009-Feb-04 13:57 UTC
[R] How to declare an array with columns storing different datatypes/precision
Dear R- Experts, Seek your help. I want to creata data as follows. Ref_array with 4 columns. 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal point and 4 digits after decimal points) 2nd column: should store data of type date "yyyy-mm-dd hh:mm:ss" 3rd column: only integer value. No decimal points 4th column: percentage values Please help. Thank you in advance. Best Regards, Suresh -- View this message in context: http://www.nabble.com/How-to-declare-an-array-with-columns-storing-different-datatypes-precision-tp21830977p21830977.html Sent from the R help mailing list archive at Nabble.com.
Duncan Murdoch
2009-Feb-04 14:05 UTC
[R] How to declare an array with columns storing different datatypes/precision
On 2/4/2009 8:57 AM, Suresh_FSFM wrote:> Dear R- Experts, > Seek your help. > > I want to creata data as follows. > Ref_array with 4 columns. > 1st column should store data of precision: 8.4 (i.e. 8 digits before decimal > point and 4 digits after decimal points) > 2nd column: should store data of type date "yyyy-mm-dd hh:mm:ss" > 3rd column: only integer value. No decimal points > 4th column: percentage valuesIn R, an array is all one data type, so you can't do that. However, you can have a dataframe that comes close: but there is no special type for 8.4 or percentage values, you'd need to use floating point (or fancy handling of integers) for those. Duncan Murdoch
Apparently Analagous Threads
- How to create sequence of constant time interval
- help regarding storing time difference values in same unit?
- How to collect arrays in an array?
- How to print console output statements from within script or function?
- [PATCH] average: change to declare precision, not factor