Copydsfields: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Benjamin
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Copies informational fields between datasets and/or model structures.
Copies informational fields between datasets and/or model structures.
===Synopsis===
===Synopsis===
:to = copydsfields(from,to,''modes'',''block'')
:to = copydsfields(from,to,''modes'',''block'')
===Description===
===Description===
Copies all informational fields from one dataset to another, one model structure to another, or between datasets and models. This function copies the fields: label, class, classlookup, title, axisscale, and includ as well as the "<field>name" assosciated with each (e.g. classname). If copying to or from a model structure, the fields to be copied from/to are sub-fields of the detail field.
 
====INPUTS====
Copies all informational fields from one DataSet to another, one model structure to another, or between DataSets and model structures. This function copies the fields: label, class, classlookup, title, axisscale, and include as well as the "<field>name" assosciated with each (e.g., classname). If copying to or from a model structure, the fields to be copied from/to are sub-fields of the detail field.
* '''from''' = dataset or model from which fields should be copied, and
 
* '''to''' = dataset or model to which fields should be copied.
====Inputs====
====OPTIONAL INPUTS====
 
* '''modes''' = modes (dims) which should be copied {default: all modes}. (modes) can be a cell of {[from_modes] [to_modes]} to allow cross-mode copying.
'''from''' = DataSet or model structure from which fields should be copied.
* '''block''' =  data block of model from/to which information should be copied.
 
*  '''Default''': block 1. Can also be a cell of {[from_modes] [to_block]} to allow cross-block copying. This setting has noeffect with two DataSet objects.Output is: to, the updated dataset or model.
'''to''' = DataSet or model structure to which fields should be copied.
====OUTPUTS====
 
* '''to'''  =  the updated dataset or model.
====Optional Inputs====
 
'''modes''' = modes (dims) which should be copied {default: all modes}. (modes) can be a cell of {[from_modes] [to_modes]} to allow cross-mode copying.
 
'''block''' =  data block of model from/to which information should be copied {default = 1, i.e., block 1}. otions.block can also be a cell of {[from_modes] [to_block]} to allow cross-block copying. This setting has no effect with two DataSet objects.
 
'''append''' = a boolean {default: false}. When true, all sets will be appended to the first empty set location in the (to) object. When false, all sets will be copied over into the exact corresponding set number of the (to) object.
 
====Outputs====
 
'''to'''  =  the updated DataSet or model structure.
 
===Examples===
===Examples===
  mydataset2 = copydsfields(mydataset1, mydataset2);
  mydataset2 = copydsfields(mydataset1, mydataset2);
copies all fields for all modes of mydataset1 into mydataset2 (copies set 1 only).
 
copies all fields for all modes of (mydataset1) into (mydataset2) (copies set 1 only).
 
  mydataset2 = copydsfields(modl, mydataset2, {2 1});
  mydataset2 = copydsfields(modl, mydataset2, {2 1});
copies all fields from mode 2 (variables) of modl into mode 1 of mydataset2.
 
copies all fields from mode 2 (variables) of (modl) into (mode 1) of (mydataset2).
 
  modl = copydsfields(mydataset,modl,1,{1 2});
  modl = copydsfields(mydataset,modl,1,{1 2});
copies all fields for mode 1 (samples) from set 1 of mydataset into block 2 (e.g. y-block) of modl.
 
copies all fields for mode 1 / samples from set 1 of (mydataset) into block 2 (e.g. y-block) of the model structure (modl).
 
===See Also===
===See Also===
[[dataset/dataset]], [[modelstruct]], [[pca]], [[pcr]], [[pls]]
 
[[copycvfields]], [[dataset]], [[dataset_rmset | dataset/rmset]], [[modelstruct]], [[pca]], [[pcr]], [[pls]], [[splitds]]

Latest revision as of 10:25, 3 February 2017

Purpose

Copies informational fields between datasets and/or model structures.

Synopsis

to = copydsfields(from,to,modes,block)

Description

Copies all informational fields from one DataSet to another, one model structure to another, or between DataSets and model structures. This function copies the fields: label, class, classlookup, title, axisscale, and include as well as the "<field>name" assosciated with each (e.g., classname). If copying to or from a model structure, the fields to be copied from/to are sub-fields of the detail field.

Inputs

from = DataSet or model structure from which fields should be copied.

to = DataSet or model structure to which fields should be copied.

Optional Inputs

modes = modes (dims) which should be copied {default: all modes}. (modes) can be a cell of {[from_modes] [to_modes]} to allow cross-mode copying.

block = data block of model from/to which information should be copied {default = 1, i.e., block 1}. otions.block can also be a cell of {[from_modes] [to_block]} to allow cross-block copying. This setting has no effect with two DataSet objects.

append = a boolean {default: false}. When true, all sets will be appended to the first empty set location in the (to) object. When false, all sets will be copied over into the exact corresponding set number of the (to) object.

Outputs

to = the updated DataSet or model structure.

Examples

mydataset2 = copydsfields(mydataset1, mydataset2);

copies all fields for all modes of (mydataset1) into (mydataset2) (copies set 1 only).

mydataset2 = copydsfields(modl, mydataset2, {2 1});

copies all fields from mode 2 (variables) of (modl) into (mode 1) of (mydataset2).

modl = copydsfields(mydataset,modl,1,{1 2});

copies all fields for mode 1 / samples from set 1 of (mydataset) into block 2 (e.g. y-block) of the model structure (modl).

See Also

copycvfields, dataset, dataset/rmset, modelstruct, pca, pcr, pls, splitds