Thank you to everyone in this forum that has been helping me with the basic R skills while I learn to apply them. I would like to take the coefficient of two coordinates. One of them comes from two different columns in a table:>Ax y a 1 3 b 2 2 c 3 1 the other is set and for this question I'll just call it (1,1) I've been trying to find a way to return the coefficient values for a,b, and c through (1,1). Also, it looks like my questions are very basic compared to the others being asked on this forum so please let me know if I am out of place. :) -- View this message in context: http://r.789695.n4.nabble.com/Returning-the-coef-from-two-coordinates-tp4593504p4593504.html Sent from the R help mailing list archive at Nabble.com.
Hello, Hans Thompson wrote> > Thank you to everyone in this forum that has been helping me with the > basic R skills while I learn to apply them. > > I would like to take the coefficient of two coordinates. One of them > comes from two different columns in a table: > > >>A > x y > a 1 3 > b 2 2 > c 3 1 > > the other is set and for this question I'll just call it (1,1) > > I've been trying to find a way to return the coefficient values for a,b, > and c through (1,1). > > Also, it looks like my questions are very basic compared to the others > being asked on this forum so please let me know if I am out of place. :) >Sorry, but I'm not understanding what (1, 1) is. Are those the matrix A coordinates, (row, col)? If so, use an index matrix, with two columns. Here is an example. elm1 <- c(1, 1) elm2 <- c(2, 1) inx <- matrix(c(elm1, elm2), ncol=2, byrow=TRUE) colnames(inx) <- c("Row", "Col") inx A[inx] Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/Returning-the-coef-from-two-coordinates-tp4593504p4593723.html Sent from the R help mailing list archive at Nabble.com.
I meant (1,1) as an (x,y) coordinate. I am trying to find the function to return the coefficient of the line running through:>Bx y a 1 1 and all the points in:>Ax y a 1 3 b 2 2 c 3 1 hope that is more clear. Thanks again Rui. -- View this message in context: http://r.789695.n4.nabble.com/Returning-the-coef-from-two-coordinates-tp4593504p4593754.html Sent from the R help mailing list archive at Nabble.com.
Have you read "An Introduction to R" or other basic R tutorial? I don't completely understand what you're asking (I was unable to decipher"coefficients of two coordinates") , but it seems shockingly basic. Before posting to this list, you should at least make some effort to learn basic skills on your own. ... and when you do post, please follow the posting guide and frame your questions more clearly (although maybe it's just me here...). -- Bert On Fri, Apr 27, 2012 at 12:04 PM, Hans Thompson <hans.thompson1 at gmail.com> wrote:> Thank you to everyone in this forum that has been helping me with the basic R > skills while I learn to apply them. > > I would like to take the coefficient of two coordinates. ?One of them comes > from two different columns in a table: > > >>A > ? ? x ? y > a ?1 ? 3 > b ?2 ? 2 > c ?3 ? 1 > > the other is set and for this question I'll just call it (1,1) > > I've been trying to find a way to return the coefficient values for a,b, and > c through (1,1). > > ?Also, it looks like my questions are very basic compared to the others > being asked on this forum so please let me know if I am out of place. ?:) > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Returning-the-coef-from-two-coordinates-tp4593504p4593504.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org 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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
You mean like a linear regression? ?lm You might benefit from reading at the very least An Introduction to R and the posting guide to this list. Sarah On Fri, Apr 27, 2012 at 5:08 PM, Hans Thompson <hans.thompson1 at gmail.com> wrote:> I meant (1,1) as an (x,y) coordinate. ?I am trying to find the function to > return the coefficient of the line running through: > >>B > ? ?x ?y > a ?1 ?1 > > and all the points in: > >>A > ? ? x ? y > a ?1 ? 3 > b ?2 ? 2 > c ?3 ? 1 > > hope that is more clear. ?Thanks again Rui. >-- Sarah Goslee http://www.functionaldiversity.org
On Apr 27, 2012, at 3:04 PM, Hans Thompson wrote:> Thank you to everyone in this forum that has been helping me with > the basic R > skills while I learn to apply them. > > I would like to take the coefficient of two coordinates.The coefficient .... of what?> One of them comesThem?> from two different columns in a table: > > >> A > x y > a 1 3 > b 2 2 > c 3 1 > > the other is set and for this question I'll just call it (1,1)The other .... what?> > I've been trying to find a way to return the coefficient values for > a,b, and > c through (1,1). > > Also, it looks like my questions are very basic compared to the others > being asked on this forum so please let me know if I am out of > place. :)You are perhaps out of place if you are expecting us to read your mind. (I have often wondered whether a ban on the indefinite pronoun would be a good rule for rhelp.) -- David Winsemius, MD West Hartford, CT
On Fri, Apr 27, 2012 at 02:08:09PM -0700, Hans Thompson wrote:> I meant (1,1) as an (x,y) coordinate. I am trying to find the function to > return the coefficient of the line running through: > > >B > x y > a 1 1 > > and all the points in: > > >A > x y > a 1 3 > b 2 2 > c 3 1Hi. If you want three coefficients, one for each point in A, then try C <- sweep(A, 2, B) C[, 2]/C[, 1] [1] Inf 1 0 Petr Savicky.