#include "SQDef.h"
#include "SQErrorCodes.h"
#include "SQProject.h"
#include "SQStringMatrix.h"
Go to the source code of this file.
|
SQ_ErrorCode | SQ_InitImport (const char *szProjectPath, const char *szTempDir, SQ_Import *pImport) |
|
SQ_ErrorCode | SQ_InitImportNoUsp (SQ_Import *pImport) |
|
SQ_ErrorCode | SQ_InitImportDataset (SQ_Project pProject, const char *szDatasetName, SQ_Import *pImport) |
|
SQ_ErrorCode | SQ_Reserve (SQ_Import pImport, int iNumObs, int iNumQuantitative, int iNumQualitative) |
|
SQ_ErrorCode | SQ_AddLocalCenteringData (SQ_Import pImport, int iCenterID, SQ_StringVector *pVariableNames, float fValue) |
|
SQ_ErrorCode | SQ_SetObservationNames (SQ_Import pImport, SQ_StringMatrix *pObservationIDs, int iPrimaryID) |
|
SQ_ErrorCode | SQ_SetMissingValueRepresentation (SQ_Import pImport, float fMissing) |
|
SQ_ErrorCode | SQ_SetMissingValueStringRepresentation (SQ_Import pImport, const char *szMisVal) |
|
SQ_ErrorCode | SQ_AddQuantitativeVariables (SQ_Import pImport, SQ_FloatMatrix *pData, SQ_StringMatrix *pVariableIDs, int iPrimaryID) |
|
SQ_ErrorCode | SQ_AddQualitativeVariables (SQ_Import pImport, SQ_StringMatrix *pData, SQ_StringMatrix *pVariableIDs, int iPrimaryID) |
|
SQ_ErrorCode | SQ_SetVariableIDSeriesNames (SQ_Import pImport, SQ_StringVector *szNames) |
|
SQ_ErrorCode | SQ_SetObservationIDSeriesNames (SQ_Import pImport, SQ_StringVector *szNames) |
|
SQ_ErrorCode | SQ_SetYColumns (SQ_Import pImport, SQ_IntVector *pYColumns) |
|
SQ_ErrorCode | SQ_SetDateTimeColumns (SQ_Import pImport, SQ_IntVector *pDateTimeColumns) |
|
SQ_ErrorCode | SQ_SetDataSetName (SQ_Import pImport, const char *szName) |
|
SQ_ErrorCode | SQ_FinishImport (SQ_Import *pImport, SQ_Project *pProject) |
|
SQ_ErrorCode | SQ_FinishImportDataset (SQ_Import *pImport, int *iDatasetNumber) |
|
SQ_ErrorCode | SQ_FinishImportMerge (SQ_Import *pImport, int iDatasetNumber) |
|
◆ SQ_Import
The import handle used to identify an ongoing import. IMPORTANT: Always initialize it to NULL!
◆ SQ_AddLocalCenteringData()
Add information on local centering. With local centering one models the variation of the variable, or part of variable with for instance classes, around the specified center. If the szCenterIDsetting or variable name don't match the one imported this call will be ignored.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | iCenterID | The observation ID index specifying the observations to center. |
[in] | pVariableNames | The name of the variables to center |
[in] | fValue | The value to subtract from the selected observation/variable combination. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_AddQualitativeVariables()
Add qualitative variables to the new dataset. Note: If this import is a merge or a secondary dataset with existing variables, the values for each variable can not be a value that did not already exist. I.e., you can not import new settings for a qualitative variable.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | pData | Matrix containing the qualitative variable values each row is an observation, and each column is a variable. |
[in] | pVariableIDs | Matrix containing the qualitative variable names names, each column is an variable, put secondary observation IDs in rows |
[in] | iPrimaryID | The index of the ID to use as primary variable ID. Every entry in the primary variable ID vector must be unique. If 0, primary ids will be auto generated. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_AddQuantitativeVariables()
Add quantitative variables to the new dataset.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | pData | Matrix containing the quantitative variable values each row is an observation, and each column is a variable. |
[in] | pVariableIDs | Matrix containing the quantitative variable names names, each column is an variable, put secondary variable IDs in rows. |
[in] | iPrimaryID | The index of the ID to use as primary variable ID. Every entry in the primary variable ID vector must be unique. If 0, primary ids will be auto generated. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_FinishImport()
Create a dataset of the variables and observations added. This function automatically releases the import handle created from SQ_InitImport().
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[out] | pProject | The handle to the new project. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_FinishImportDataset()
Create the new dataset of the variables and observations added. The import handle must come from SQ_InitImportDataset(), otherwise it will fail. This function automatically releases the import handle created from SQ_InitImportDataset().
- Parameters
-
[in] | pImport | Handle for the import of the new dataset. |
[out] | iDatasetNumber | The number of the new dataset. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_FinishImportMerge()
Merge the imported data into an existing dataset. No new variables may exist in the import that does not exist in the existing dataset. All created models for the specified dataset will be deleted. The import handle must come from SQ_InitImportDataset(), otherwise it will fail. This function automatically releases the import handle created from SQ_InitImportDataset().
- Parameters
-
[in] | pImport | Handle for the import of the new dataset. |
[in] | iDatasetNumber | The dataset number to merge to. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_InitImport()
Prepare import of data to a new project. It is the users responsibility to close the import when finished (SQ_FinishImport).
- Parameters
-
[in] | szProjectPath | The path, including the project name and for the project, UTF-8 encoded. |
[in] | szTempDir | The directory where temporary files should be saved and where the project should recover from, UTF-8 encoded. Recovering is disabled if szTempDir = NULL. |
[out] | pImport | The handle to this import. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_InitImportDataset()
Prepare import of a new dataset to an existing project. It is the users responsibility to close the project when finished (SQ_CloseImport).
- Parameters
-
[in] | pProject | The project to import the new dataset to. |
[in] | szDatasetName | The name of the new dataset, UTF-8 encoded. |
[out] | pImport | The handle to this import. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_InitImportNoUsp()
Prepare import of data to a new project, the new project will not be saved on disk but kept in memory. To save the project to disk when it has been created call SQ_SaveAs. It is the users responsibility to close the import when finished (SQ_FinishImport).
- Parameters
-
[out] | pImport | The handle to this import. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_Reserve()
Reserve space for the import, this will make the import faster if you call AddQuantitativeVariables or AddQualitativeVariables more than once.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | iNumObs | The total number of observations. |
[in] | iNumQuantitative | The total number of quantitative variables. |
[in] | iNumQualitative | The total number of qualitative variables. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetDataSetName()
Set the name of the new dataset.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | szName | The name of the new dataset, UTF-8 encoded. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetDateTimeColumns()
Specify the column in the matrix that is date/time
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | pDateTimeColumns | The indices of the date/time columns. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetMissingValueRepresentation()
Set a value that the import will treat as a missing value for quantitative variables.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | fMissing | The missing value representation. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetMissingValueStringRepresentation()
Set a value that the import will treat as a missing value for qualitative variables.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | szMisVal | The missing value representation, UTF-8 encoded. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetObservationIDSeriesNames()
Name the secondary IDs, the primary ID is always called PrimaryID and can't be renamed call this function only after SetObservationNames.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | szNames | The names of the Observation id series. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetObservationNames()
Set the observation names in the new dataset.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | pObservationIDs | Matrix containing the observation names, each row is an observation. Put secondary observation IDs in columns. |
[in] | iPrimaryID | The index of the ID to use as primary observation ID. Every entry in the primary observation ID vector must be unique. if 0, primary ids will be auto generated. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetVariableIDSeriesNames()
Name the secondary IDs, the primary ID is always called PrimaryID and can't be renamed call this function only after Variables are added.
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | szNames | The names of the variable id series. |
- Returns
- Returns SQ_E_OK if success or an error code.
◆ SQ_SetYColumns()
Set the index of the Y columns. Call this only after adding every time column
- Parameters
-
[in] | pImport | Handle for the import of the new project. |
[in] | pYColumns | The indexes of the Y columns in the data. |
- Returns
- Returns SQ_E_OK if success or an error code.