search for: nskip

Displaying 7 results from an estimated 7 matches for "nskip".

Did you mean: skip
2008 Sep 14
4
Fetching a range of columns
...g: x[x > 3 & x < 5] I can fetch all elements between 3 and 5. However I read in from a CSV file, and I would like to fetch all columns from within a range ( 842-2411). In teh past, I have done this to fetch just select few columns: data <- read.csv(filein, header=TRUE, nrows=320, skip=nskip) data_filter <- data[c(2,12,17)] write.table(data_filter, fileout, append = TRUE, sep= ",", row.names= FALSE, col.names = FALSE) nskip <- nskip+320 This time, however, instead of grabbing columns 2, 12, 17, I w...
2023 Mar 13
0
scan(..., skip=1e11): infinite loop; cannot interrupt
...=?10000; ?} as?in?current?R?devel?(r83976),?j goes negative (-1) and interrupt is checked every 10001 instead of 10000. I?prefer ?if?(!--j)?{ ?????R_CheckUserInterrupt(); ?????j?=?10000; ?} . In?current?R?devel?(r83976),?if?EOF?is?reached,?the?outer?loop?keeps?going,?i?keeps?incrementing?until?nskip. The?outer?loop?could?be?made?to?also?stop?on?EOF. Alternatively,?not?using?nested?loop?is?possible,?like?the?following. ?if?(nskip)?for?(R_xlen_t?i?=?0,?j?=?10000;?;?)?{?/*?MBCS-safe?*/ ?c?=?scanchar(FALSE,?&data); ?if?(!j--)?{ ?????R_CheckUserInterrupt(); ?????j?=?10000; ?} ?if?((c?==?'...
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
...@@ attribute_hidden SEXP do_scan(SEXP call, SEXP op, SEXP args, SEXP rho) { SEXP ans, file, sep, what, stripwhite, dec, quotes, comstr; - int c, flush, fill, blskip, multiline, escapes, skipNul; + int c = 0, flush, fill, blskip, multiline, escapes, skipNul; R_xlen_t nmax, nlines, nskip; const char *p, *encoding; RCNTXT cntxt; @@ -952,7 +952,7 @@ if(!data.con->canread) error(_("cannot read from this connection")); } - for (R_xlen_t i = 0; i < nskip; i++) /* MBCS-safe */ + for (R_xlen_t i = 0; i < nskip && c != R_EOF; i++) /* MBCS-saf...
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
Hello, All: I have a 4.54 GB file that I'm trying to read in chunks using "scan(..., skip=__)". It works as expected for small values of "skip" but goes into an infinite loop for "skip=1e11" and similar large values of skip: I cannot even interrupt it; I must kill R. Below please find sessionInfo() with a toy example. My real problem is a large
2009 Feb 21
0
density estimation for d>2 for the DPpackage
...# Prior information s2<-matrix(c(2,0,0,0,2,0,0,0,2),ncol=3) m2<-c(5,10,15) psiinv2<-solve(matrix(c(10000,0,0,0,1,0,0,0,2),ncol=3)) prior<-list(a0=1,b0=1/5,nu1=4,nu2=4,s2=s2, m2=m2,psiinv2=psiinv2,tau1=0.01,tau2=0.01) state <- NULL # MCMC parameters nburn<-1000 nsave<-5000 nskip<-10 ndisplay<-1000 mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,ndisplay=ndisplay) # Fit the model fit3<-DPdensity(y=rnormm,mcmc=mcmc, prior=prior, state=state,status=TRUE,na.action=na.omit) All is fine untill I bacame... MCMC scan 1000 of 5000 (CPU time: 32.125 s) MCMC scan 2000...
2009 Mar 31
1
error during DPpackage compilation
.../2+3) ? ? ? ? ? ? ? ? ? ? ? ? ? 2 Invalid declaration of or reference to symbol `nsave' at (2) [initially seen at (1)] LDDPdensity.f:12: ? ? ? ? & ? ? ? ? ? ? ? ? ? ? ? ?mcmc,nsave,seed, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 LDDPdensity.f:236: (continued): ? ? ? ? ?integer mcmc(3),nburn,nskip,nsave,ndisplay ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?2 Invalid declaration of or reference to symbol `nsave' at (2) [initially seen at (1)] LDDPdensity.f:9: ? ? ? ? & ? ? ? ? ? ? ? ? ? ? ? ?cpo,thetasave,randsave, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 LDDPdensity.f:291: (continued): ? ? ?...
2010 Apr 13
1
Binning Question
Hi, I'm trying to setup some complicated binning with statistics and could use a little help. I've found the bin2 function from the ash package, but it doesn't do everything I need. My intention is to copy some of their code and then modify as needed. I have a vector of two columns: head(data) r1 r2 [1,] 0.03516559 0.03102128 [2,] 0.02162539 0.14847034