Re: [R] Issues with fa() function in psych

2014-05-16 Thread sagnik chakravarty
Hi William, Thanks for the update. I see this package has so many capabilities ! I will suggest further for its development if anything else comes to my mind. Regards, Sagnik On Thu, May 15, 2014 at 6:34 AM, William Revelle li...@revelle.net wrote: Sagnik, I did some more checking and in

[R] FW: needs help in augented plot

2014-05-16 Thread Mir Salam
Dear Med venlig hilsen and all Thanks a lot for your attention and valuable codes. I produced the graph using the follwing code. I fitted mixed effects dominant height model. The grpah is showing plot-specific dominant height against Age. aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)

Re: [R] needs help in augented plot

2014-05-16 Thread Frede Aakmann Tøgersen
Hi strip.custom() is a function in the lattice package so you need to load that package first library(lattice). You could also consider to not have that many panels on one page. Use the layout argument of the lattice plot functions to set the number of rows and columns of panel. See ?xyplot

Re: [R] problem solved in augented plot

2014-05-16 Thread Mir Salam
Dear Med venlig hilsen, Thanks for your valuable time and help. Finally I solved the peoblem based on your help. Best regards Abdus Salam Project Manager (ENPI) PhD student University of Eastern Finland (UEF) Finland From: Frede Aakmann Tøgersen

Re: [R] Markoc chain simulation of a sample path - to get empirical probabilities

2014-05-16 Thread Jim Lemon
On Thu, 15 May 2014 10:03:03 AM chantel777 wrote: Dear Chantel, The problem: A perplexed student decides to post her/his (note non-sexist usage) homework to the R help list on a Friday evening. On Monday morning, she finds that she/he has received five different answers. Realizing that

[R] solution for r-help to the problem of yahoo addresses bouncing?

2014-05-16 Thread Jannis
Hi R users, this is not R related but rather affects the r-help list in general but I hope that some r-help users may have found a solution. Since recently, i get messages like this from the list server: Your membership in the mailing list R-help has been disabled due to excessive

[R] Second axis on bottom of graph

2014-05-16 Thread Hurr
The first ten lines of code work OK temporariy. The final line is for a second more-usual axis. But if I say line=4 to prevent its overwriting the first axis, it goes off the graph page. How do I solve that prob;em? install.packages('plotrix') library(plotrix) horAxisLims=c(0,7213)

[R] create new rows with 0, if nessecary

2014-05-16 Thread Mat
hello togehter, i have a little problem, i have frames like this two: Cat Hours A101 15 B103 10 Cat Hours A103 16 B106 11 I need to convert this 2 data.frames into the following equal structure: Cat Hours A101 B

[R] neural network in R

2014-05-16 Thread azam jaafari
 Hello everybody   I try to fit a neural network on my data by using package 'neuralnet' or 'nnet'. I did it several times but I got an unexpected answer,   this is my code (num.obs=100): ( library('nnet') y-data.frame(data$CU) (y is cu concentration)

Re: [R] Second axis on bottom of graph

2014-05-16 Thread S Ellison
The first ten lines of code work OK temporariy. The final line is for a second more-usual axis. But if I say line=4 to prevent its overwriting the first axis, it goes off the graph page. How do I solve that prob;em? Change the plot margins before plotting using par(mar) Example:

Re: [R] create new rows with 0, if nessecary

2014-05-16 Thread Martyn Byng
Hi, Something like: aa -structure(list(Cat = c(101, 103), Hours = c(15, 10)), .Names = c(Cat,Hours), row.names = c(NA, -2L), class = data.frame) bb -structure(list(Cat = c(103, 106), Hours = c(16, 11)), .Names = c(Cat,Hours), row.names = c(NA, -2L), class = data.frame) dd -

Re: [R] Second axis on bottom of graph

2014-05-16 Thread Hurr
Thankyou S Ellison, The following code works preliminarily, To start-with, how do I omit the axis label? I tried xlab=NULL in the plot command install.packages('plotrix') library(plotrix) horAxisLims=c(0,7213) verData=c(1,365,809,1252,1753,2191,2922,3409,3896,4383,4819,5255,5691,6128,6564,7000)

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Jari Oksanen
Witold E Wolski wewolski at gmail.com writes: Looking for an fast dist implementation where I could pass my own dist function to the method parameter i.e. mydistfun = function(x,y){ return(ks.test(x,y)$p.value) #some mystique implementation } wow = dist(data,method=mydistfun)

Re: [R] create new rows with 0, if nessecary

2014-05-16 Thread David L Carlson
A bit simpler is to add the Hours column when creating the dd data.frame: dd - data.frame(Cat=min(aa[,1],bb[,1]):max(aa[,1],bb[,1]), Hours=0) Then just gg1 - merge(aa,dd,all=TRUE) gg2 - merge(bb,dd,all=TRUE) David Carlson -Original Message- From: r-help-boun...@r-project.org

Re: [R] Retrieving the matched data frame from Matching?

2014-05-16 Thread David L Carlson
The str() function will show you what is contained in m8. If you look at the manual page for Match: ?Match the section labeled Value gives more details on what results are returned by the Match() function. The print() and summary() functions usually show abbreviated results. In this case a

Re: [R] Second axis on bottom of graph

2014-05-16 Thread S Ellison
To start-with, how do I omit the axis label? I tried xlab=NULL in the plot command NULL is the default for xlab (see ?plot.default, which probably gives most of the information you need) Try 'xlab=' or xlab=NA. S *** This

[R] account

2014-05-16 Thread Tania Patiño
R-help could you please stop to send me messages thank you! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Witold E Wolski
Dear Jari, Thanks for your reply... The overhead would be 2 for loops for(i in 1:dim(x)[2]) for(j in i:dim(x)[2]) isn't it? Or are you seeing a different way to implement it? A for loop is pretty expensive in R. Therefore I am looking for an implementation similar to apply or lapply were the

Re: [R] Second axis on bottom of graph

2014-05-16 Thread Hurr
Sorry I didn't catch-on to xlab= earlier. The following code works preliminarily, now I need to add an axis-title to the added axis. I don't see axistitle in axis command selections. install.packages('plotrix') library(plotrix) horAxisLims=c(0,7213)

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Barry Rowlingson
On Fri, May 16, 2014 at 4:46 PM, Witold E Wolski wewol...@gmail.com wrote: Dear Jari, Thanks for your reply... The overhead would be 2 for loops for(i in 1:dim(x)[2]) for(j in i:dim(x)[2]) isn't it? Or are you seeing a different way to implement it? A for loop is pretty expensive in R.

[R] Using centers of hierarchical clustering for k-means

2014-05-16 Thread marioger
Hi, i have the following problem: I am using k-means algorithm for clustering. But instead of using randomized centers, I would like to use centers created by hierarchical clustering. So I want to apply hclust on my data set (in this case the iris data), getting a solution by cutree, calculating

Re: [R] create new rows with 0, if nessecary

2014-05-16 Thread arun
Hi David, It created duplicated Cat. gg1   Cat Hours 1 101 0 2 101    15 3 102 0 4 103 0 5 103    10 6 104 0 7 105 0 8 106 0 #Probably, gg1[!duplicated(gg1$Cat,fromLast=TRUE),]   Cat Hours 2 101    15 3 102 0 5 103    10 6 104 0 7 105 0 8 106 0 A.K.

[R] How to illustrate an interaction with plotLMER.fnc

2014-05-16 Thread Haverinen-Shaughnessy Ulla
Hello, I have built a linear mixed model (with lmer). To illustrate an interaction between two (originally) continuous variable, I would like to plot the effects of X1 versus Y for 1=low and 2=high X2. I am using plotLMER.fnc but have not been able to figure out the code. Could you help?

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Bert Gunter
Yes, ... and further apply-type functions still have to loop at the interpreter level, and generally take about the same time as their translation to for loops (with suitable caveats for this kind of vague assertion). Their chief advantage is readability and adherence to R's functional paradigm

Re: [R] How to illustrate an interaction with plotLMER.fnc

2014-05-16 Thread Christoph Scherber
Dear Ulla, Wouldn´t it be more straightforward to use John Fox´s effects package for this? library(effects) plot(effect(variable1:variable2,model)) Best wishes Christoph Am 16.05.2014 16:50, schrieb Haverinen-Shaughnessy Ulla: Hello, I have built a linear mixed model (with lmer). To

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Jari Oksanen
I did not regard the loops as the overhead but a part of the process. Overhead is setting attributes. The loop is not so very expensive compared to ks.test(). You can always replace the loop with an apply on the vector of indices, but about the only way to speed up calculations is to use

Re: [R] Second axis on bottom of graph

2014-05-16 Thread David L Carlson
?title Used for main titles, subtitles, and x/y labels. David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hurr Sent: Friday, May 16, 2014 10:59 AM To: r-help@r-project.org Subject: Re: [R] Second axis on bottom of graph

Re: [R] Using centers of hierarchical clustering for k-means

2014-05-16 Thread David L Carlson
This should get you started set.seed(42) x - matrix(rnorm(200, 25, 5), 40, 5) x.clus - hclust(dist(x)) x.g4 - cutree(x.clus, 4) x.cent - aggregate(x, list(x.g4), mean) x.km - kmeans(x, x.cent[,-1]) xtabs(~x.g4+x.km$cluster) x.km$cluster x.g4 1 2 3 4 1 10 0 1 0 2 0 12 2

Re: [R] Using centers of hierarchical clustering for k-means

2014-05-16 Thread Sarah Goslee
Well, you could use the group membership from the clustering along with, for instance, aggregate() to get the mean values for each cluster, and pass those to kmeans() using the centers argument as described in the help file. Unless you want medoids instead of centroids, since you didn't specify?

Re: [R] Second axis on bottom of graph

2014-05-16 Thread Hurr
Thank you David for title() In the axis command I need line=3.5, but it only works with whole numbers. Better yet, it would be better to move the horLabels upward almost to the axis. I can't figure out how to do that either. Please show me. Hurr -- View this message in context:

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Rui Barradas
Hello, The compiler package is good at speeding up for loops but in this case the gain is neglectable. The ks test is the real time problem. library(compiler) f1 - function(n){ for(i in 1:100){ for(i in 1:100){ ks.test(runif(100),runif(100))

Re: [R] How to illustrate an interaction with plotLMER.fnc

2014-05-16 Thread Haverinen-Shaughnessy Ulla
It works, thanks a million! -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Christoph Scherber Sent: 16. toukokuuta 2014 19:50 To: r-help@r-project.org Subject: Re: [R] How to illustrate an interaction with plotLMER.fnc Dear Ulla,

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Witold E Wolski
Ouch, First : my question was not how to implement dist but if there is a more generic dist function than stats:dist. Secondly: ks.test is ment as a placeholder (see the comment in the code I did send) for any other function taking two vector arguments. Third: I do subscribe to the idea that a

Re: [R] Second axis on bottom of graph

2014-05-16 Thread David Winsemius
On May 16, 2014, at 8:59 AM, Hurr wrote: Sorry I didn't catch-on to xlab= earlier. The following code works preliminarily, now I need to add an axis-title to the added axis. I don't see axistitle in axis command selections. That's because it is part of the 'title' function. -- David.

Re: [R] solution for r-help to the problem of yahoo addresses bouncing?

2014-05-16 Thread David Winsemius
On May 16, 2014, at 2:25 AM, Jannis wrote: Hi R users, this is not R related but rather affects the r-help list in general but I hope that some r-help users may have found a solution. Since recently, i get messages like this from the list server: Your membership in the mailing

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread William Dunlap
system.time(apply(t(1:(n*n)),1,myfunc)) User System verstrichen 0.190.000.19 That calls 'myfunc' exactly once: system.time(apply(t(1:(3*3)), 1, print)) [1] 1 2 3 4 5 6 7 8 9 user system elapsed 0 0 0 Bill Dunlap TIBCO Software

Re: [R] account

2014-05-16 Thread David Winsemius
On May 16, 2014, at 8:12 AM, Tania Patiño wrote: R-help could you please stop to send me messages thank you! The moderators do not have your password. You need to unsubscribe yourself. See the bottom of the page [[alternative HTML version deleted]]

Re: [R] dist like function but where you can configure the method

2014-05-16 Thread Bert Gunter
If the apply() call is not empty, its contents must of course be interpreted. That's where the time goes. system.time(for(i in 1:1e6)rnorm(1)) user system elapsed 5.250.005.29 system.time(lapply(1:1e6,rnorm,n=1)) user system elapsed 9.640.019.72

Re: [R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)

2014-05-16 Thread Tham Tran
Dear Mr. Dalgaard, Could you help me know the name of post-hoc multi-comparaison test mentioned in kruskal function of agricolae package? Thank you in advance. Tham Tran -- View this message in context:

[R] Using unbalanced-learning algorithms in the randomForest

2014-05-16 Thread Byron Dom
Responding to my own post/question here. Andy Liaw directed me to this page: http://grokbase.com/t/r/r-help/05av0aaa2e/r-repost-examples-of-classwt-strata-and-sampsize-i-n-randomforest, which gives an answer to my question. --- original post

Re: [R] FW: needs help in augented plot

2014-05-16 Thread Rolf Turner
On 16/05/14 19:45, Mir Salam wrote: Dear Med venlig hilsen and all Thanks a lot for your attention and valuable codes. I produced the graph using the follwing code. I fitted mixed effects dominant height model. The grpah is showing plot-specific dominant height against Age. SNIP You are not

Re: [R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)

2014-05-16 Thread David Winsemius
On May 16, 2014, at 2:07 PM, Tham Tran wrote: Dear Mr. Dalgaard, You do realize that was a posting from 2012, right? Could you help me know the name of post-hoc multi-comparaison test mentioned in kruskal function of agricolae package? There are multiple such tests mentioned on that

Re: [R] Second axis on bottom of graph

2014-05-16 Thread S Ellison
David L Carlson [dcarl...@tamu.edu] said: ?title Used for main titles, subtitles, and x/y labels. You might also check mtext as a way to add text at more or less arbitrary positions in the margin region. And a look at some basic (and not so basic) R plotting texts might save waiting for

Re: [R] How to Optimize two functions together in R

2014-05-16 Thread Rnieuws
Try to minimize the sum of those two functions. André de Boer Op 15 mei 2014 om 17:47 heeft Mingxuan Han han...@purdue.edu het volgende geschreven: I am trying to minimize two functions with same set of parameter(x,y). Currently I can only use optim() to minimize the each function one