# Returning the coef from two coordinates

9 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Returning the coef from two coordinates

 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.  :)
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 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
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 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.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 In reply to this post by Hans Thompson 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 <[hidden email]> 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______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 Where can I find the posting guide?  I've been trying to use "A handbook of Statistical Analyses Using R" and google searching but I will be reading "An Introduction to R" now that I see its better to starting out then using the "?function".  sorry.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 In reply to this post by Hans Thompson 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 comes Them? > 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 ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Returning the coef from two coordinates

 In reply to this post by Hans Thompson There's a link to it at the end of every R-Help posting. Michael On Apr 27, 2012, at 5:47 PM, Hans Thompson <[hidden email]> wrote: > Where can I find the posting guide?  I've been trying to use "A handbook of > Statistical Analyses Using R" and google searching but I will be reading "An > Introduction to R" now that I see its better to starting out then using the > "?function".  sorry. > > -- > View this message in context: http://r.789695.n4.nabble.com/Returning-the-coef-from-two-coordinates-tp4593504p4593801.html> Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [hidden email] 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. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.