search for: newxs

Displaying 20 results from an estimated 159 matches for "newxs".

Did you mean: news
2005 Nov 09
2
help with legacy R code
Hi there, Could somebody help me disect this legacy R script I inherited at work, I have two questions: 1. I've tried to upgrade our R version from 1.6.2 (yeah, I know), to R 2.0, but some of the lines in this script are not compatible with R 2.0, could someone help me figure out where the problem is? 2. the jpeg generated (attached) seems to be off on some of the data, is there a better way
2008 Dec 28
0
how to calculate DWT maximum decomposition level
Given a time series of length N, I am trying to figure out its maximum DWT decomposition level. With reference to "dwt" function of R package "wavelets", running the provided example I get the following and wonder how the maximum decomposition level (which is not an integer number) is calculated. I tried myself the formula in the on-line documentation but could not get the
2010 Mar 27
5
producing a QQ plot.
Hello everyone I'm a beginner in Stats and R, I'm using R 2.10.1. I need to create a multivariate qq plot, there is 8 variable group with each has 55 number of input. An example of what I did so far, just to get my point out: > data=read.csv(file.choose(),header=T) > data country village group av_expen P2ary_ed no_fisher 1 Cook Islands Aitutaki D
2007 May 09
1
predict.tree
I have a classification tree model similar to the following (slightly simplified here): > treemod<-tree(y~x) where y is a factor and x is a matrix of numeric predictors. They have dimensions: > length(y) [1] 1163 > dim(x) [1] 1163 75 I?ve evaluated the tree model and am happy with the fit. I also have a matrix of cases that I want to use the tree model to classify. Call it
2009 Sep 01
1
understanding the output from gls
I'd like to compare two models which were fitted using gls, however I'm having trouble interpreting the results of gls. If any of you could offer me some advice, I'd greatly appreciate it. Short explanation of models: These two models have the same fixed-effects structure (two independent, linear effects), and differ only in that the second model includes a corExp structure for
2008 Apr 21
1
Labelling a secondary axis in R
Hello, How can I label a secondary axis in R? At the moment it's labelled as c(-100,200). Obviously I would like it to be more sensible. Here is the code I am using newx = -100+37.5*((1:9)-1) axis(4,at=newx,labels=(newx+100)/3750) Thanks, Rob -- View this message in context: http://www.nabble.com/Labelling-a-secondary-axis-in-R-tp16807708p16807708.html Sent from the R help mailing list
2010 Jul 29
1
Using 'dimname names' in aperm() and apply()
I think that the "dimname names" of tables and arrays could make aperm() and apply() (and probably some other functions) easier to use. (dimname names are, for example, created by table() ) The use would be something like: -- x <-table( from=sample(3,100,rep=T), to=sample(5,100,rep=T)) trans <- x / apply(x,"from",sum) y <- aperm( trans,
2013 Mar 23
1
Error with custom function in apply: ”Error in FUN(newX[, i], ...) : unused argument(s) (newX[, i])”
Hi everyone, I wonder if I can get your help using a custom function in apply. Imagine the following dataframe called "data": LowLim HighLim A1 A2 A3 A4 4 6 3 4 5 6 4 6 4 5 5 6 2 3 1 4 2 3 2 3 NA NA NA NA We have created a custom function (see below) that takes the values in a given row between columns A1 to A4 to see if they are outside the limits in the same
2009 Dec 10
0
Detectar outliers en un gráfico de dispersión SOLUCION
Bueno, ya lo he solucionado gracias a Carlos me ha enviado un correo en privado (supongo que se ha despistado, si no lo querías hacer público ya es tarde) con esta info: -- Creo que lo tienes (en formato básico) aquí: https://stat.ethz.ch/pipermail/r-help/2007-November/146285.html Aunque pensaba que si tu objetivo último es el de que usuarios "potencialmente tontos" sean capaces de
2008 Jun 17
1
Trouble with FUN(newX[, i], ...)
Hi, I am trying to train svm with some training data of about 4000 rows and 4000 columns. While running svm function I am ending up with the following error. trainfile <- read.csv('0_train_0016435.csv',head=TRUE,na.strings = "NULL") datatrain <- subset(trainfile,select=c(-Class)) model <- svm(datatrain, kernel="radial") Error in FUN(newX[, i], ...) :
2017 Sep 26
2
Surprising message "Error in FUN(newX[, i], ...) : all arguments must have the same length"
I am hitting an odd message "Error in FUN(newX[, i], ...) : all arguments must have the same length". I can't supply the data as it's a huge data frame but I think this has enough diagnostic information to show the issue. I am sure I am missing something obvious. I've put some extra comments in but otherwise this is cut and pasted from Rstudio. ### I wanted a table of the
2006 Sep 28
2
safe prediction from lm
I am fitting a regression model with a bs term and then making predictions based on the model. According to some info on the internet at http://www.stat.auckland.ac.nz/~yee/smartpred/DummiesGuide.txt there are some problems with using predict.lm when you have a model with terms such as bs,ns,or poly. However when I used one of the examples they said would illustrate the problems I get virtually
2017 Sep 26
0
Surprising message "Error in FUN(newX[, i], ...) : all arguments must have the same length"
Hi Chris, Maybe the na.rm=TRUE is affecting things. Try this apply(datTAF[,75:78],2,function(x){ sum(!is.na(x)) }) HTH, Eric On Tue, Sep 26, 2017 at 9:53 AM, Chris Evans <chrishold at psyctc.org> wrote: > I am hitting an odd message "Error in FUN(newX[, i], ...) : all arguments > must have the same length". I can't supply the data as it's a huge data > frame
2005 May 06
4
Choices from a matrix
Could someone please suggest a more clever solution to the following problem than my loop below? Given X a 2xN matrix X, and I a k-subset of N, Generate the (2^k)xN matrix Y with columns not in I all zero and the other columns with all choices of an entry from the first or second row of X. For example, with X <- matrix(1:8, nrow=2) I <- c(1,3) X is 1 3 5 7 2 4 6 8 and Y should be 1 0 5
2012 Mar 12
1
2 images on one plot
Dear all with image I can plot only one set of values in one plot. Do somebody have any insight how to put those 2 matrices into one picture so that in one cell in image picture are both values from mat[1,1] and mat2[1,1]. mat<-matrix(1:4, 2,2) mat2<-matrix(4:1,2,2) x <-1:2 y <-1:2 image(x, y, mat) image(x, y, mat2) The only way I found is to mix x or y for both matrices let
2004 Oct 25
1
Ref: Variable scope or function behaviour or array reassign
Dear R- helpers Following a draft structure of the R script for which I am facing problem Step 1 x <- of type array with original values y <- of type array with original values Step 2 for (ctr in 1:10) { # my problem here the both x and y still show the original values from step 1 # in spite of making changes to the old values of the arrays x and y in the function function
2010 Aug 13
2
Unable to retrieve residual sum of squares from nls output
Colleagues, I am using "nls" successfully (2.11.1, OS X) but I am having difficulties retrieving part of the output - residual sum of squares. I have assigned the output to FIT: > > FIT > Nonlinear regression model > model: NEWY ~ PMESOR + PAMPLITUDE * cos(2 * pi * (NEWX - POFFSET)/PERIOD) > data: parent.frame() > PMESOR PAMPLITUDE POFFSET >
2012 Dec 03
2
Different results from random.Forest with test option and using predict function
Hello R Gurus, I am perplexed by the different results I obtained when I ran code like this: set.seed(100) test1<-randomForest(BinaryY~., data=Xvars, trees=51, mtry=5, seed=200) predict(test1, newdata=cbind(NewBinaryY, NewXs), type="response") and this code: set.seed(100) test2<-randomForest(BinaryY~., data=Xvars, trees=51, mtry=5, seed=200, xtest=NewXs, ytest=NewBinarY) The confusion matrices for the two forests I thought would be the same by virtue of the same seed settings, but they differ as do the p...
2009 Mar 21
2
limiting simulated animal movement
Hi, I am trying to simulate animal movement in a gridded landscape made up of cells. At each time step (iteration), the animal moves from one cell to another in a random fashion. This is how I am simulating movement, where a and b are the x,y co-ordinates of the animal at the previous time step: for (i in 1:no.of.steps){ direction <- sample(1:8, 1) if(direction == 1){ a <- a b <- b -
2006 Sep 22
4
Creating Movies with R
Dear All, I'd like to know if it is possible to create animations with R. To be specific, I attach a code I am using for my research to plot some analytical results in 3D using the lattice package. It is not necessary to go through the code. Simply, it plots some 3D density profiles at two different times selected by the user. I wonder if it is possible to use the data generated for different