similar to: elements in a matrix to a vector

Displaying 20 results from an estimated 3000 matches similar to: "elements in a matrix to a vector"

2008 Oct 24
4
gfortran optimization problems
Colleagues, I have a routine in package labdsv that calls a FORTRAN subroutine. Recently, I was informed that it sometimes gives different results on a PC and Mac, and that the PC version is clearly wrong. I tested it on linux (because I don't have a PC), and I get the same (incorrect) behavior as the PC. Simply by inserting debug WRITE statements in the FORTRAN I would get different,
2005 Nov 04
1
Stress in multidimensional scaling
Hello, We are trying to find a function to compute "stress" in our multidimensional scaling analysis of a dissimilarity matrix. We've used "dist()" to create the matrix and "cmdscale()" for the scaling. In order to determine the number of dimensions we would like to plot stress vs. dimensions. However, we cannot find a pre-made command. It seems that other
2007 Nov 16
4
Permutation of a distance matrix
Hi there, I would like to find a more efficient way of permuting the rows and columns of a symmetrical matrix that represents ecological or actual distances between objects in space. The permutation is of the type used in a Mantel test. Specifically, the permutation has to accomplish something like this: Original matrix addresses: a11 a12 a13 a21 a22 a23 a31 a32 a33 Example
2006 Feb 10
1
3-d splinefun
hello, is it possible to do something like splinefun(x,y), but with a 3rd dim? for example, if i have a 2-dim system like: x<-1:100 y<-rexp(100,1) func<-splinefun(x,sort(y)) func(n) # returns interpolated value of y (after sorting) given x=n # i can check this by: plot(x,sort(y)) lines(spline(x,sort(y))) Can i do the same thing with an x,y, and z? i have found the akima
2006 Jan 17
1
Clustering function
Dear mailing group, I have loaded an Excel file into R by calling it ".csv" and using the "read.csv" function in R. However then I want to use the (limma package specific, I believe) function "hclust", which clusters data in a tree dendrogram, by similarity. However, I receive the errors msg.s: 1) "missing observations in cov/cor" 2) "In
2006 Jan 25
1
combining variables with PCA
hello R_team having perfomed a PCA on my fitted model with the function: data<- na.omit(dataset) data.pca<-prcomp(data,scale =TRUE), I´ve decided to aggregate two variables that are highly correlated. My first question is: How can I combine the two variables into one new predictor? and secondly: How can I predict with the newly created variable in a new dataset? Guess I need the
2005 Nov 02
2
help : matrix row/column random mixing
Could anybody help me in mixing the matrix values randomly (first rows and then columns)... for eg putting the 1 st row in the place of 3 rd and 3rd in place of 4 th and 4th in place of 1st row ...something like this in columns also.. Please suggest me some ways.. thanks a lot.. with regards, boopathy. --------------------------------- [[alternative HTML version deleted]]
2006 Apr 13
1
Fortran code
Hi! I have faced a big problem with R on my LINUX machine. I want to load a Fortran code via R, but the program can't do it. I have tried to load simpler codes, which seem to work perfectly, but the code I would like to load - which is a little more complicated - can't be loaded. I have installed the R 2.2.1 version. Should I need anything else to install (e.g. a library)? Is there a way
2005 Dec 13
3
Age of an object?
It would be nice to have a date stamp on an object. In S/Splus this was always available, because objects were files. I have looked around, but I presume this information is not available. -------------------------------------------------------------------- Trevor Hastie hastie at stanford.edu Professor, Department of Statistics, Stanford University Phone:
2006 Jan 30
2
collating columns
Dumb newbie question: I've searched the manual, R help and the mailing list archives, but can't seem to find the answer to this simple problem that I have. If I have a series of columns in a dataframe: (A, B, C ...) and I want to merge them with another series of columns (Z,Y,X ...) such that the resulting data frame has columns A,Z,B,Y,C,X ..., how do I do this? In other words, I'm
2006 May 02
2
Concave Hull?
I am modeling a trend surface using trmat and want to trim the resulting matrix to the area enclosed by my real data (i.e., remove all the extrapolated areas). I was using chull and in.chull to calculate the convex hull and change all the other values created by trmat to NA. However, my real data has portions that are slightly concave so chull would give me slivers that are extrapolations from
2005 Nov 08
2
retrieve most abundant species by sample unit
Hi R-users: [R 2.2 on OSX 10.4.3] I have a (sparse) vegetation data frame with 500 rows (sampling units) and 177 columns (plant species) where the data represent % cover. I need to summarize the cover data by returning the names of the most dominant and the second most dominant species per plot. I reduced the data frame to omit cover below 5%; this is what it looks like stacked. I have
2005 Oct 28
3
replacing a factor value in a data frame
Hi All, I have the following problem, that's driving me mad. I have a dataframe of factors, from a genetic scan of SNPs. I DO have NAs in the dataframe, which would look like: V4 V5 V6 V7 V8 V9 V10 1 TT GG TT AC AG AG TT 2 AT CC TT AA AA AA TT 3 AT CC TT AC AA <NA> TT 4 TT CC TT AA AA AA TT 5 AT CG TT CC AA AA TT 6 TT CC TT AA AA AA TT 7 AT CC
2006 May 23
2
transpose dataset to PC-ORD?
Hello: I need to take a species-sample matrix and transpose it to the format used by PC-ORD for analysis. Unfortunately, the number of species is very large (>5000), and so this operation cannot be performed simply in an application like Excel, which has a 255 column limit. So, I wrote relatively simple code in R that I hoped would do this (appended below). But there are glitches. The
2008 Jun 13
2
Quartile regression question
I have data that looks like lake,loglength,logweight 1,2.369215857,1.929418926 1,2.426511261,2.230448921 1,2.434568904,2.298853076 1,2.437750563,2.298853076 1,2.442479769,2.230448921 1,2.445604203,2.356025857 ... 102,2.722633923,3.310268367 102,2.781755375,3.502153893 102,2.836324116,3.683407299 102,2.802773725,3.583312152 102,2.790285164,3.546419267 102,2.806179974,3.599118565
2008 Aug 22
2
Newbie programming help
All - Not sure if this is a real programming question, but here goes: I have data that looks like Lake Length Weight 1 158 45 1 179 70 1 200 125 1 202 150 1 206 145 1 209 165 1 210 140 1 215 175 1 216 152 1 220 150 1 221 165 ... where lake goes from 1 - 84 and the number of rows for each lake is variable (but > ~20). I'm trying to do two things: 1) build a simple linear model of the
2008 Jun 10
3
newbie nls question
I'm tyring to fit a relatively simple nls model to some data, but keep coming up against the same error (code follows): Oto=nls(Otolith ~ Linf*(1-exp(-k(AGE-to))), data = ages, start = list(Linf=1000, k=0.1, to=0.1), trace = TRUE) The error message I keep getting is "Error in eval(expr, envir, enclos) : could not find function "k"". I've used this
2008 Dec 18
2
Contextstack overlow
All - I have a number of rows that I am assigning length classes to via l.class<-with(wae, ifelse((Length>=120)&(Length<130),"125", ifelse((Length>=130)&(Length<140),"135", ifelse((Length>=140)&(Length<150),"145", ifelse((Length>=150)&(Length<160),"155",
2008 Jun 12
2
Predicting from an nls model
I keep running up against the same error when I try to plot a line from a nls model. The data is fisheries length/weight data. Code follows: require(graphics) pow = nls(Weight~alpha*Length^beta, data=wae, start=list(alpha=0.0000001, beta=3.0), trace=TRUE) predict(pow) plot(Weight~Length,
2008 Sep 02
2
nls.control()
All - I have data: TL age 388 4 418 4 438 4 428 5 539 10 432 4 444 7 421 4 438 4 419 4 463 6 423 4 ... [truncated] and I'm trying to fit a simple Von Bertalanffy growth curve with program: #Creates a Von Bertalanffy growth model VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4, start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE) #Scatterplot of the data plot(TL~age, data=box5.4,