Exemple #1
0
SEXP viewportTransform(SEXP vp) {
    return VECTOR_ELT(vp, PVP_TRANS);
}
Exemple #2
0
const char* viewportFontFamily(SEXP vp) {
    return CHAR(STRING_ELT(VECTOR_ELT(VECTOR_ELT(vp, PVP_GPAR), GP_FONTFAMILY),
			   0));
}
Exemple #3
0
double viewportFontSize(SEXP vp) {
    return REAL(VECTOR_ELT(VECTOR_ELT(vp, PVP_GPAR), GP_FONTSIZE))[0];
}
Exemple #4
0
double viewportVJust(SEXP vp) {
    return REAL(VECTOR_ELT(vp, VP_VALIDJUST))[1];
}
Exemple #5
0
SEXP viewportLayoutPosCol(SEXP vp) {
    return VECTOR_ELT(vp, VP_VALIDLPOSCOL);
}
Exemple #6
0
double viewportXScaleMin(SEXP vp) {
    return numeric(VECTOR_ELT(vp, VP_XSCALE), 0);
}
Exemple #7
0
double viewportAngle(SEXP vp) {
    return numeric(VECTOR_ELT(vp, VP_ANGLE), 0);
}
Exemple #8
0
SEXP viewportClipRect(SEXP vp) {
    return VECTOR_ELT(vp, PVP_CLIPRECT);
}
Exemple #9
0
SEXP viewportParent(SEXP vp) {
    return VECTOR_ELT(vp, PVP_PARENT);
}
Exemple #10
0
SEXP viewportHeightCM(SEXP vp) {
    return VECTOR_ELT(vp, PVP_HEIGHTCM);
}
Exemple #11
0
SEXP viewportRotation(SEXP vp) {
    return VECTOR_ELT(vp, PVP_ROTATION);
}
Exemple #12
0
SEXP viewportWidthCM(SEXP vp) {
    return VECTOR_ELT(vp, PVP_WIDTHCM);
}
Exemple #13
0
SEXP viewportLayoutHeights(SEXP vp) {
    return VECTOR_ELT(vp, PVP_HEIGHTS);
}
Exemple #14
0
SEXP viewportLayoutWidths(SEXP vp) {
    return VECTOR_ELT(vp, PVP_WIDTHS);
}
Exemple #15
0
SEXP viewportHeight(SEXP vp) {
    return VECTOR_ELT(vp, VP_HEIGHT);
}
Exemple #16
0
SEXP viewportChildren(SEXP vp) {
    return VECTOR_ELT(vp, PVP_CHILDREN);
}
Exemple #17
0
Rboolean viewportClip(SEXP vp) {
    return LOGICAL(VECTOR_ELT(vp, VP_CLIP))[0];
}
Exemple #18
0
SEXP viewportDevWidthCM(SEXP vp) {
    return VECTOR_ELT(vp, PVP_DEVWIDTHCM);
}
Exemple #19
0
double viewportYScaleMax(SEXP vp) {
    return numeric(VECTOR_ELT(vp, VP_YSCALE), 1);
}
Exemple #20
0
SEXP viewportDevHeightCM(SEXP vp) {
    return VECTOR_ELT(vp, PVP_DEVHEIGHTCM);
}
Exemple #21
0
SEXP viewportLayout(SEXP vp) {
    return VECTOR_ELT(vp, VP_LAYOUT);
}
Exemple #22
0
SEXP viewportParentGPar(SEXP vp) {
    return VECTOR_ELT(vp, PVP_PARENTGPAR);
}
Exemple #23
0
SEXP viewportLayoutPosRow(SEXP vp) {
    return VECTOR_ELT(vp, VP_VALIDLPOSROW);
}
Exemple #24
0
/* Some access methods for viewports */
SEXP viewportX(SEXP vp) {
    return VECTOR_ELT(vp, VP_X);
}
Exemple #25
0
SEXP viewportgpar(SEXP vp) {
    return VECTOR_ELT(vp, PVP_GPAR);
}
Exemple #26
0
SEXP viewportY(SEXP vp) {
    return VECTOR_ELT(vp, VP_Y);
}
Exemple #27
0
int viewportFont(SEXP vp) {
    return INTEGER(VECTOR_ELT(VECTOR_ELT(vp, PVP_GPAR), GP_FONT))[0];
}
Exemple #28
0
SEXP viewportWidth(SEXP vp) {
    return VECTOR_ELT(vp, VP_WIDTH);
}
SEXP readChunkPorStream(SEXP porStream, SEXP what,
		       SEXP s_vars, SEXP s_ncases, SEXP s_types){
  porStreamBuf *b = get_porStreamBuf(porStream);
  PROTECT(s_vars = coerceVector(s_vars,LGLSXP));
  PROTECT(s_ncases = coerceVector(s_ncases,INTSXP));
  PROTECT(s_types = coerceVector(s_types,INTSXP));
  int nvar = length(s_types);
  int ncases = INTEGER(s_ncases)[0];
  int *types = INTEGER(s_types);
  // if(LENGTH(s_vars)!=nvar) error("\'s_vars\' argument has wrong length");

  int ii,i,j,k, m=0;
  for(j = 0; j < nvar; j++) m+=LOGICAL(s_vars)[j];

  SEXP x, y, data;
  char *charbuf;
  int charbuflen = 0;
  PROTECT(data = allocVector(VECSXP,m));
  k = 0;
  for(j = 0; j < nvar; j++){
    if(types[j] > charbuflen) charbuflen = types[j];
    if(LOGICAL(s_vars)[j]){
      if(types[j]==0)
        SET_VECTOR_ELT(data,k,allocVector(REALSXP,ncases));
      else {
        SET_VECTOR_ELT(data,k,allocVector(STRSXP,ncases));
        }
      k++;
    }
  }
  charbuf = R_alloc(charbuflen+1,sizeof(char));
  ii = 0;
  for(i = 0; i < ncases; i++){
    if(atEndPorStream(b) || (b->pos < 80 && b->buf[b->pos] == 'Z')){
      int new_length = ii;
      for(j = 0; j < m; j++){
        x = VECTOR_ELT(data,j);
        SET_VECTOR_ELT(data,j,lengthgets(x,new_length));
      }
      break;
    }
    k = 0;
    for(j = 0; j < nvar; j++){
      if(atEndPorStream(b)) {
	printPorStreamBuf(b);
	warning("\nPremature end of data");
      }
      if(types[j]==0){
	if(LOGICAL(s_vars)[j]){
	  REAL(VECTOR_ELT(data,k))[ii] = readDoublePorStream1(b);
	  k++;
	}
	else {
	  readDoublePorStream1(b);
	}
      }
      else {
	if(LOGICAL(s_vars)[j]){
	  SET_STRING_ELT(VECTOR_ELT(data,k), ii,
			 mkChar(readCHARPorStream(b,charbuf,types[j])));
	  k++;
	}
	else {
	  readCHARPorStream(b,charbuf,types[j]);
	}
      }
    }
    ii++;
  }
  k = 0;
  for(j = 0; j < nvar; j++){
    if(LOGICAL(s_vars)[j]){
      x = VECTOR_ELT(what,j);
      y = VECTOR_ELT(data,k);
      copyMostAttrib(x,y);
      k++;
    }
  }

  UNPROTECT(4);
  return data;
}
Exemple #30
0
double viewportCex(SEXP vp) {
    return numeric(VECTOR_ELT(VECTOR_ELT(vp, PVP_GPAR), GP_CEX), 0);
}