search for: newd

Displaying 20 results from an estimated 30 matches for "newd".

Did you mean: new
2009 Jul 09
2
r bug (?) display of data
Hi R Fans, I stumbled across a strange (I think) bug in R 2.9.1. I have read in a data file with 5934 rows and 9 columns with the commands: daten = data.frame(read.table("C:/fussball.dat",header=TRUE)) Then I needed a subset of the data file: newd = daten[daten[,1]!=daten[,2],] --> two values do not meet the logical specification and are dropped. The strange thing about it: When I print the newd in the R Console, the output still shows 5934 rows. When I check the number of rows with NROW(newd) , I get 5932 as output. When I print newd...
2009 Mar 06
0
[PATCH 2/3] COM32 API: restructure DIR
...2/lib/readdir.c +++ b/com32/lib/readdir.c @@ -33,21 +33,16 @@ struct dirent *readdir(DIR *dir) /* Don't do this as we won't be able to rewind. dir->dd_fd = regs.esi.w[0]; /* Shouldn't be needed? */ if ((!(regs.eflags.l & EFLAGS_CF)) && (regs.esi.w[0] != 0)) { - newde = calloc(1, sizeof(newde)); - if (newde != NULL) { - strcpy(newde->d_name, __com32.cs_bounce); - newde->d_mode = regs.edx.w[0]; - newde->d_type = (newde->d_mode & S_IFMT) >> 12; - newde->d_size = regs.eax.l; - newde->d_ino = regs.ebx.l; - dir->dd_...
2012 Jul 12
2
nls question
...), weightData,               start = c(alpha = 0.0, beta = 1, gamma = 0.2), trace = TRUE)   ### I get the error below: Error in nls(weight ~ alpha + beta * exp(gamma * week), weightData, start = c(alpha = 0,  :   number of iterations exceeded maximum of 50 M_model ### predict for another 2 weeks newD <- data.frame(week = 1:52);newD newD$pred_wt <- predict(M_model, newD) newD plot(pred_wt ~ week, newD, pch = 4, col = "red", ylab = "Weight", xlab = "Week") with(weightData, points(week, weight,col='blue')) Felipe D. Carrillo Supervisory Fishery Biologi...
2012 Aug 29
1
Help on not matching object lengths
...sual, this is what it supposed to look like where d1,d2,d3 and so on up to d1000 are calculated using the equation and the respective a and b values: Code #2 d1 <-runif(33,10,20) d2 <-runif(33,15,20) d3 <-runif(33,18,20) e <-cbind(a,b,d1,d2,d3)   Next, I would like to generate 33 x 1000 newd values again using newa and newb values and the same c values, eg: Code #3 newa <-matrix(seq(16,24, by = sign(24-16)*0.25)) newb <-matrix(seq(24,36, by = sign(36-24)*0.25)) c <-runif(1000,50,60) newd <-exp(-c*newa)+exp(-c*newb)   Next I would like to sum d(ith) and newd(ith) according t...
2023 Nov 30
1
back tick names with predict function
...p://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. Hello, When creating the new data df, the default check.names = TRUE changes the column name, it is repaired and the hyphen is replaced by a legal dot. # check.names defaults to TRUE newd <- data.frame(`plant-density` = x) # `plant-density` is not a column name head(newd) # check.names set to FALSE newd <- data.frame(`plant-density` = x, check.names = FALSE) # `plant-density` is becomes a column name head(newd) # Use predict to get CIs for a plot # Add CI for regression lin...
2007 Feb 13
1
Missing variable in new dataframe for prediction
...g) y <- f + e Mydata<-data.frame(y=y,x0=x0,x1=x1,x2=x2,x3=x3) remove(list=c("y","x0","x1","x2","x3")) # Note below the syntax of the 3rd variable required for my loop for (i in 4:5){ b<-gam(y~s(x0)+ s(x1)+ ns(Mydata[,i], 3), data=Mydata) newd <- data.frame(x0=(0:399)/30,x1=(0:399)/30,x2=(0:399)/30,x3=(0:399)/30) pred <- predict.gam(b,newd) } Erreur dans model.frame(formula, rownames, variables, varnames, extras, extranames, : type (list) incorrect pour la variable 'Mydata' De plus : Warning message: not all requi...
2009 Feb 11
1
[PATCH 1/1] COM32 API: Add functions for directory use
.../com32/lib/opendir.c @@ -0,0 +1,41 @@ +/* + * opendir.c + */ + +#include <dirent.h> +#include <stdio.h> +#include <errno.h> + +#include <com32.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + + +DIR *opendir(const char *pathname) +{ + DIR *newdir; + com32sys_t regs; + + newdir = NULL; + + strlcpy(__com32.cs_bounce, pathname, __com32.cs_bounce_size); + + regs.eax.w[0] = 0x0020; + regs.esi.w[0] = OFFS(__com32.cs_bounce); + regs.es = SEG(__com32.cs_bounce); + + __com32.cs_intcall(0x22, &regs, &regs); + + if (!(regs.eflags.l & EFL...
2008 Dec 04
0
[PATCH 1/1] COM32: Add directory functions
.../com32/lib/opendir.c @@ -0,0 +1,41 @@ +/* + * opendir.c + */ + +#include <dirent.h> +#include <stdio.h> +#include <errno.h> + +#include <com32.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + + +DIR *opendir(const char *pathname) +{ + DIR *newdir; + com32sys_t regs; + + newdir = NULL; + + strlcpy(__com32.cs_bounce, pathname, __com32.cs_bounce_size); + + regs.eax.w[0] = 0x001F; + regs.esi.w[0] = OFFS(__com32.cs_bounce); + regs.es = SEG(__com32.cs_bounce); + + __com32.cs_intcall(0x22, &regs, &regs); + + if (!(regs.eflags.l & EFL...
2011 Apr 09
1
loop and sapply problem, help need
...gh sampling pvec <- c("PR1", "PR2", "PR3", "PR4", "PR5", "PR6", "PR7", "PR8", "PR9", "PR10") fun11 <- function(x){ smpool <- c(1,2,3,3) x <- sample(smpool, 10, replace= TRUE) } newd <- sapply (pvec, fun11) # function to recode this new generated data fun3 <- function(x) { (if ( x ==1){ x = lcd1 }else if (x ==2){ x = lcd2 } else if ( x ==3 ){ x = lcd3 } else x = NA ) return(x) } Applying the f...
2013 Dec 08
2
How to evaluate sequence of strings like this
...ata set (dataframe) called "mydat". It consist of 3 numerical variable.  They are Centrecode, FSUSN and Round. I want to create unique ID by combining these 3 variables. Follwing commands gives me what I need. mydat1 <- paste(mydat$Centrecode, mydat$FSUSN,mydat$Round,sep="") newds <- data.frame(mydat1)    For a large data set, I don't want to write like this ...    "mydat$Centrecode, mydat$FSUSN,mydat$Round". So,  I tried to automate using following code.   nvar <- paste("mydat","$",names(mydat)[1:3],sep="") mydat1 <- pas...
2011 Mar 20
4
predicting values from multiple regression
Hey List, I did a multiple regression and my final model looks as follows: model9<-lm(calP ~ nsP + I(st^2) + distPr + I(distPr^2)) Now I tried to predict the values for calP from this model using the following function: xv<-seq(0,89,by=1) yv<-predict(model9,list(distPr=xv,st=xv,nsP=xv)) The predicted values are however strange. Now I do not know weather just the model does not fit
2023 Nov 30
1
back tick names with predict function
I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.? I'm trying too construct some nice vectors that can be used for plotting the two types of regression intervals.? I think it works with normal column heading names but it fails when I have "special" back-tick names.? Can anyone help with how I would reference these?? Short of
2007 Feb 23
2
Extracting a subset from a dataframe
...02-19:15:00 20.1 15 97 2005-02-20:18:00 16.5 95 95 2005-03-03:18:00 10.3 95 95 2005-03-04:00:00 13.4 13 95 2005-10-22:15:00 11.3 13 95 2005-10-25:15:00 10.3 2 2 I want to create another dataframe made up of the values of dataframe1 which are not common with dataframe2, ie. newD = D1 - (D1 intersection D2) that is, newD: dates ws wc pwc 2005-10-19:12:00 10.8 80 81 2005-10-20:12:00 12.3 5 15 2005-10-21:15:00 12.3 3 15 2005-10-23:12:00 12.3 13 2 2005-10-24:15:00 10.3 2 95 Thanks for any help you can provide, Augusto ------------...
2017 Jun 12
0
plotting gamm results in lattice
...;smooth", lty=2, col="red") panel.xyplot(x[order(x)], lower[subscripts][order(x)], type = "smooth", lty=2, col="red") #panel.loess(x,y,...) #panel.rug(x = x[is.na(y)], y = y[is.na(x)]) } ) # by newdata = ... # take a cross-section of data - reduces the amount of data to be plotted mx = aggregate(Q95 ~ super.end.group, spring, max, na.rm=T) newlst <- do.call(rbind, lapply(1:6, function(j) expand.grid(Q95 = seq(0,mx[j,2], length = 50), super.end.group = LETTERS[j])...
2017 Jun 12
2
plotting gamm results in lattice
Dear all,? I hope that you can help me on this. I have been struggling to figure this out but I haven't found any solution. I am running a generalised mixed effect model, gamm4, for an ecology project. Below is the code for the model: model<-gamm4(LIFE.OE_spring~s(Q95, by=super.end.group)+Year+Hms_Rsctned+Hms_Poaching+X.broadleaved_woodland? ? ? ? ? ? ?+X.urban.suburban+X.CapWks,
2013 Apr 01
2
example to demonstrate benefits of poly in regression?
Here's my little discussion example for a quadratic regression: http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R Students press me to know the benefits of poly() over the more obvious regression formulas. I think I understand the theory on why poly() should be more numerically stable, but I'm having trouble writing down an example that proves the benefit of this. I
2002 Jul 26
0
predict() still not yet "safe".. (PR#1840)
...it. [R version 1.5.1 and at least 1.4.1, probably all versions at all:] For these, R 1.5.x does not differ from 1.4.1 : Inspite of R 1.5.0's "NEWS" entry and the ?Safepredict help page, predict() doesn't (always?) work correctly for (some cases of) predict(lm(y ~ poly(....)), newdata = .....) or predict(lm(y ~ ns(....)), newdata = .....) Here is a simple (longer than necessary) example #### This modified from the last part of example(cars) {of R 1.5.1}: data(cars) ## An example of polynomial regression ## -- to show the bug, the linear example is sufficient cars.1...
2003 Jun 03
3
gam questions
Dear all, I'm a fairly new R user having two questions regarding gam: 1. The prediction example on p. 38 in the mgcv manual. In order to get predictions based on the original data set, by leaving out the 'newdata' argument ("newd" in the example), I get an error message "Warning message: the condition has length > 1 and only the first element will be used in: if (object$dim == 0) m <- 0 else m <- length(object$sp)" I suspected that it had somthing to do with the data...
2017 Nov 21
2
help
I am working on Johansen cointegration test, using urca and var package. in the selection of var, I have got following results. >VARselect(newd, lag.max = 10,type = "none") $selection AIC(n) HQ(n) SC(n) FPE(n) 6 6 6 5 $criteria 1 2 3 4 5 6 7 8 9 AIC(n) -3.818646e+01 -3.864064e+01 -3.833435e+01 -4.089169e+01 NaN -Inf -Inf -Inf -Inf HQ(n)...
2012 Mar 19
1
glm: getting the confidence interval for an Odds Ratio, when using predict()
...obtain the difference in the predicted logodds using the predict() function, and thus get a point-estimate OR. But I can't see how to obtain the confidence interval for such an OR. For example: model <- glm(chd ~age.cat + male + lowed, family=binomial(logit)) pred1 <- predict(model, newdata=data.frame(age.cat=1,male=1,lowed=1)) pred2 <- predict(model, newdata=data.frame(age.cat=2,male=0,lowed=0)) OR <- exp(pred2-pred1) Thanks [[alternative HTML version deleted]]