[R] Question regarding dataframes, matrix, frame, etc...

stephen sefick ssefick at gmail.com
Tue Jun 16 17:12:07 CEST 2009


plot(as.numeric(asdf[,1:7]))

On Tue, Jun 16, 2009 at 11:10 AM, stephen sefick<ssefick at gmail.com> wrote:
> plot(asdf[,1:7])
>
> On Tue, Jun 16, 2009 at 10:58 AM, njhuang86<njhuang86 at yahoo.com> wrote:
>>
>> Hi all,
>>
>> As of now, I have a 15x8 matrix (name is "asdf"). The first seven columns
>> contain numbers while the last column contains a string. The class of each
>> column is "character". When I use the plot function to display a scatter
>> plot between any of the two columns, ie. plot(asdf[, 1], asdf[, 2])
>> everything works fine. However, if I want to use the command "pairs" to show
>> all combination of scatter plots between the first seven columns (without
>> the columns of strings), it gives me a error message telling me that I'm
>> passing a non-numeric arguement to 'pairs'.
>>
>> As a result, I changed the original matrix into a dataframe via.
>> as.data.frame(asdf) so the columns are of the class "factor". However, when
>> I now utilize the pairs command to plot the scatterplots of the first seven
>> columns, the scatterplots are totally off. I think that the pairs command
>> changes all the factor columns into numeric columns - and by performing this
>> class transformation, the values within each column are also physically
>> changed.
>>
>> I'm just really lost. Is there a way to utilize the pairs command in my
>> setting? Or is there a method to change the class of each column without
>> physically altering the values? Anyways, thanks in advance!!!
>> --
>> View this message in context: http://www.nabble.com/Question-regarding-dataframes%2C-matrix%2C-frame%2C-etc...-tp24056147p24056147.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.
>>
>
>
>
> --
> Stephen Sefick
>
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods.  We are mammals, and have not exhausted the
> annoying little problems of being mammals.
>
>                                                                -K. Mullis
>



-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis




More information about the R-help mailing list