Re: [R] error in plotting model from kernlab

2019-01-08 Thread PIKAL Petr
Hi As I said I have no experience with kernlab but I can read in manual: "probabilities matrix of class probabilities (one column for each class and one row for each input)" from which I understand that pred is matrix, which should have the same number of rows as df$cons but several columns.

[R] R help: circular dendrogram

2019-01-08 Thread N Meriam
Dear all, I generated a circular dendrogram with R (see attached). I have a total of 360 landraces. What I want to do next is generate a different color for each cluster and also generate colors to show the country/region. I don't know if it's also possible to put a code number (associated with ea

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread N Meriam
Yes, sorry. I attached the file once again. Well, still getting the same warning. > class(genod) <- "numeric" Warning message: In class(genod) <- "numeric" : NAs introduced by coercion > class(genod) [1] "matrix" Then, I run the following code and it gives this: > filn <-"simTunesian.gds" > snpg

Re: [R] objects are masked _by_ '.GlobalEnv'

2019-01-08 Thread Jeff Newmiller
There is a mailing list for questions about packages... see the Posting Guide. On January 8, 2019 11:48:37 AM PST, Troels Ring wrote: >Dear friends - this is really a question I'm sorry about since it >doesn't >follow the requirements. I have made a R package via RStudio and it >causes >problems

Re: [R] External validation for a hurdle model (pscl)

2019-01-08 Thread Jeff Newmiller
That said, the gist of the OP's outline is correct, and the main reason to look elsewhere is to get more thorough advice on what statistical concerns should be addressed than would be on topic here. One comment: reviewing plots of differences versus various independent variables for systematic

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread David L Carlson
Your attached file is not a .csv file since the field are not separated by commas (just rename the mydata.csv to mydata.txt). The command "genod2 <- as.matrix(genod)" created a character matrix from the data frame genod. When you try to force genod2 to numeric, the marker column becomes NAs wh

Re: [R] Question

2019-01-08 Thread Jeff Newmiller
Er, just keep it simple, Marc... give one option: library(lattice) If you _ever_ use require() without acting upon the return value then you are setting yourself or someone else up for confusing missing objects errors someday for no good reason. This _isn't_ just personal preference... by choo

[R] objects are masked _by_ '.GlobalEnv'

2019-01-08 Thread Troels Ring
Dear friends - this is really a question I'm sorry about since it doesn't follow the requirements. I have made a R package via RStudio and it causes problems when I try to load some data from within the package. I'm on windows, R version 3.5.1 (2018-07-02). When I am in the directory with the

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread N Meriam
Here's a portion of what my data looks like (text file format attached). When running in R, it gives me this: > df4 <- read.csv(file = "mydata.csv", header = TRUE) > require(SNPRelate) > library(gdsfmt) > myd <- df4 > myd <- df4 > names(myd)[-1] [1] "marker" "X88""X9" "X17""X25" > myd[

Re: [R] Question

2019-01-08 Thread Rich Shepard
On Tue, 8 Jan 2019, Bert Gunter wrote: I think it's ?install.packages Bert, Of course it is. My apologies to the original poster. Rich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] Question

2019-01-08 Thread Rich Shepard
On Tue, 8 Jan 2019, Marc Schwartz wrote: lattice is a "recommended" package, which means that it is installed by default with any standard R installation. Marc, Thanks for the reminder. Regards, Rich __ R-help@r-project.org mailing list -- To U

Re: [R] Question

2019-01-08 Thread Marc Schwartz via R-help
Guys, lattice is a "recommended" package, which means that it is installed by default with any standard R installation. Thus, all that is required, as Sarah noted in an earlier reply, is either: library(lattice) or require(lattice) depending upon preference. latticeExtra, on the other

[R] Recursive feature elimination keeping the weights constant

2019-01-08 Thread Priyanka Purkayastha
Dear All, I am trying to build a model by doing recursive elimination of weights one by one. This is the example matrix ID 885038 885039 885040 885041 885042 885043 Label weights 0.000236 0.004591 0.00017 0.018113 0.000238 0.006537 N/A 1267359 2 0 0 0 0 1 1 1295720 0 0 0 0 0 1 1 1295721

Re: [R] External validation for a hurdle model (pscl)

2019-01-08 Thread Bert Gunter
This list is (mostly) about R programming. Your query is (mostly) about statistics. So you should post on a statistics site like stats.stackexchange.com not here; I am pretty sure you'll receive lots of answers there. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people

Re: [R] Question

2019-01-08 Thread Bert Gunter
I think it's ?install.packages Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Jan 8, 2019 at 9:50 AM Rich Shepard wrote: > On Tue, 8 Jan 2019, S. Mahmou

[R] External validation for a hurdle model (pscl)

2019-01-08 Thread Maria Eugenia Utgés
Hi R-list, We have constructed a hurdle model some time ago. Now we were able to gather new data in the same city (38 new sites), and want to do an external validation to see if the model still performs ok. All the books and lectures I have read say its the best validation option but... I have made

Re: [R] Question

2019-01-08 Thread Rich Shepard
On Tue, 8 Jan 2019, S. Mahmoud Nasrollahi wrote: I have got a problem during working with some package in R and in spite of trying with R help, internet and any other resources I could not succeed. Indeed when I what to install some function like bwplot, boxplot, xyplot I receive this sort of me

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread Michael Dewey
Dear Meriam Your csv file did not come through as attachments are stripped unless of certain types and you post is very hard to read since you are posting in HTML. Try renaming the file to .txt and set your mailer to send plain text then people may be able to help you better. Michael On

Re: [R] Mailinglist

2019-01-08 Thread Richard M. Heiberger
please post a sample dataset based on mydata <- rbind[participant1[1:3,], participant2[1:4,], participant3[1:5,]) I think mydata at this point is anonymized enough that you can post it. Verify with whomever, though. You might want to change those random U* names of the participants to c("A","B","

Re: [R] error in plotting model from kernlab

2019-01-08 Thread Luigi Marongiu
Hi, the maintainer hasn't answered yet. The problem with 'acc' is that yes the objects are not of the same length but they should be: according to the manual, ' table(pred, df$cons)' would return a 2x2 matrix of the results. This is not the case, so there is a problem with the model -- that is why

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread N Meriam
I see... Here's a portion of what my data looks like (csv file attached). I run again and here are the results: df4 <- read.csv(file = "mydata.csv", header = TRUE) > require(SNPRelate)> library(gdsfmt)> myd <- df4> myd <- df4> > names(myd)[-1][1] "marker" "X88""X9" "X17""X25" > myd[

Re: [R] Mailinglist

2019-01-08 Thread Rachel Thompson
Hi Thank you for your help and suggestions! I have tried a few things and ask help from lots of people online! My problem is that I am not able to share the database! I tried to recreate one but I wasn't successful. So I found a way to analyze each subject individually, but I do not know how to p

Re: [R] Mailinglist

2019-01-08 Thread Rachel Thompson
Hi Thank you for your help and suggestions! I have tried a few things and ask help from lots of people online! My problem is that I am not able to share the database! I tried to recreate one but I wasn't successful. So I found a way to analyze each subject individually, but I do not know how to p

Re: [R] Mailinglist

2019-01-08 Thread Rachel Thompson
Hi Thank you for your help and suggestions! I have tried a few things and ask help from lots of people online! My problem is that I am not able to share the database! I tried to recreate one but I wasn't successful. So I found a way to analyze each subject individually, but I do not know how to p

Re: [R] Mailinglist

2019-01-08 Thread Rachel Thompson
Hi Thank you for your help and suggestions! I have tried a few things and ask help from lots of people online! My problem is that I am not able to share the database! I tried to recreate one but I wasn't successful. So I found a way to analyze each subject individually, but I do not know how to p

Re: [R] error in plotting model from kernlab

2019-01-08 Thread PIKAL Petr
Hi I cannot help you with kernlab > > pred = predict(mod, df, type = "probabilities") > > acc = table(pred, df$cons) > Error in table(pred, df$cons) : all arguments must have the same length > which again is weird since mod, df and df$cons are made from the same > dataframe. Why not check leng

Re: [R] Warning message: NAs introduced by coercion

2019-01-08 Thread PIKAL Petr
Hi see in line > -Original Message- > From: R-help On Behalf Of N Meriam > Sent: Tuesday, January 8, 2019 3:08 PM > To: r-help@r-project.org > Subject: [R] Warning message: NAs introduced by coercion > > Dear all, > > I have a .csv file called df4. (15752 obs. of 264 variables). > I appl

Re: [R] Question

2019-01-08 Thread Sarah Goslee
xyplot is not a package, it is a function within the lattice package, which should already be installed. library(lattice) # load the package from the R library ?xyplot # look at the help for the function The others are also functions, not packages. Sarah On Tue, Jan 8, 2019 at 9:15 AM S. Mahmou

[R] Question

2019-01-08 Thread S. Mahmoud Nasrollahi
Dear colleague I have got a problem during working with some package in R and in spite of trying with R help, internet and any other resources I could not succeed. Indeed when I what to install some function like bwplot, boxplot, xyplot I receive this sort of messages: Warning in install.packages

[R] Warning message: NAs introduced by coercion

2019-01-08 Thread N Meriam
Dear all, I have a .csv file called df4. (15752 obs. of 264 variables). I apply this code but couldn't continue further other analyses, a warning message keeps coming up. Then, I want to determine max and min similarity values, heat map plot, cluster...etc > require(SNPRelate) > library(gdsfmt) >

Re: [R] Why does R do this?

2019-01-08 Thread Duncan Murdoch
On 08/01/2019 4:28 a.m., Nick Wray via R-help wrote: y<-c(1,2,3) z<-which(y>3) At this point z is a vector with no entries in it. z y<-y[-z] -z is the same vector. So y[z] and y[-z] are the same. y In the work I'm doing I often have this situation and have to make sure that I condition

Re: [R] Why does R do this?

2019-01-08 Thread PIKAL Petr
Hi It is documented behaviour. "An empty index selects all values: this is most often used to replace all the entries but keep the attributes." so I presume that changing it could break huge amount of code. The only workaround could be to check "z" before using it for indexing. e.g. > if(leng

Re: [R] Why does R do this?

2019-01-08 Thread Thierry Onkelinx via R-help
Dear Nick, The best solution is not to use which() but directy use the logical test. This will work in case the condition is always FALSE and which() returns a integer(0). And it is much faster too. z <- y > 3 y[!z] library(microbenchmark) microbenchmark( y[!y > 3], y[-which(y > 3)] ) Best r

[R] Why does R do this?

2019-01-08 Thread Nick Wray via R-help
y<-c(1,2,3) z<-which(y>3) z y<-y[-z] y In the work I'm doing I often have this situation and have to make sure that I condition on z being non-zero as y is now numeric(0) rather than the set c(1,2,3). Why does R do this? Wouldn't it be more sensible for R to simply leave the host set unchange