Beispiel #1
0
  void R_load_XGAPheader(char **filename,int* num_rows,int* num_cols,int* isNumeric,int* pos){
  //  Rprintf("File to load: %s\n",filename[0]);
    rawfilestruct binfile;
    if(parsefile(filename[0],&binfile)){
      char *matrixname,*investigationname,*colname,*rowname;
      uint newpos,nrows,ncols;
      uint deciortext;
      newpos = getname(binfile,&matrixname,1);
      newpos = getname(binfile,&investigationname,newpos);
      newpos = getname(binfile,&colname,newpos);
      newpos = getname(binfile,&rowname,newpos);
      deciortext = isbinary(binfile,newpos);
    //  Rprintf("Matrix= %s\n",matrixname);
    //  Rprintf("Numeric= %i\n",deciortext);
      newpos++;
      ncols = getncols(binfile,newpos);
    //  Rprintf("Cols= %i\n",ncols);
      newpos = newpos+4;
      nrows = getnrows(binfile,newpos);
    //  Rprintf("Rows= %i\n",nrows);
      *num_rows = nrows;
      *num_cols = ncols;
      *isNumeric = deciortext;
      newpos = newpos+4;

      (*pos) = newpos;      
      freememory(binfile);
    }else{
      Rprintf("Error opening file: %s",filename[0]);
    }
  } //R_load_XGAPheader
Beispiel #2
0
EditPoints *newep(int gno, int setno)
{
    int i;
    EditPoints *ep;
    ep = (EditPoints *) malloc(sizeof(EditPoints));
    ep->gno = gno;
    ep->setno = setno;
    ep->ncols = getncols(gno, setno);
    ep->nrows = getsetlength(gno, setno);
    g[gno].p[setno].ep = ep;
    switch (dataset_type(gno, setno)) {
    case SET_XY:
	ep->collabels = labels1;
	break;
    case SET_XYDX:
	ep->collabels = labels2;
	break;
    case SET_XYDY:
	ep->collabels = labels3;
	break;
    case SET_XYDXDX:
	ep->collabels = labels4;
	break;
    case SET_XYDYDY:
	ep->collabels = labels5;
	break;
    case SET_XYDXDY:
	ep->collabels = labels6;
	break;
    case SET_XYZ:
	ep->collabels = labels7;
	break;
    case SET_XYHILO:
	ep->collabels = labels8;
	break;
    case SET_XYRT:
	ep->collabels = labels9;
	break;
    }
    for (i=0; i < MAX_SET_COLS; i++) {
		ep->cwidth[i] = widths[i];
		ep->cprec[i] = precision[i];
		ep->cformat[i] = format[i];
    }
    return ep;
}