[R] program avail. for simulating spatial patterns?
Hi all, I am wondering if there is a function available in R for simulating spatial distribution of objects (plants in this case) in order to simulate sampling of a population . Specifically, I would like to be able to change the spatial correlation of individuals. I don't want to reinvent the wheel if it already exists. Thanks, Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] lda plotting: labeling x axis and changing y-axis scale
Sorry I wasn't clearer. I believe that it was a specialized function, but it may have been plot(). What I am basically trying to do is alter the y-axis to represent frequency and change the labels on the plotting of the linear discriminant analysis results. I can't seem to do this with plot(), if you know another function, that would be great. Or if you know how to alter the y-axis and label the two group names, that would be great also. I have been working at it for a while and am kicking myself for not saving the commands as a script. Thanks, Wade Wall On 12/22/06, John Kane [EMAIL PROTECTED] wrote: --- Wade Wall [EMAIL PROTECTED] wrote: Hi all, I have performed an lda on two groups and have plotted using plot(x.lda), with x.lda being my lda results. I have forgotten how to change the labels of the of the x-axes (they are currently listed as Group1 and Group 13), and to rescale the y-axis to reflect frequency. If anyone knows how to do it, I would greatly appreciate the information. Wade Wade, Are you asking about a specific ploting routine in lda or just how to use the basic plot function. If the latter try ?plot.default for what you need. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] lda plotting: labeling x axis and changing y-axis scale
Hi all, I have performed an lda on two groups and have plotted using plot(x.lda), with x.lda being my lda results. I have forgotten how to change the labels of the of the x-axes (they are currently listed as Group1 and Group 13), and to rescale the y-axis to reflect frequency. If anyone knows how to do it, I would greatly appreciate the information. Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] missing data using BIOENV function
Hi all, I am trying to use the BIOENV function in the Vegan package and am wondering if there is a way to perform the function with missing values. Is there a way to pass use=pairwise.complete.obs to the cor function? Or is this the wrong way to approach it? Thanks Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] posterior probability formula in predict.lda
IHi all, have a dataset with rows as plots and environmental data as columns. I have predicted the values using the following ed.pred-predict(lda.ed,ed) #lda.ed the model, ed the env. variables used for the prediction plots I am wanting to know the formula used by predict.lda for calculating the posterior probabilities. Can anyone point me in the right direction? Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] X-fold cross validation function for discriminant analysis
Hi all, I ran a discriminant analysis with some data and want to get a general idea of prediction error rate. Some have suggested using X-fold cross validation procedure. Anyone know if there is a function for this in R? Thanks, Wade [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Box's M test
Hi all, Is there a box's M test for R? I have looked around, but have been unable to find it. Thanks Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] subset of rows from matrix
Hi all, I have a dataframe of rownames that I would like to extract from a larger matrix to form a new matrix. I have tried to use subset, in this manner x-subset(largematrix, rownames$names=largematrix$rownames) where largematrix is the larger matrix and rownames$names is the dataframe with the row names of the rows I want to extract from the larger matrix. Of course, I get error messages. Any suggestions how I should proceed? Thanks Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] trim function in R
Hi all, I am looking for a function in R to trim the last two characters of an 8 character string in a vector. For example, I have the codes 37-079-2, 370079-3,37-079-8 and want to trim them to 37-079 by removing the last two characters. Is sub the correct function to use, and if so how can I specify trimming the last 2 characters? I have read the help file, but can't quite figure out how to do it. Thanks, Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] random section of samples based on group membership
Hi all, I have a matrix of 474 rows (samples) with 565 columns (variables). each of the 474 samples belong to one of 120 groups, with the groupings as a column in the above matrix. For example, the group column would be: 1 1 1 2 2 2 . . . 120 120 I want to randomly select one from each group. Not all the groups have the same number of samples, some have 4, some 3 etc. Is there a function to do this, or would I need to write a looping statement to look at each successive group? I basically want to combine the randomly selected samples from the 120 groups into a new matrix in order to perform a cluster analysis. Thanks, Wade __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Cluster Analysis with flexible beta linkage method
Hi all, I am trying to run a cluster analysis using Sorenson (Bray-Curtis) distance measure with flexible beta linkage method. However, I can't seem to find flexible beta in any of the functions/packages I have looked at. Any help would be appreciated. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] replace values in data frame
Hi all, I have a three columned list that I have imported into R. The first column is a plot (ex. Plot1), the second is a species name (ex ACERRUB) and the third a numeric value. I want to replace some of the second column names with other names (for example replace ACERRUB with ACERDRU). The original and replacement values are in separate lists (not vectors), but I can't seem to find the right function to perform this. The replace function seems to only want to work with numbers. Any clues? Wade [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] replace values in data frame
The format is like this. Plot species Value P1 ACERRUB 3 P2 MAGNVIR2 P3 ARONARB 2 etc. imported using x-read.table(file=filename.txt) I want to replace a list of values in the 2nd column with another list. For example, I want to replace ARONARB with PHOTPYR. list-read.table(file=originalnames.txt) replace-read.table(file=replacementnames.txt) I tried to use replace in this manner: newx-replace(x,list,replace) however, I get the error message: error in replace, invalid subscript type. I have tried transforming the above list and modifying the column names (column 2), but to no avail. I hope this clarifies a little. Sorry about that. On 7/7/06, Marc Schwartz (via MN) [EMAIL PROTECTED] wrote: On Fri, 2006-07-07 at 11:20 -0400, Wade Wall wrote: Hi all, I have a three columned list that I have imported into R. The first column is a plot (ex. Plot1), the second is a species name (ex ACERRUB) and the third a numeric value. I want to replace some of the second column names with other names (for example replace ACERRUB with ACERDRU). The original and replacement values are in separate lists (not vectors), but I can't seem to find the right function to perform this. The replace function seems to only want to work with numbers. Any clues? Wade Without seeing the code you are using, we can only guess a syntax error of some sort. It works fine using the iris dataset: head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2 setosa 3 4.7 3.2 1.3 0.2 setosa 4 4.6 3.1 1.5 0.2 setosa 5 5.0 3.6 1.4 0.2 setosa 6 5.4 3.9 1.7 0.4 setosa 7 4.6 3.4 1.4 0.3 setosa 8 5.0 3.4 1.5 0.2 setosa 9 4.4 2.9 1.4 0.2 setosa 10 4.9 3.1 1.5 0.1 setosa iris$Species - replace(iris$Species, iris$Species == setosa, NewValue) head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 NewValue 2 4.9 3.0 1.4 0.2 NewValue 3 4.7 3.2 1.3 0.2 NewValue 4 4.6 3.1 1.5 0.2 NewValue 5 5.0 3.6 1.4 0.2 NewValue 6 5.4 3.9 1.7 0.4 NewValue 7 4.6 3.4 1.4 0.3 NewValue 8 5.0 3.4 1.5 0.2 NewValue 9 4.4 2.9 1.4 0.2 NewValue 10 4.9 3.1 1.5 0.1 NewValue HTH, Marc Schwartz [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Way to convert data frame to matrix
I have a text file that I have imported into R. It contains 3 columns and 316940 rows. The first column is vegetation plot ID, the second species names and the third is a cover value (numeric). I imported using the read.table function. My problem is this. I need to reformat the information as a matrix, with the first column becoming the row labels and the second the column labels and the cover values as the matrix cell data. However, since the read.tablefunction imported the data as an indexed data frame, I can't use the columns as vectors. Is there a way around this, to convert the data frame as 3 separate vectors? I have been looking all over for a function, and my programming skills are not great. Thanks in advance [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html