search for: ndata

Displaying 20 results from an estimated 48 matches for "ndata".

Did you mean: data
2003 Mar 31
4
Convert char vector to numeric table
...() doesn't take a char vector as a file or connection argument. The following works but it seems like a lot of code: data <- sub(" +","",data) # remove leading blanks for strsplit data <- strsplit(data," +") # strsplit returns a list of char vectors ndata <- character(0) # vectorize the list of char vectors for (ii in 1:length(data)) ndata <- c(ndata,data[[ii]]) ndata <- as.numeric(ndata) dim(ndata) <- c(3,length(data)) data <- t(ndata) data.frame(A=data[,1],B=data[,2],C=data[,3]) Am I missing something? Thanks, Bruce L.
2013 Feb 22
3
Help xyplot
...h <- factor(month, levels = month.abb) data <- as.data.frame(expand.grid(lon=seq(4,5, 1), lat=seq(-3,-2,1), year=seq(2010, 2012,1), month=month)) n=nrow(data) data$prec <- rgamma(n, 2, 0.25) data$year <- factor(data$year) data$lon <- factor(data$lon) data$lat <- factor(data$lat) ndata <- data[order(data$lon, data$lat),] fix(ndata) max <- max(ndata$prec, na.rm=TRUE) min <- min(ndata$prec, na.rm=TRUE) #Plot the graph and save as pdf by Mackay suggestion pdf("H:/file.pdf") library(latticeExtra) useOuterStrips( xyplot(prec~month|year*paste(lat,lon), data=ndata, a...
2010 Jul 26
5
[RFC/PATCH] New chainloading functionality
This patch introduces extra functionality to chain.c, mainly with reference to BPB adjustments, but not only that. It expects 3 small patches I sent earlier (they are included for easy reference, patches 1-3/4). The changes introduced are: 1) file and boot sector use separate options to control load address and jump address (if applicable). Options are as described below: *
2010 Jul 24
0
[PATCH] chain.c: allocation fixes
...+ void *sect_area = NULL, *file_area = NULL; + struct part_entry *hand_area = NULL; + struct syslinux_rm_regs regs; char *drivename, *partition; int hd, drive, whichpart = 0; /* MBR by default */ @@ -1523,6 +1531,7 @@ int main(int argc, char *argv[]) goto bail; } data[ndata].base = load_base; + file_area = (void *)data[ndata].data; load_base = 0x7c00; /* If we also load a boot sector */ /* Create boot info table: needed when you want to chainload @@ -1701,7 +1710,9 @@ int main(int argc, char *argv[]) } else if (!(data[ndata].data = read_sectors(cur_part->lb...
2013 Feb 20
2
xyplot help
...tor(month, levels = month.abb) data <- as.data.frame(expand.grid(lon=seq(4,5, 1), lat=seq(-3,-2,1),           year=seq(2010, 2012,1), month=month)) n=nrow(data) data$prec <- rgamma(n, 2, 0.25) data$year <- factor(data$year) data$lon  <- factor(data$lon) data$lat  <- factor(data$lat) ndata <- data[order(data$lon, data$lat),] fix(ndata) max <- max(ndata$prec, na.rm=TRUE) min <- min(ndata$prec, na.rm=TRUE)   #Plot the graph and save as pdf pdf("H:/file.pdf")   xyplot(prec~month|year+lon+lat, data=ndata,    type = c("l", "l","p"), ylim=c...
2007 May 17
1
[PATCH] ocfs: use list_for_each_entry where benefical
...{ - item = list_entry(iter, struct dlm_work_item, list); + list_for_each_entry_safe(item, next, &tmp_list, list) { workfunc = item->func; list_del_init(&item->list); @@ -549,7 +547,6 @@ static int dlm_remaster_locks(struct dlm { int status = 0; struct dlm_reco_node_data *ndata; - struct list_head *iter; int all_nodes_done; int destroy = 0; int pass = 0; @@ -567,8 +564,7 @@ static int dlm_remaster_locks(struct dlm /* safe to access the node data list without a lock, since this * process is the only one to change the list */ - list_for_each(iter, &dlm->...
2001 May 09
1
Fortran subroutines dblepr, realpr, intpr
...;s going OK. To print from my Fortran programs, it seems I need subroutines dblepr, realpr and intpr. From the excellent "Writing R Extensions" document: "Three subroutines are provided to ease the output of information from FORTRAN code. subroutine dblepr(label, nchar, data, ndata) subroutine realpr(label, nchar, data, ndata) subroutine intpr (label, nchar, data, ndata)" Where can one find these subroutines? David -- David Firth Phone +44 1865 278544 Nuffield College Fax +44 1865 278621 Oxford OX1 1NF...
2001 Feb 28
2
Automating the job?
Hi! I just started to use R recently, and would like to ask a help about automating the job. I need to use "kmeans" function with my own 300 data files, and wonder if it's possible to do it automatically. For example, > library (mva) > mydata <- read.table ("data1") > cl <- kmeans(mydata, 5, 20) and I just need to save "cl" info (i.e. the center
2007 Feb 27
1
interactions and GAM
...prediction fit well data : summary(model) plot(data1$x2,data1$y) points(data1$x2,model$fitted.value,col="red",pch="+") #trying to see prediction: predict(model) #does work predict(model,newdata=data1) #produce NA #trying to replace NA in data1 by mean, to mimic na.gam.replace: Ndata=data1 Ndata$x2_1=ifelse(data1$x1=="1",data1$x2,mean(data1$x2_1,na.rm=TRUE)) Ndata$x2_2=ifelse(data1$x1=="2",data1$x2,mean(data1$x2_2,na.rm=TRUE)) Ndata$x2_3=ifelse(data1$x1=="3",data1$x2,mean(data1$x2_3,na.rm=TRUE)) predict(model,Ndata)-predict(model) #as you can see...
2012 Aug 13
0
rjags error. Error parsing model file:,syntax error on line 5 near ""
...s, I am running a factor analysis model in rjags and have received the following error Error parsing model file: syntax error on line 5 near "" Line 5 is model { Here is my syntax. Any insight would be greatly appreciated. require(rjags) modelstring = " model { for (i in 1 : nData) { for (j in 1 : nIndicators) { y[i,j] ~ dnorm(mu[i,j],psi[j]) ephat[i,j] <- y[i,j] - mu[i,j] } mu[i,1] <- alpha[1]+xi[i,1] # Factor 1 mu[i,2] <- alpha[2]+lam[2]*xi[i,1] mu[i,3] <- alpha[3]+lam[3]*xi[i,1] mu[i,4] <- alpha[4]+lam[4]*xi[i,1] mu[i,5] <- alp...
2007 Aug 22
1
"subscript out of bounds" Error in predict.naivebayes
...ving me the following message: # my data set has 1 response variable and 9318 independent variables Error in FUN(1:9319[[4L]], ...) : subscript out of bounds # Here's what traceback() returns 10: FUN(1:9319[[4L]], ...) 9: lapply(X, FUN, ...) 8: sapply(1:nattribs, function(v) { nd <- ndata[v] if (is.na(nd)) rep(1, length(object$apriori)) else { prob <- if (isnumeric[v]) { msd <- object$tables[[v]] dnorm(nd, msd[, 1], msd[, 2]) } else object$tables[[v]][, nd] prob[prob == 0] <-...
2007 May 18
1
partial correlation significance
...among the many (5) methods that I found in the list to do partial correlation in the following two that I had a look I am getting different t-values. Does anyone have any clues on why is that? The source code is below. Thanks. pcor3 <- function (x, test = T, p = 0.05) { nvar <- ncol(x) ndata <- nrow(x) conc <- solve(cor(x)) resid.sd <- 1/sqrt(diag(conc)) pcc <- -sweep(sweep(conc, 1, resid.sd, "*"), 2, resid.sd, "*") #colnames(pcc) <- rownames(pcc) <- colnames(x) if (test) { t.df <- ndata - nvar t <- pcc/sqrt((1 - pcc^2)/t.df...
2000 Feb 02
1
(not) compiling fortran -- dynamic loading problem
Hi, everyone. This may be properly a fortran question rather than an R question. I'm trying to add a few print statements to otherwise working fortran code in one of the libraries so I can see what's going on in the code. I have no problem doing so on an SGI machine, but under LinuxPPC I've run into a problem. The code compiles and creates a shared object (.so), but when I issue
2010 Aug 08
1
PATCH/RFC chain.c: update iterator code, yank from chain.c, move both to separate directory
1) code split and move Iterator related functionality is yanked from chain.c and moved to iterator.{c,h}. Both are moved to com32/chain and this way chain.c is ready for further splitting. Alternatively, partiter could be moved to com32/lib at any time in the future. It's potentially useful for other modules (e.g. if someone wanted to code partition dumper or editor). 2) Iterator updates
2010 Jun 30
1
(no subject)
...bout top-level partition, so we only need to change + * "part1" to the appropriate value: + * -1: whole drive (default) (-1 = 0xFF) * 0-3: primary partitions - * 4-*: logical partitions */ + * 4-*: logical partitions + */ ((uint8_t*) data[ndata].data)[0x20a] = (uint8_t)(whichpart - 1); + + /* + * Grub Legacy reserves 89 bytes (from 0x8217 to 0x826f) for the + * config filename. The filename passed via grubcfg= will overwrite + * the default config filename "/boot/grub/menu.lst". + */ + if (opt.grubcfg...
2005 Nov 04
1
problem in waveslim library?
...in factors){ sFac<-paste('d',factor,sep='') data[sFac]<-rep(0,length(data[sFac])) } return(data) } data.dwt<-dwt(data[[2]],n.levels=8) opar<-par(mfrow=c(4,2),mar=c(2,2,2,2)) mlist<-c(1:8) for(iFac in 1:8){ #flist<-mlist[mlist!=iFac] ndata<-setZeros(data.dwt,iFac) plot(idwt(ndata),type='l') }
2010 Dec 21
2
[PATCH] chain.c32: support chainloading GRUB2 core.img
...ion_string[5]; - /* 0x217: config filename */ + /* 0x217 - 0x26f: config filename */ char config_file[89]; - /* 0x270: start of code (after jump from 0x200) */ - char codestart[1]; - } __attribute__ ((packed)) *stage2; + } __attribute__ ((packed)) *grub_legacy_stage2; - if (data[ndata].size < sizeof(struct grub_stage2_patch_area)) { - error - ("The file specified by grub=<loader> is to small to be stage2 of GRUB Legacy.\n"); - goto bail; - } + /* Layout of GRUB2 core.img file (from byte 0x0 to 0x25c) */ + struct grub2_core_img_patch_area { +...
2017 Nov 22
3
Chan Local, Originate and slin
...n192) WriteFormat: slin ReadFormat: slin192 WriteTranscode: Yes (slin at 8000)->(slin at 192000) ReadTranscode: No When I do the same from a call file like: same => n,System(printf "Action: Originate\nActionID: 1\nChannel: Local/${number}@mycontext\nApplication: Confbridge\nData: ${confnum}\n" > /var/spool/asterisk/outgoing/${number}-${confnum}) the sound is perfect and this is what I see on the channel params: NativeFormats: (slin) WriteFormat: slin ReadFormat: slin WriteTranscode: No ReadTranscode: No Can anybody explain what is going on? -------...
2010 Jun 30
0
[PATCH] chain.c32: add grubcfg= for passing an alternative config
...bout top-level partition, so we only need to change + * "part1" to the appropriate value: + * -1: whole drive (default) (-1 = 0xFF) * 0-3: primary partitions - * 4-*: logical partitions */ + * 4-*: logical partitions + */ ((uint8_t*) data[ndata].data)[0x20a] = (uint8_t)(whichpart - 1); + + /* + * Grub Legacy reserves 89 bytes (from 0x8217 to 0x826f) for the + * config filename. The filename passed via grubcfg= will overwrite + * the default config filename "/boot/grub/menu.lst". + */ + if (opt.grubcfg...
2009 Aug 12
1
what is the difference between the two logistic models?
...1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 465.18 on 344 degrees of freedom Residual deviance: 438.91 on 340 degrees of freedom AIC: 448.91 Number of Fisher Scoring iterations: 4 > model2<-glm(Grade~ sex + age +teaching.method, family=binomial,data=ndata) > summary(model2) Call: glm(formula = Grade ~ sex + age +teaching.method, family = binomial, data = ndata) Deviance Residuals: Min 1Q Median 3Q Max -1.7959 -1.2122 0.7547 1.0043 1.5791 Coefficients: Estimate Std. Error z va...