[R] scatter plot: multiple Y variables and error bars

2011-05-17 Thread B77S
#Hi all, #Using the example data that follows, can someone please show me how to get a scatterplot of points with #error bars in the Y direction. something like this works for one Y: xYplot(Cbind(y1, l1, u1) ~x1, data=y) #but this: xYplot(Cbind(y1, l1, u1) + Cbind(y2, l2, u2)~x1, data=y) #

Re: [R] automatically generate the output name of my "for" loops

2011-06-12 Thread B77S
?paste something like... paste ("group", i, sep="_") jiliguala wrote: > > Hello R users, > > I am new to R and am having difficulty with the output name of my "for" > loops. > > here is the problem: > > > for (i in c(1:100)) > { > the name of the groups <- which(k1$cluster==i) > } > > ho

Re: [R] automatically generate the output name of my "for" loops

2011-06-12 Thread B77S
?paste something like... paste (group, i, sep="_") jiliguala wrote: > > Hello R users, > > I am new to R and am having difficulty with the output name of my "for" > loops. > > here is the problem: > > > for (i in c(1:100)) > { > the name of the groups <- which(k1$cluster==i) > } > > how

[R] Subsampling out of site*abundance matrix

2011-02-06 Thread B77S
Hello, How can I randomly sample individuals within a sites from a site (row) X species abundance (column) data frame or matrix? As an example, the matrix "abund2" made below. # (sorry, Im a newbie and this is the only way I know to get an example on here) abund1 <-c(150, 300, 0, 36

Re: [R] Subsampling out of site*abundance matrix

2011-02-06 Thread B77S
0 022 32 0 If you know, I'd appreciate it.. thanks again for the help. David Winsemius wrote: > > > On Feb 6, 2011, at 3:25 PM, B77S wrote: > >> >> Hello, >> How can I randomly sample individuals within a sites from a site >> (row) X

Re: [R] Subsampling out of site*abundance matrix

2011-02-06 Thread B77S
hehe... very true sir; I apologize, that was very straightforward. Thank you for your time. -- View this message in context: http://r.789695.n4.nabble.com/Subsampling-out-of-site-abundance-matrix-tp3263148p3263598.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Subsampling out of site*abundance matrix

2011-02-07 Thread B77S
Also, I really appreciate you explaining why you used factor. I'm still not quite sure what set.seed does (i read ?set.seed) or why you chose 123... but it and the function below work, so that is all that matters. :) randSub <- function(L1, s.size) { set.seed(123) samptbl <- apply(L1, 1, fun

Re: [R] Subsampling out of site*abundance matrix

2011-02-07 Thread B77S
So, after thinking about this a bit, I realized that the previous solution wasn't exactly what I needed. I really needed replacement=F and to be able to choose any sample size (n.sample) less than or equal to the site (row) with the lowest total abundance. Anyway, I think this works. Forgiv

Re: [R] Subsampling out of site*abundance matrix

2011-02-08 Thread B77S
It is a lot prettier than mine too. Thanks Jari. > rrarefy function (x, sample) { if (length(sample) > 1 && length(sample) != nrow(x)) stop("length of 'sample' and number of rows of 'x' do not match") sample <- rep(sample, length = nrow(x)) colnames(x) <- colnames(x, do.NULL

Re: [R] Need help merging two dataframes

2011-02-11 Thread B77S
## i didn't try this, but I would think it would work newAB <-data.frame(AB$id, AB$age, AB$sex, AB$area) colnames(newAB)<-c("id","age", "sex, "area") uni.newAB <- unique(newAB) t3<-merge(t2, uni.newAB, by="id", all=FALSE) -- View this message in context: http://r.789695.n4.nabble.com/Need-he

[R] R, Ubuntu, package installation with non-zero exit status

2011-02-14 Thread B77S
All: I have been looking through the string of posts regarding this same issue, but I haven't been able to fix this problem. I am running Ubuntu 10.4 64bit, R version 2.10.1 I cannot install certain packages (e.g. "vegetarian") and each time it says basically the same thing (regardless of the pa

Re: [R] R, Ubuntu, package installation with non-zero exit status

2011-02-14 Thread B77S
also, I have 'r-base-dev' installed as well -- View this message in context: http://r.789695.n4.nabble.com/R-Ubuntu-package-installation-with-non-zero-exit-status-tp3305989p3306005.html Sent from the R help mailing list archive at Nabble.com. __ R-he

Re: [R] How to call data elements

2011-04-06 Thread B77S
assuming this is from a list mydata[[1]][1] and mydata[[1]][7] ?? Wonjae Lee wrote: > > Hi, > > I have a stupid and simple question. > Please forgive me. > > In an example below, please tell me how to call "1947" in mydata. > Thank you in advance. > > Wonjae > >> mydata > [[

Re: [R] problem with all/all.equal

2011-04-06 Thread B77S
ifelse(length(unique(x))==1, "All Equal", "Not All Equal") -- View this message in context: http://r.789695.n4.nabble.com/problem-with-all-all-equal-tp3431956p3432167.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

Re: [R] R, Ubuntu, package installation with non-zero exit status

2011-04-06 Thread B77S
FYI: The problem I had was that my modified .Rprofile text file was being read and had lines to load the libraries of packages that were not installed yet on this Ubuntu machine; I guess I copied the .Rprofile from my laptop. If you have similar problems, simply do this in command line: mv .Rpro

Re: [R] unexpected sort order with merge

2011-04-06 Thread B77S
That is odd, I noticed some weird sorting with merge() a while back too and always am careful with it now. Fortunately, sort=FALSE seems to work the way one would think most of the time. Although, the following results seem weird too! (adding by="date" makes it not sort oddly, regardless of so

Re: [R] How to create a 3d Surface plot from a CSV file?

2011-04-08 Thread B77S
step # 1 ?read.csv -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-a-3d-Surface-plot-from-a-CSV-file-tp3437463p3437478.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https

Re: [R] extract element from list by rownames

2011-04-12 Thread B77S
This probably is not ideal, but this works on a list of mine.. ## so you can see the structure of my list > str(srMT) List of 4 $ mode : chr "discrete" $ ks.stat : chr "mean" $ observed :List of 4 ..$ filter: num [1:13, 1:4] 0.213 0.207 0.144 0.311 0.24 ... .. ..- attr(*, "dimnames

Re: [R] extract element from list by rownames

2011-04-12 Thread B77S
I'm thinking this isn't what you want.. but also: > data.frame((srMT[[3]][1]))[b,][2] filter.vel2 MK_SP10.2503257 SB1_SP1 0.2075117 SB4_SP1 0.2358855 B77S wrote: > > This probably is not ideal, but this works on a list of mine.. > > ## so you ca

Re: [R] Removing objects and clearing memory

2011-04-12 Thread B77S
#replace v with whatever rm(list=(ls()[ls()!="v"])) -- View this message in context: http://r.789695.n4.nabble.com/Removing-objects-and-clearing-memory-tp3445763p3445865.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Clearing Console; of weeks of codes!

2011-04-14 Thread B77S
If you don't want your history, why not just do this. >q() Save workspace image? [y/n/c]: >n ?? Am I missing something? 1Rnwb wrote: > > Thanks, I thought that removing the list would take care of it. the > question is I do not see a .Rhistory file in my current working directory, > so where

Re: [R] Howto convert Linear Regression data to text

2011-08-24 Thread B77S
If I understand you correctly, see ?paste and the following to extract the values you require: summary(res)[[4]][1] summary(res)[[4]][2] summary(res)[[8]] HTH ashz wrote: > > Dear all, > > How can I covert lm data to text in the form of "y=ax+b, r2" and how do I > calculate R-squared(r

Re: [R] Importing data from MS EXCEL (.xls) to R XXXX

2011-08-24 Thread B77S
I agree with Ken.. if you can, save it as a CSV file. But if you have a bunch of these, then it isn't very efficient. I use read.xlsx() from the package "xlsx". I notice that you are using the full path.. have you tried changing directories?... I find it is best to compartmentalize my work and

Re: [R] Alternatives to integrate?

2011-09-01 Thread B77S
package "caTools" see ?trapz . wrote: > > Hi all, > > is there any alternative to the function integrate? > > Any comments are welcome. > > Thanks in advance. > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] R Help finding Mean

2011-09-01 Thread B77S
see ?mean Then avoid other peoples code. cenae27 wrote: > > bob<-read.csv('shi.csv', header=T) > > newmean<-matrix(0, test, dim(bob)[2]-6);a<-0; for (i in > c(4,8:(dim(bob)[2]))) > {a<-a+1;newmean[,a]<-tapply(bob[,i], bob$Exam, mean)} > colnames(newmean)<-colnames(bob)[c(4,8:(dim(bob)[2]))] >

[R] reshaping data

2011-09-07 Thread B77S
I have the following data (see RawData using dput below) How do I get it in the following 3 column format (CO2 measurements are the elements of the original data frame). I'm sure the package reshape is where I should look, but I haven't figured out how. Thanks ahead of time Month Year CO2 J

Re: [R] reshaping data

2011-09-07 Thread B77S
NA > 48 1958 F NA > 95 1958 M 315.71 > 142 1958 A 317.45 > 189 1958 M.1 317.50 > 236 1958 J.1 NA > > > On Wed, Sep 7, 2011 at 7:35 AM, B77S <bps0...@auburn.edu> wrote: > >> I have the following data (see RawData using dput below)

Re: [R] installation of BiodiversityR package

2011-09-15 Thread B77S
My guess is that anyone willing to help will want more information. What version of R do you have(?), for example. BiodiversityR Depends on R version ≥ 2.13.1, and vegan ≥ 1.17-12 SG wrote: > > I have installed R on windows 7 machine. > In the install packages I can't find BiodiversityR pac

Re: [R] R functions

2011-09-15 Thread B77S
You'll never figure it out if you don't "play around" with your data. Assuming you have been able to import the data, a good place to start is to look at what tools you have available.Check out this: http://cran.r-project.org/doc/contrib/Short-refcard.pdf check out things like ?which ?max ?

Re: [R] R functions

2011-09-15 Thread B77S
If your data is named 'test_file' then use dput(test_file) You can copy and paste the results here so people can more easily try and help you. see ?dput sujitha wrote: > > Hi group, > I am trying to right a code to do the following > This is how the test file looks like: > Chr start end sa

Re: [R] R functions

2011-09-15 Thread B77S
], rle(test[,5])[[1]])) names(test2) <- c("Values", "Probes") > test2 Values Probes 1 0.00 4 2 -0.43 4 3 0.00 2 4 0.00 2 5 -0.35 6 6 0.00 2 # Obviously this is not exactly what you wanted, only the last 2 columns. Obviously, th

Re: [R] Mystified - comparing chron times

2011-09-16 Thread B77S
I'm sure Sarah's solution works (and she knows more about R than myself), but I ran into a similar problem and used: as.character(start.time)==as.character(expected_start.time) good luck regardless. -BS Sarah Goslee wrote: > > Sounds like a case for FAQ 7.31, or, yet another machine precision

Re: [R] onet.permutation()

2011-09-17 Thread B77S
** I am not a statistician, but... The default arguments are: onet.permutation(x, nsim=2000, plotit=TRUE) you are making nsim=4 (this parameter is not the size of each sample, it is the number of samples taken) You are building the distribution for a statistical test through random sampling, s

Re: [R] graph bugs using R on MAC

2011-09-18 Thread B77S
Have you been shown how to save a graph as a JPEG or PNG? try this: png("myGraph.png") plot(your_data) dev.off() A png will appear in your working directory, which can be imported into the Word document. You can do the same with a JPEG see ?jpeg or ?png and ?dev.off HTH bonnieyuan wrote: >

Re: [R] AIC

2011-09-18 Thread B77S
This isn't a question about R; more appropriate for stackexchange. Here is one string that might interest you: http://stats.stackexchange.com/questions/4997/can-aic-compare-across-different-types-of-model Tania Sav wrote: > > Hello, > > I'm using AIC() to choose a better model. I have 3 o

Re: [R] adding labels to x,y points

2011-09-20 Thread B77S
I don't have access to your "alon.txt" file (see ?dput for future posts), but... I'm pretty sure info you want isn't in row.names(colon[1:2]) it should just be text(x,y, label = colon[1:20]) ?? HTH baumeist wrote: > > Hi, > I am new to R. > > I have a matrix that I have assigned to the o

Re: [R] adding labels to x,y points

2011-09-20 Thread B77S
Actually, you appear to have re-assigned your object “colon” (from "c:\\alon.txt") with a character vector of intended row.names. so use row.names(colon) <-paste("g",c(1:nrow(colon)),sep="") B77S wrote: > > I don't have access to your "a

Re: [R] adding labels to x,y points

2011-09-21 Thread B77S
#This should work (again, without your data ??) colon<-read.table("c:\\alon.txt",header=T,row.names=1) row.names(colon) <-paste("g",c(1:nrow(colon)),sep="") with(colon[1:20,], plot(norm1, norm2, type='n',xlab='x norm1 sample',ylab='y norm2 sample',main='Norm1 vs Norm2 - 20 genes')) with(co

Re: [R] Linking 2 columns in 2 databases and applying a function

2011-06-22 Thread B77S
1st of all Dr Utz, thanks for your recent pubs on regional differences between the piedmont and coastal plain streams. and to add to Daniels post (giving your binary yes/no): df<-merge(x,y,all.x=T,all.y=F) df["exceed"] <- ifelse(df$Q>df$Threshold_Q , 1, 0) ## now look at df df Daniel Mal

[R] identifying a 'run' in a vector

2011-07-06 Thread B77S
Hi, How can I discern which elements in x (see below) are in 'order', but more specifically.. only the 1st 'ordered run'? I would like for it to return elements 1:8... there may be ordered values after 1:8, but those are not of interest. x <- c(1, 2, 3, 4, 5, 6, 7, 8, 20, 21, 22, 45) Thanks fo

Re: [R] identifying a 'run' in a vector

2011-07-06 Thread B77S
well.. the following works, but if you have another idea I am still interested. 1:(which(diff(x)!=1)[1]) B77S wrote: > > Hi, > > How can I discern which elements in x (see below) are in 'order', but more > specifically.. only the 1st 'ordered run

Re: [R] identifying a 'run' in a vector

2011-07-06 Thread B77S
:32 PM, B77S <bps0...@auburn.edu> wrote: >> Hi, >> >> How can I discern which elements in x (see below) are in 'order', but >> more >> specifically.. only the 1st 'ordered run'? >> I would like for it to return elements 1:8... there may be

Re: [R] Confusing piece of R code

2011-07-09 Thread B77S
Have you looked at the manual for any of these? ?get ?sprintf ?assign #and so on... ? Bazman76 wrote: > > m0<-epxression((4*theta1*theta2-theta3^2)/(2*x*theta3^2)-0.5*theta1*x) > > params<-all.vars(m0) this reads all the > params from m0 so theta1,2 and 3 corre

[R] installation of package 'mapproj' had non-zero exit status

2011-07-12 Thread B77S
## Hello.. I have asked a similar question, but this is not fixed as before. ## I am running the following using Ubuntu OS: R version 2.13.1 (2011-07-08) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) ## when I do this:

Re: [R] Odd behaviour of as.POSIXct

2011-07-15 Thread B77S
day doesn't exist? That would be the 1st problem. Johannes Egner wrote: > > Dear all, > > how come the first loop in the below fails, but the second performs as > expected? > > days <- as.Date( c("2000-01-01", "2000-01-02") ) > > for(day in days) > { > as.POSIXct(day) > } > > for( n in

Re: [R] Ordinary Least Products regression in R

2011-07-27 Thread B77S
If this is the same as geometric mean regression (aka: line of organic correlation-- Kruskal 1953), I ended up writing my own function (although one may exist and I didn't see it). Bill Hyman wrote: > > Dear all, > > Does any one know if any R package or function can do Ordinary Least > Pro

Re: [R] pairs(), no axis labels/values for upper panel?

2011-11-15 Thread B77S
Steffen, Did you ever have luck getting rid of the tick marks?... I like your idea and have modified it, but yes, the tick marks need to go. Steffen Fleischer wrote: > > Dear all, > > I want to draw a graph that contains the scatterplot matrix in the lower > panel and coefficients in the u

Re: [R] R forum for only Statistics

2011-11-16 Thread B77S
In addition to getting help from others, I always find that seeking answers through reading to be helpful. I would suggest a basic stats book and this paper regarding issues indices like species richness: http://www.amazon.com/Primer-Ecological-Statistics-Nicholas-Gotelli/dp/0878932690 Here is

[R] return only pairwise correlations greater than given value

2011-11-16 Thread B77S
Hello, I would like to find out if a function already exists that returns only pairwise correlations above/below a certain threshold (e.g, -.90, .90) Thank you. -- View this message in context: http://r.789695.n4.nabble.com/return-only-pairwise-correlations-greater-than-given-value-tp40790

[R] split list of characters in groups of 2

2011-11-16 Thread B77S
hi, If i have a list of things, like this var.names <- c("a", "b", "c", "d", "e", "f") how can i get this: "a, b", "c, d", "e, f" thanks ahead of time. -- View this message in context: http://r.789695.n4.nabble.com/split-list-of-characters-in-groups-of-2-tp4079031p4079031.html Sent from

Re: [R] return only pairwise correlations greater than given value

2011-11-16 Thread B77S
ke this: > > BigCorrelation <- function(X){ > > return(which(abs(cor(X)) > 0.9, arr.ind = T)) > } > > but it hardly seems worth its own function call. > > On Thu, Nov 17, 2011 at 12:42 AM, B77S <bps0002@> wrote: >> Hello, >> >>  I woul

Re: [R] return only pairwise correlations greater than given value

2011-11-17 Thread B77S
p 0.8324475 4 cyl drat -0.6999381 7 disp hp 0.7909486 8 disp drat -0.7102139 I'm not sure how to make melt() quit giving the "Using as id variables" warning, but I don't really care either. B77S wrote: > > Thanks Michael, > > I just started on the fo

Re: [R] return only pairwise correlations greater than given value

2011-11-17 Thread B77S
i <- which(abs(x) >= r, arr.ind = TRUE) > data.frame(matrix(colnames(x)[as.vector(i)], ncol = 2), value = x[i]) > } > > spec.cor(mtcars[, 2:5], .6) > > Cheers, > > Josh > > On Wed, Nov 16, 2011 at 9:58 PM, B77S <bps0002@> wrote: >> Thanks M

Re: [R] Removing rows in dataframe w'o duplicated values

2011-11-22 Thread B77S
This is ugly, but it gets what you want. dat[which(dat[,1] %in% unique((dat[duplicated(dat[,1], fromLast = T), 1]))),] AC Del Re wrote > > Hi, > > Is there an easy way to remove dataframe rows without duplicated values of > a specified column ('id')? e.g., > > dat <- data.frame(id = c(1

Re: [R] Looping and paste

2011-11-23 Thread B77S
out <- vector("list") Ylab <- for(i in 1:length(BndY)) { out[i] <- paste(BndY[i]," to ",BndY[i],"mN") } Ylab <- do.call(c, out) markm0705 wrote > > Dear R helpers > > I'm trying to make up some labels for plot from this vector > > BndY<-seq(from = 18900,to= 19700, by = 50) > > using >

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-24 Thread B77S
-- View this message in context: http://r.789695.n4.nabble.com/I-cannot-get-species-scores-to-plot-with-site-scores-in-MDS-when-I-use-a-distance-matrix-as-input-Pr-tp4103699p4104295.html Sent from the R help mailing list archive at Nabble.com. __ R-he

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-24 Thread B77S
Try the daisy() function from the package "cluster", it seems to be able to handle NAs and non-dummy coded character variables metaMDS(daisy(df, metric="gower")) Edwin Lebrija Trejos wrote > > Hi, First I should note I am relatively new to R so I would appreciate > answers that take this into

Re: [R] Summarizing elements of a list

2011-12-01 Thread B77S
Someone is bound to know a better way, but... subset(unlist(Version1_), subset=names(unlist(Version1_))=="First") LCOG1 wrote > > Hi everyone, >I looked around the list for a while but couldn't find a solution to my > problem. I am storing some results to a simulation in a list and fo

Re: [R] Moving column averaging

2011-12-01 Thread B77S
# need zoo to use rollapply() # your data (I called df) df <- structure(list(a = 1:2, b = 2:3, c = c(5L, 9L), d = c(9L, 6L), e = c(1L, 5L), f = c(4, 7)), .Names = c("a", "b", "c", "d", "e", "f"), class = "data.frame", row.names = c(NA, -2L)) # transpose and make a zoo object df2 <- zoo(t(df

Re: [R] calculate mean of multiple rows in a data frame

2011-12-01 Thread B77S
-- View this message in context: http://r.789695.n4.nabble.com/calculate-mean-of-multiple-rows-in-a-data-frame-tp4130468p4143875.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] Moving column averaging

2011-12-01 Thread B77S
Sorry for that, and thanks Gabor, I could have sworn that it wouldn't. Gabor Grothendieck wrote > > On Thu, Dec 1, 2011 at 7:13 PM, B77S <bps0002@> wrote: >> # need zoo to use rollapply() >> >> # your data (I called df) >> df <- structure(list(a

Re: [R] How to test for Poisson?

2011-12-02 Thread B77S
A simple way to determine if it is NOT is to see if the mean (the single parameter of a poisson: lambda) and variance are the same. This really has nothing to do with R (other than the data source), and since it is homework, you will likely get no further help here. Good luck. RToss wrote > >

Re: [R] Iteration in R

2011-12-03 Thread B77S
Hi Michael, How would you do this with lapply to return a list? I can't seem to get that to work (I haven't used these much and am trying to learn). Thanks Brad Michael Weylandt wrote > > ? replicate > > or a for loop > > or do all one hundred simulations at once > > x <- matrix(rnorm(100^2,

Re: [R] Iteration in R

2011-12-03 Thread B77S
Interesting and thank you; I'm confused as to why this doesn't work with: lapply(rep(1,6), FUN=rnorm, n=10, mean=1.0, sd=1) andrija djurovic wrote > > Hi Brad. Maybe something like this: > > lapply(rep(1,6), function(x) rnorm(10,0,1)) > > Andrija > > On

Re: [R] Moving column averaging

2011-12-03 Thread B77S
y on a plain matrix faster than on a > zoo object? I am asking since I wanted to apply the provided averaging > code to a larger matrix (2500 rows x 200 cols), which is quite time > consuming... > > Thanks again! > > Chega > > > From: B77S

Re: [R] Data Analysis for Gas Prices

2011-12-03 Thread B77S
use a < ? > to get help on a function; example: ?read.table If you do this you will see an option called "header"... use header=T if your top row contains column names. Learn how to read these help pages. Also, read thru a few beginner R manuals and see this website: http://www.statmethods.

Re: [R] Programming Statistical Functions

2011-12-04 Thread B77S
As Stephen pointed out, this is easy to do. The word file the OP posted has all the necessary formulae. Now you just need to learn how to convert those formulae into R functions Stephen gave you an example of how to create a function for CV. Now run with it. perhaps something like this is w

Re: [R] problem merging data with different shapes

2011-12-04 Thread B77S
Please use dput() to post your example data sets. dput(Adata) dput(Bdata) **then copy and paste the results of each so that we can "play" around with it easily. Miriam -2 wrote > > I have been trying to merge datasets, one of which has a long format > (Adata) and one has a (different) long f

Re: [R] Export cols to single csv files

2011-12-04 Thread B77S
just use indexing. without doing it all for you... df <- structure(list(AA = c(0.3, 0.1, 0.6), BB = c(0.9, 0.4, 0.2), CC = c(1, 0.8, 0.6), DD = c(0.7, 0.5, 0.5)), .Names = c("AA", "BB", "CC", "DD"), class = "data.frame", row.names = c(NA, -3L )) write.csv(df[,1], paste(colnames(df[1]), "csv

Re: [R] similarity matrix

2011-12-04 Thread B77S
I apologize to the list and you if I am mis-understanding something, but... As an example: ind2 occurs with ind1 only in cluster#3, so why does it get a value of 4 in your "similarity" matrix? Also, if this isn't a recognized similarity algorithm, perhaps you should at the very least put quotes a

Re: [R] similarity matrix

2011-12-05 Thread B77S
That really all depends on what you need; and I can't tell you what you need. set wrote > > I'm sorry, I made a mistake in my example. you're right. I don't really > know how a similarity alogrithm worksbut I'm willing to try that...are > there any good examples available? > Thank you >

Re: [R] Why can't I figure this out? :S

2011-12-05 Thread B77S
Why can't you figure this out? I think you already know the answer: "I don't speak computer". Time to learn, or get another job I suppose. I hope you at least speak math-statistics if you are going to attempt to understand this. The only way you are going to be able to figure that code ou

Re: [R] frequency table?

2011-12-05 Thread B77S
Set, This is the same post as your "Similarity Matrix" post. I'm not trying to be a smart ass here, but ... ?Can you fit a square peg in a round hole?... yes, but it doesn't mean it belongs there. I suggest you get a piece of paper and a pencil and figure out 1) what you are trying to do and w

Re: [R] Problem with xlsx package

2011-12-07 Thread B77S
If all else fails, open it in Excel... save as .csv read.csv() Nikhil Joshi wrote > > I am trying to read an xlsx spreadsheet (1506 rows, 501columns) all > populated but getting the following error: > Please advise as to how to get around this issue. > >> res <- read.xlsx("c:\\BSE_v2.xlsx",1

Re: [R] profile likelihood

2011-12-08 Thread B77S
Try posting this question at least 1 more time. plocq wrote > > Hi, > > I try to use the function profile() of the SpatialExtremes' package to > obtain the profile likelihood of parameters for an extreme values fit > based on Poisson process : > > fit<-fpot(data, threshold, model="pp", npp=

Re: [R] Help with study guide for R exam

2011-12-09 Thread B77S
343GS You should consider dropping out of college; I don't think you belong there. McDonalds is hiring. 343GS wrote > > Thanks for nothing, jerk! DENMARK IS POO > -- View this message in context: http://r.789695.n4.nabble.com/Help-with-study-guide-for-R-exam-tp4173951p4178139.html Sent fro

Re: [R] Automated Regressions

2011-12-12 Thread B77S
I don't know why you had "c in a(1:2000))" c is a function see ?c ... and you want "a" (the row number in SQL_Code) to change with each iteration in the loop. Perhaps this might work (I'm not saying this is the best option, just a potential fix for what you have): for (a in 1:2000) { Dataset

Re: [R] Identifying Package for Function

2011-09-22 Thread B77S
Where is dropvalue(s) mentioned? > ?subset subset: logical expression indicating elements or rows to keep: missing values are taken as false. select: expression, indicating columns to select from a data frame. drop: passed on to ‘[’ indexing operator. ...: further arg

Re: [R] Help with Integration Output

2011-09-24 Thread B77S
It is not simply the answer, it is a list str(integrate(dnorm, -1.96, 1.96)) List of 5 $ value : num 0.95 $ abs.error : num 1.05e-11 $ subdivisions: int 1 $ message : chr "OK" $ call: language integrate(f = dnorm, lower = -1.96, upper = 1.96) - attr(*, "class")= chr "i

Re: [R] Data import

2011-09-25 Thread B77S
I have never used that function, but I know that with read.csv() you can do the following to select only the columns you want: chosen_vars <- read.csv("Workbook1.csv", header=T)[c("variable1", "variable3")] HTH sassorauk wrote: > > Is it possible to import only certain variables from a SPSS fi

Re: [R] Data import

2011-09-27 Thread B77S
I see what you mean. Sorry and thanks for pointing that out to me Ben. bbolker wrote: > > B77S auburn.edu> writes: > >> >> I have never used that function, but I know that with read.csv() you can >> do >> the following to select only the columns you

Re: [R] For loop for subset - repeating same over and over?

2011-09-29 Thread B77S
The first suggestion would be to use dput() to allow people on here to access your data. see ?dput I think you will want to post the output from: dput(QInflAvgbyPlot) ## or whatever object contains your data kelseyann wrote: > > Hello, I am using the following script to run an anova fo

Re: [R] matrix multiplication

2011-10-11 Thread B77S
Your question as answered by Timothy in your previous thread http://r.789695.n4.nabble.com/Re-Creating-the-mean-using-algebra-matrix-td3895689.html flokke wrote: > > Dear all, > Sorry to bother you with such a stupid question, but I just cannot find > the solution to my problem. > > I'd lik

Re: [R] p value in R - beginners question

2011-10-18 Thread B77S
This is just scientific notation, so 8.15e-01 is the same as: > 8.15*10^-1 [1] 0.815 niki wrote: > > Dear all, > > i have done some regression analyses but i do not understand the p value. > These are the results > >t-value p value > geno.1

Re: [R] Working With Variables Having Different Lengths

2011-10-21 Thread B77S
I know in my experience "Cond" (conductivity??) doesn't vary much within a stream except for during high flow events, and I would imagine the same is true for TDS. If these are all low flow values, you could possibly determine a mean/median value to use for the missing data points. Obviously this

Re: [R] how to delete rows by a list of rownames

2011-10-23 Thread B77S
here is one way df1 <- data.frame(c(1:20), c(21:40), c(31:50)) list1 <- c(3, 6, 20) df2 <- df1[-list1,] hanansela wrote: > > Hello > I have a list of row names that needs to be deleted from a data frame. How > do i do that? > one of the columns in the data frame contains the row names as nu

Re: [R] Syntax Help for xyplot()

2011-10-24 Thread B77S
Why not format the data like this: site sampledate SO4 TDS NA Mg Cond Cl Ca i.e. with a column for each parameter? It seems to me that you summary doesn't make any sense. Those quantiles are meaningless as they encompass all the parameters. Am I missing something? Rich Shepard wrote: > >

Re: [R] Syntax Help for xyplot()

2011-10-24 Thread B77S
sampdate, param as id variables site sampdate Cond SO4 TDS 1 BC-0.5 1996-06-02 NA 194 530 2BC-2 1994-07-25 826 NA NA 3BC-2 1994-10-19 848 NA NA 4BC-2 1995-03-16 1795 NA NA 5BC-2 1995-06-21 640 NA NA 6BC-3 1994-01-20 406 NA NA 7BC-3 1994-02-17 401 NA N

Re: [R] help with unequal variances

2011-11-01 Thread B77S
the following is a more appropriate forum for your question, seeing as this has nothing to do with R (per se). http://stats.stackexchange.com/questions good luck. peak99 wrote: > > Hello, > > I have some patient data for my masters thesis with three groups (n=16, 19 > & 20) > > I have com

Re: [R] Subsampling-oversampling from a data frame

2011-11-01 Thread B77S
If no one has a better solution, split it, take a sample of size X from both and put it back together. hgwelec wrote: > > Dear members, > > Consider the following data frame (first 4 rows shown) > > > age sex class > 15 m low > 20 f high > 15 f low > 10 m low > > in

Re: [R] Subsampling-oversampling from a data frame

2011-11-01 Thread B77S
# Perhaps I misunderstand your original need, but ## I added a few lines to your data and used dput() to get the below data (I named "df") df<- structure(list(age = c(15L, 20L, 15L, 10L, 10L, 12L, 17L, 17L, 11L, 12L, 16L, 20L, 23L, 14L, 22L, 16L, 10L, 11L, 21L, 10L, 13L, 17L), sex = struct

Re: [R] Correlation analysis

2011-11-06 Thread B77S
I would start by reading one or more of the introduction manuals available here: http://mirrors.ibiblio.org/pub/mirrors/CRAN/ wizi wrote: > > Hi everyone, > > I am new to R-project. I did search through the list for my problem but i > can't find it. I am sorry if this question has been

Re: [R] Interpreting Multiple Linear Regression Summary

2011-11-09 Thread B77S
Please see ?dput use dput(your data) and paste the output into a reply, thanks. This way we know what you are working with. Rich Shepard wrote: > > I would appreciate pointers on what I should read to understand this > output: > > summary(lm(TDS ~ Cond + Ca + Cl + Mg + Na + SO4)) > > Ca

Re: [R] Interpreting Multiple Linear Regression Summary

2011-11-09 Thread B77S
There is only one row with a complete set of observations; I think lm() is throwing out the rest. Rich Shepard wrote: > > On Wed, 9 Nov 2011, John C Frain wrote: > >> As far as I know if there is an NA in any variable in an observation the >> default is to drop the entire observation. Thus the

Re: [R] Interpreting Multiple Linear Regression Summary

2011-11-09 Thread B77S
, 156L, 140L, 128L, 160L, 215L, 230L, 316L, 163L)), .Names = c("Ca", "Cl", "Cond", "Mg", "Na", "SO4", "TDS"), class = "data.frame", row.names = c(NA, -64L)) B77S wrote: > > Please see ?dput > > use d

Re: [R] multivariate modeling codes

2011-11-11 Thread B77S
Not sure if this helps, but did you try Google? http://www.jstatsoft.org/v35/i09/paper http://cran.r-project.org/web/packages/lcmm/lcmm.pdf http://www.warwick.ac.uk/statsdept/useR-2011/abstracts/010411-liquetbenoit.pdf yurirouge wrote: > > HI, > > I am relatively new to R and would appreci

Re: [R] Calculating & plotting a linear regression between two correlated variables

2012-01-23 Thread B77S
I know this isn't what you are asking, but have you considered examining the relationship between dA and the community density excluding dA? JulieV wrote > > Hi Josh, > > Thanks for your response ! > > Actually, I already tried to plot it with a "classical" regression and I > know the rel

Re: [R] R not giving significance tests for coefficients/estimates?

2012-01-23 Thread B77S
> 3x4 Error: unexpected symbol in "3x4" R has no idea that you equate "x" as multiplication.. use an astrix > 3*4 [1] 12 dominic wrote > > This is basically my code: > > library(MASS) > lmsreg(formula = b0 ~ b1 + b3 + b1xb2, data=mydata) > > b1xb2 is an interaction but it was the centere