Re: [R] Matrix logical operator

2017-07-16 Thread Berend Hasselman
> On 17 Jul 2017, at 07:27, Jeremie Juste wrote: > > > Hello, > > I have some trouble understanding why !b &&TRUE is TRUE. Do you have an idea? > > >> b <- matrix(c(0,1,1,0,1,0),2) > >> !b > [,1] [,2] [,3] > [1,] TRUE FALSE FALSE > [2,] FALSE TRUE TRUE >> !b &&TRUE > [1] TRUE >

[R] Matrix logical operator

2017-07-16 Thread Jeremie Juste
Hello, I have some trouble understanding why !b &&TRUE is TRUE. Do you have an idea? > b <- matrix(c(0,1,1,0,1,0),2) > !b [,1] [,2] [,3] [1,] TRUE FALSE FALSE [2,] FALSE TRUE TRUE > !b &&TRUE [1] TRUE Best regards, Jeremie __ R-help@r-

Re: [R] About doing figures

2017-07-16 Thread Jim Lemon
Hi lily, To answer your questions more or less in order: rainbow() is an easy way to get a small number of distinct colors. You only had nine unique values in "dfm$A". Obviously it gets harder to distinguish colors when you have more of them, so just increasing the number that rainbow() returns wi

Re: [R] Arranging column data to create plots

2017-07-16 Thread Jeff Newmiller
Correction at the end. On Sun, 16 Jul 2017, Jeff Newmiller wrote: On Sat, 15 Jul 2017, Michael Reed via R-help wrote: Dear All, I need some help arranging data that was imported. It would be helpful if you were to use dput to give us the sample data since you say you have already imported

Re: [R] Arranging column data to create plots

2017-07-16 Thread Jeff Newmiller
On Sat, 15 Jul 2017, Michael Reed via R-help wrote: Dear All, I need some help arranging data that was imported. It would be helpful if you were to use dput to give us the sample data since you say you have already imported it. The imported data frame looks something like this (the actual

Re: [R] label sunflower point

2017-07-16 Thread David Winsemius
> On Jul 16, 2017, at 6:36 AM, Nada Gh wrote: > > Hi, > > I create a plot using sunflowerplot, I need to highlight one point to show > its importance. What suggestion you have to accomplish this? > > Thanks, > Aden > > [[alternative HTML version deleted]] Please read the Posting Guide.

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Jeff Newmiller
I am stuck. The archive package won't compile for me on Ubuntu, and the CRANextra repo seems to be down so I cannot install packages on Windows right now. Perhaps you can zip the corrupt text file and put it online somewhere? Don't use the archive package to pack it since there seem to be issues

Re: [R] select from data frame

2017-07-16 Thread Andras Farkas via R-help
thank you David and Bert, these solutions will work for me... Andras  On Saturday, July 15, 2017 6:05 PM, Bert Gunter wrote: ... and here is a slightly cleaner and more transparent way of doing the same thing (setdiff() does the matching) > with(df, setdiff(ID,ID[samples %in% c("B","C"

[R] label sunflower point

2017-07-16 Thread Nada Gh
Hi, I create a plot using sunflowerplot, I need to highlight one point to show its importance. What suggestion you have to accomplish this? Thanks, Aden [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIB

Re: [R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-16 Thread David Winsemius
> On Jul 16, 2017, at 8:47 AM, Bert Gunter wrote: > > ?? > If I haven't misunderstood, they are completely different! > > 1) NIR must be a matrix, or poly(NIR,...) will fail. > 2) Due to the previously identified bug in poly, degree must be > explicitly given as poly(NIR, degree =2,raw = TRUE).

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Anthony Damico
hi, yep, there are two problems -- but i think only the segfault is within the scope of a base R issue? i need to look closer at the corrupted decompression and figure out whether i should talk to the brazilian government agency that creates that .rar file or open an issue with the archive package

Re: [R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-16 Thread Bert Gunter
?? If I haven't misunderstood, they are completely different! 1) NIR must be a matrix, or poly(NIR,...) will fail. 2) Due to the previously identified bug in poly, degree must be explicitly given as poly(NIR, degree =2,raw = TRUE). Now consider the following example: > df <-matrix(runif(60),ncol

Re: [R] About doing figures

2017-07-16 Thread lily li
For more than 10 records, how to reformat the colors? Also, how to show the first legend only, but at the bottom, while the second legend in your code is not necessary? In all, the same A values have the same color, but different symbols in DF==1 and DF==2. Thanks for your help. On Sun, Jul 16, 20

Re: [R] About doing figures

2017-07-16 Thread lily li
Hi Jim, For true color, I meant that the points in the figure do not correspond to the values from the dataframe. Also, why to use rainbow(9) here? And the legend is straight in the middle, is it possible to reformat it to the very bottom? Thanks again. On Sun, Jul 16, 2017 at 2:50 AM, Jim Lemon

Re: [R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-16 Thread David Winsemius
> On Jul 13, 2017, at 7:43 AM, Bert Gunter wrote: > > Below. > > -- Bert > Bert Gunter > > > > On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini > wrote: >> I have two ideas about it. >> >> 1- >> i) Entering variables in quadratic form is done with the command I >> (variable ^ 2) - >> plsr (

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Jeff Newmiller
So you are saying there are two problems... one that produces a corrupt file from a valid compressed file, and one that segfaults when presented with that corrupt file? Can you please confirm the file name and run md5sum on it and share the result so we can tell when the file problem has been re

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Anthony Damico
hi, the text file that prompts the segfault is 4gb but only 80,937 lines > file.info( "S:/temp/crash.txt") size isdir mode mtime ctime atime exe S:/temp/crash.txt 4078192743 FALSE 666 2017-07-15 17:24:35 2017-07-15 17:19:47 2017-07-15 17:19:47

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Duncan Murdoch
On 16/07/2017 6:17 AM, Anthony Damico wrote: thank you for taking the time to write this. i set it running last night and it's still going -- if it doesn't finish by tomorrow, i will try to find a site to host the problem file and add that link to the bug report so the archive package can be avo

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Anthony Damico
sorry, typo, 80937 not 809367 On Sun, Jul 16, 2017 at 6:21 AM, Anthony Damico wrote: > hi, thank you for attempting this. it looks like your unix machine > unzipped the txt file without corruption -- if you copied over the same txt > file to windows 7, i don't think that would reproduce the prob

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Anthony Damico
hi, thank you for attempting this. it looks like your unix machine unzipped the txt file without corruption -- if you copied over the same txt file to windows 7, i don't think that would reproduce the problem? i think it needs to be the corrupted text file where R.utils::countLines( txtfile )

Re: [R] readLines without skipNul=TRUE causes crash

2017-07-16 Thread Anthony Damico
thank you for taking the time to write this. i set it running last night and it's still going -- if it doesn't finish by tomorrow, i will try to find a site to host the problem file and add that link to the bug report so the archive package can be avoided at least. i'm sorry for the bother On Sa

Re: [R] About doing figures

2017-07-16 Thread Jim Lemon
Hi lily, As I have no idea of what the "true record" is, I can only guess. Maybe this will help: # get some fairly distinct colors rainbow_colors<-rainbow(9) # this should sort the numbers in dfm$A dfm$Acolor<-factor(dfm$A) plot(dfm$B,dfm$C,pch=ifelse(dfm$DF==1,1,19), col=rainbow_colors[as.numeri

Re: [R] Arranging column data to create plots

2017-07-16 Thread Ulrik Stervbo
Hi Michael, Try gather from the tidyr package HTH Ulrik Michael Reed via R-help schrieb am So., 16. Juli 2017, 10:19: > Dear All, > > I need some help arranging data that was imported. > > The imported data frame looks something like this (the actual file is > huge, so this is example data) >

Re: [R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-16 Thread Ng, Kelvin Sai-cheong
I see. Thank you for the help. On Thu, Jul 13, 2017 at 10:43 PM, Bert Gunter wrote: > Below. > > -- Bert > Bert Gunter > > > > On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini > wrote: > > I have two ideas about it. > > > > 1- > > i) Entering variables in quadratic form is done with the command

[R] Arranging column data to create plots

2017-07-16 Thread Michael Reed via R-help
Dear All, I need some help arranging data that was imported. The imported data frame looks something like this (the actual file is huge, so this is example data) DF: IDKey X1 Y1 X2 Y2 X3 Y3 X4 Y4 Name1 21 15 25 10 Name2 15 18 35 24 27 45 Name3 17 21 30 22 15 40 32 55