Hi Everybody,
please can you help me how to call BayesX in R in order to see the graph
already exist in BayesX
Thanks
 Forwarded message 
From:
Date: Sat, Jan 22, 2011 at 5:00 AM
Subject: Rhelp Digest, Vol 95, Issue 22
To: rhelp@rproject.org
Send Rhelp mailing list submissions to
rhelp@rproject.org
To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/rhelp
or, via email, send a message with subject or body 'help' to
rhelprequest@rproject.org
You can reach the person managing the list at
rhelpowner@rproject.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Rhelp digest..."
Today's Topics:
1. 3D Binning (vioravis)
2. help! complete the reviewer's suggest: carry out GA+GP
(gaussian process)! (bbslover)
3. nlminb doesn't converge and produce a warning (kamel gaanoun)
4. Loop and store results (Sam)
5. Re: auc function (Petr Savicky)
6. stochastic models for population growth (Vassily Shvets)
7. Re: Loop and store results (Henrique Dallazuanna)
8. Function comparable to cutpt.coxph from "Survival Analysis
using S" (Schneider, Friederike Dr.)
9. Re: nlminb doesn't converge and produce a warning
(Karl Ove Hufthammer)
10. User input in R program (christiaan pauw)
11. How to look into the asterisked function? (Bogaso Christofer)
12. Re: How to look into the asterisked function?
(Henrique Dallazuanna)
13. Re: How to look into the asterisked function? (jim holtman)
14. Re: data and parameters (jim holtman)
15. Re: data and parameters (jim holtman)
16. Re: Extraction and replacement of data in a data frame
(michael.hopgood)
17. complex transformation of data (Den)
18. Re: User input in R program (Hugo Mildenberger)
19. Re: Function comparable to cutpt.coxph from "Survival
Analysis using S" (Frank Harrell)
20. Re: Regression Testing (Mojo)
21. Re: Regression Testing (Achim Zeileis)
22. Re: User input in R program (Matt Shotwell)
23. Re: User input in R program (D Kelly O'Day)
24. Re: complex transformation of data (ONKELINX, Thierry)
25. Re: complex transformation of data (Moritz Grenke)
26. Re: User input in R program (Mauricio Zambrano)
27. Error in ANOVA for model comparison (Rosario Garcia Gil)
28. HHTmethodology (Torbj?rn Lorentzen)
29. Help for lattice. par(new=TRUE) (Fabrice Tourre)
30. Re: Regression Testing (Mojo)
31. Re: Regression Testing (Achim Zeileis)
32. Re: How to look into the asterisked function? (Bogaso Christofer)
33. Re: Error in ANOVA for model comparison (John Fox)
34. clustering fuzzy (pete)
35. Re: complex transformation of data (Henrique Dallazuanna)
36. Re: clustering fuzzy (jim holtman)
37. Maxiter specification in R (Hongwei Dong)
38. Re: Maxiter specification in R (David Winsemius)
39. Re: number of iterations in a Tobit model (Terry Therneau)
40. Re: randomForest: too many elements specified? (Liaw, Andy)
41. Re: nlminb doesn't converge and produce a warning (Douglas Bates)
42. Re: nlminb doesn't converge and produce a warning (Ravi Varadhan)
43. Re: Unexpected Gap in simple line plot (Duncan Murdoch)
44. Marginality rule between powers and interaction terms in lm()
(JiHO)
45. extracting random intercept (Xebar Saram)
46. Extracting random intercept (Xebar Saram)
47. Re: Inconsisten graphics i/o when using Rscript versus GUI
(MacQueen, Don)
48. Re: complex transformation of data (Henrique Dallazuanna)
49. Re: complex transformation of data (Henrique Dallazuanna)
50. Information (Akash)
51. Re: complex transformation of data (Den)
52. Storm Clustering using clusters in evd (dpender)
53. confidence interval (Francesco Petrogalli)
54. ordering a vector (Francesco Petrogalli)
55. How to find data that includes certain values (poppinkid)
56. Re: User input in R program (jverzani)
57. Looping with incremented object name and increment function
(Michael Costello)
58. Re: clustering fuzzy (pete)
59. Re: How to find data that includes certain values (jim holtman)
60. Re: complex transformation of data (Henrique Dallazuanna)
61. Re: How to find data that includes certain values
(Henrique Dallazuanna)
62. Re: ordering a vector (jim holtman)
63. Re: ordering a vector (Peter Langfelder)
64. Re: Pearson correlation with randomization (David Winsemius)
65. Re: Information (David Winsemius)
66. Re: confidence interval (David Winsemius)
67. Re: Looping with incremented object name and increment
function (Greg Snow)
68. Re: complex transformation of data (Den)
69. Help with LMSreg (eniven)
70. TRADUCING lmer() syntax into lme() (Freddy Gamma)
71. building package (las65@buffalo.edu)
72. Re: Pearson correlation with randomization (Brahmachary, Manisha)
73. glitch in building R package (Horace Tso)
74. Re: building package (Duncan Murdoch)
75. Re: complex transformation of data (Den)
76. Re: How to find data that includes certain values (Den)
77. lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y)) (jochen laubrock)
78. Re: Looping with incremented object name and increment
function (Dennis Murphy)
79. Re: lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y)) (David Winsemius)
80. R  Vectorization and Functional Programming Constructs (Mingo)
81. Re: lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y)) (Bert Gunter)
82. Re: lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y)) (jochen laubrock)
83. about matrices merge and retrieve algorithm. (pratik wankhade)
84. Debian ?Ubuntu version of latest R using synaptic in Ubuntu
10.10 (Ajay Ohri)
85. Re: Accessing MySQL Database in R (Sascha Vieweg)
86. Re: [RsigDebian] Debian ?Ubuntu version of latest R using
synaptic inUbuntu 10.10 (Daniel Nordlund)
87. effect size measure for dependent samples (Steve Powell)

Message: 1
Date: Fri, 21 Jan 2011 00:30:46 0800 (PST)
From: vioravis
To: rhelp@rproject.org
Subject: [R] 3D Binning
MessageID: <12955986464823229137.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
I am trying to do binning on three variables (3d binning). The bin
boundaries
are specified by the user separately for each variable. I used the bin2
function in the 'ash' package for 2d binning that involves only two
variables but didn't any package for similar binning with three variables.
Are there any packages or codes available for 3d binning?? Thank you.

View this message in context:
http://r.789695.n4.nabble.com/3DBinningtp3229137p3229137.html
Sent from the R help mailing list archive at Nabble.com.

Message: 2
Date: Thu, 20 Jan 2011 23:40:00 0800 (PST)
From: bbslover
To: rhelp@rproject.org
Subject: [R] help! complete the reviewer's suggest: carry out GA+GP
(gaussian process)!
MessageID: <12955956002013229097.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
Hello, all experts,
My major is computeraied drug design ( main QSAR).
Now, my paper need be reviesed, and one reviewer ask me do genetic algorithm
coupled with gaussian process method (GA+GP).
my data:
training set: 191*106
test set: 73*106
here, I need use GA+GP to do variable selection when building the model.
In R, there are not GA package like in matlab
GAtoolbox(http://www.sheffield.ac.uk/acse/research/ecrg/gat.html) .
now, I just can use the matlab GAtool box, however, I can not use
GPtoolbox in matlab. so I search the internet, find R package "genalg" can
do GA. and an example given is to do wavelength selection by GA+PLS, so I
think i certainly do the GA+GP. unfortunately, in this genalg package, i do
not know how to extract the selected variables, it seems likes there is not
such function. So I want to all friends help me to solve the reviewer's
suggestion: do GA+GP and extract the optimal variables and get the some
statistical parameters (i.e., crossvalidation R2, pred R2 etc).
now, I can do GA+svm to do variable selection and build the models and get
some statistical paramets depicted above.
GA: matlab GA toolbox
(http://www.sheffield.ac.uk/acse/research/ecrg/gat.html)
svm: libsvm (http://www.csie.ntu.edu.tw/~cjlin/libsvm/
)
now I want to know, how to get the predicted values :
In libsvm for example:
cmd = ['v ',num2str(v),' c',num2str(cgp(nind,1)), 'g
',num2str(cgp(nind,2)),' p ',num2str(cgp(nind,3)),' s 3'];
model = svmtrain(train_y,train_data_best,cmd);
train_pred = svmpredict(train_y,train_data_best,model); % get the predicted
values for the training set
I can get the train_pred, likewise I can get the test_pred (tes_pred =
svmpredict(test_y,test_data_best,model);)
If I have the obsved train_y,test_y and the predicted train_pred and
test_pred, some statistical parameter can be calculated.
But For GP, how can i get the predicted values?
(from GP website: http://www.gaussianprocess.org/gpml/code/matlab/doc/)
prediction: [ymu ys2 fmu fs2 ] = gp(hyp, inf, mean, cov, lik, x, y, xs);
here, the "ymu" are the predicted values that similar to "test_pred" in
libsvm?
I hope all friends can give me a hand, sincere there are little days i
should upload my revised manuscript, but until now this quest can not be
soved.
thanks for your help.
kevin

View this message in context:
http://r.789695.n4.nabble.com/helpcompletethereviewerssuggestcarryoutGAGPgaussianprocesstp3229097p3229097.html
Sent from the R help mailing list archive at Nabble.com.

Message: 3
Date: Fri, 21 Jan 2011 10:51:19 +0100
From: kamel gaanoun
To: rhelp@rproject.org
Subject: [R] nlminb doesn't converge and produce a warning
MessageID:
ContentType: text/plain
Hi Everybody,
My problem is that nlminb doesn't converge, in minimising a logLikelihood
function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6
times).
I use nlminb like this :
res1<nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(Inf, n15)),
upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n15)), control =
list(maxit=1000) )
and that's the result :
Message d'avis :
In nlminb(vect, V, lower = c(rep(0.01, 12), rep(0.01, 3), rep(Inf, :
unrecognized control element(s) named `maxit' ignored
> res1
$par
[1] 2.48843979 4.75209125 2.57199837 16.80712783 3.15211075
16.86606178 58.61925499 37.85793462 48.78215699
[10] 151.64638501 43.60420299 15.14639541 0.58754382 0.76180935
0.66191763 0.26802757 0.96378197 0.68369525
[19] 0.37813096 0.89778593 10.26471908 0.87265813 6.43973968
1.74417166 12.00193419 0.60638326 1.66675589
[28] 1.29312079 1.39846863 0.48449361 20.14470193 0.50729841
2.15177967 0.78155345 0.41857810 0.40863744
[37] 17.18489562 1.69140562 1.45236861 0.23738183 5.47688642
0.71546576 9.95015047 2.16096138 0.74503151
[46] 0.66258461 5.38871217 2.53147752 12.58827379 0.45669589
0.37285088 2.15116198 2.50414066 0.99752892
[55] 4.83972450 1.16496925 3.53429528 0.56083677 9.87490932
1.75153657 9.87912224 0.75783517 9.95423392
[64] 0.07530469 0.73466191 0.27397382 15.15891548 0.02489436
12.91493065 4.65335356 0.03524561 0.00000000
[73] 9.06720312 0.25413758 0.18578765 0.53283198 4.02688497
0.50581412 0.31544940 0.57450848 6.15206152
[82] 0.08178377 0.82978606 0.39337352 3.65304712 0.06833839
3.87790848 1.08017043 3.62779184 0.14700541
[91] 13.95610827 1.50385432 8.05851743 1.24250013 0.01249817
0.38085483 4.97064573 0.98852401 3.00305183
[100] 0.35053875 4.26833889 0.12463188 16.05828402 0.41736764
0.94678922 0.75813452 2.15378348 0.39586048
[109] 1.41359441 0.81603207 4.43963958 0.79438435 0.49530882
0.11197484 8.43196798 1.00456535 22.04423030
[118] 0.11532887 2.58085765 1.41912515 0.78120889 1.23850824
12.39079062 0.23567444 1.39557879 2.22993802
[127] 12.58827379 0.45669589 0.37285088 0.73563805 3.40201735
0.58550247 3.62769828 0.21657740 7.37785506
[136] 0.68218180 6.41876225 0.38708385 0.33009429 0.25230736
3.53672719 1.53676202 3.65074513 0.42623602
[145] 7.26982010 0.70597611 23.15198788 0.36822845 2.29863267
0.70223129 14.45665129 0.54094864 2.17858443
[154] 0.56501734 2.50032796 0.45677181 12.04113439 1.42294094
16.16874444 0.49101846 6.29724769 1.38333722
[163] 14.16552579 1.57502968 5.04329383 0.24857745 1.69885428
0.46757266 4.41795651 2.41006349 4.61648610
[172] 0.42235314 3.22153895 0.15443857 1.07661101 0.63653449
2.74034265 0.20898466 1.37927183 0.26722477
[181] 15.09685067 0.87160467 24.79722150 1.48810684 1.70068893
0.22538026 7.63908028 1.60431981 7.52661064
$objective
[1] 1514.691
$convergence
[1] 1
$message
[1] "iteration limit reached without convergence (9)"
$iterations
[1] 150
$evaluations
function gradient
176 44935
I tried many times to take the res1$par as initial values and retry againe
but still doesn't converge.
Any help will save me Thanks

Kamel Gaanoun
(+33) (0)6.76.04.65.77
[[alternative HTML version deleted]]

Message: 4
Date: Fri, 21 Jan 2011 10:47:10 +0000
From: Sam
To: rhelp@rproject.org
Subject: [R] Loop and store results
MessageID: <3E88A48CCE3340228A92D7224374EC80@me.com>
ContentType: text/plain; CHARSET=USASCII
Dear List,
I have a dataframe
#prepare the data
example < data.frame(letters[1:9],
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9),
sample(letters, 9))
colnames(example) < c("individuals", 1:8)
I want to sample this
#sample the data
a_1 < example[sample(nrow(example),3),]
individuals 1 2 3 4 5 6 7 8
8 h w m r a n v v b
6 f e b g u v r b p
3 c z c s k t e i g
However i want to sample it 500 times, so i need to use the loop function 
which is something, unfortunately i am unsure how to write.
Furthermore, i want to output the results in a dataframe ( i think i need
the list function, but again i am unsure)
Ideally it would be separated by sample but i am unsure if this is possible?
However as long as the order is kept intact that will be fine. I.E the top 3
are sample 1, the next 3 are sample 2 etc
What i require:
individuals 1 2 3 4 5 6 7 8
8 h w m r a n v v b
6 f e b g u v r b p
3 c z c s k t e i g
9 h w m f a n v v b
4 f e b g b v r b p
2 c z c s k t e i g
If its not too much to ask: I will then sample it 4 individuals 500 times ,
5 individuals etc etc and store these _ i can always do these separately if
its asking too much!
Thanks,
Sam

Message: 5
Date: Fri, 21 Jan 2011 10:10:17 +0100
From: Petr Savicky
To: rhelp@rproject.org
Subject: Re: [R] auc function
MessageID: <20110121091017.GB28150@praha1.ff.cuni.cz>
ContentType: text/plain; charset=usascii
On Thu, Jan 20, 2011 at 03:14:01PM 0800, Changbin Du wrote:
> ROCR
>
I appreciate this information, which is new for me. Up to now, i was
using the function
get.auc < function(statistic, label, negative, positive)
{
xmove < as.numeric(label == negative)
ymove < as.numeric(label == positive)
stopifnot(xmove + ymove == 1)
rank.stat < rank(statistic, ties.method="min")
steps < aggregate(cbind(xmove, ymove), by=list(rank.stat), sum)
n < nrow(steps)
x < c(0, cumsum(steps[n:1, 2]))
y < c(0, cumsum(steps[n:1, 3]))
sum(diff(x) * (y[1:n] + y[2:(n+1)]))/(2*max(x)*max(y))
}
CRAN package ROCR allows to compute many different measures and
visualisations of classifier performance. In particular, AUC may
be computed as follows
library(ROCR)
n < 50
label < ordered(rep(c("c1", "c2"), length=n))
set.seed(12345)
statistic < rnorm(n) + (label == "c2")
pred < prediction(statistic, label)
AUC < performance(pred, "auc")@y.values[[1]]
cbind(AUC, diff=AUC  get.auc(statistic, label, "c1", "c2"))
# AUC diff
# [1,] 0.7392 0
The difference is not always exactly zero, but is at the level
of the machine rounding error.
Petr Savicky.
>
>
> On Thu, Jan 20, 2011 at 3:04 PM, He, Yulei wrote:
>
> > Hi, there.
> >
> > Suppose I already have sensitivities and specificities. What is the
quick
> > Rfunction to calculate AUC for the ROC plot? There seem to be many R
> > functions to calculate AUC.
> >
> > Thanks.
> >
> > Yulei
> >
> >

Message: 6
Date: Thu, 20 Jan 2011 23:57:18 0800 (PST)
From: Vassily Shvets
To: rhelp@stat.math.ethz.ch
Subject: [R] stochastic models for population growth
MessageID: <338050.63047.qm@web130201.mail.mud.yahoo.com>
ContentType: text/plain; charset=usascii
Hello,
Having measured two populations' characteristics at one particular time[with
great precision] with R, I would like to extend this to measuring the same
populations starting at t1, and then again at t2, and try to develop a
growth model (something like dpop1/dt=r*pop^(...),dpop2/dt=r*pop^(...)). I
think the idea is to create a model that will predict the growth of a
population(N(mu, sigma)) within a margin of error. This kind of modeling
isn't well known or publicized in terms of R, am I right?
regards,
s

Message: 7
Date: Fri, 21 Jan 2011 09:25:05 0200
From: Henrique Dallazuanna
To: Sam
Cc: rhelp@rproject.org
Subject: Re: [R] Loop and store results
MessageID:
ContentType: text/plain
Try this:
replicate(500, example[sample(nrow(example), 3),], simplify = FALSE)
On Fri, Jan 21, 2011 at 8:47 AM, Sam wrote:
> Dear List,
>
> I have a dataframe
>
> #prepare the data
> example < data.frame(letters[1:9],
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9),
> sample(letters, 9))
> colnames(example) < c("individuals", 1:8)
>
> I want to sample this
>
> #sample the data
> a_1 < example[sample(nrow(example),3),]
>
> individuals 1 2 3 4 5 6 7 8
> 8 h w m r a n v v b
> 6 f e b g u v r b p
> 3 c z c s k t e i g
>
> However i want to sample it 500 times, so i need to use the loop function

> which is something, unfortunately i am unsure how to write.
>
> Furthermore, i want to output the results in a dataframe ( i think i need
> the list function, but again i am unsure)
>
> Ideally it would be separated by sample but i am unsure if this is
> possible? However as long as the order is kept intact that will be fine.
I.E
> the top 3 are sample 1, the next 3 are sample 2 etc
>
> What i require:
>
> individuals 1 2 3 4 5 6 7 8
>
> 8 h w m r a n v v b
> 6 f e b g u v r b p
> 3 c z c s k t e i g
>
> 9 h w m f a n v v b
> 4 f e b g b v r b p
> 2 c z c s k t e i g
>
> If its not too much to ask: I will then sample it 4 individuals 500 times
,
> 5 individuals etc etc and store these _ i can always do these separately
if
[[elided Yahoo spam]]
>
> Thanks,
>
> Sam
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Henrique Dallazuanna
CuritibaParanáBrasil
25° 25' 40" S 49° 16' 22" O
[[alternative HTML version deleted]]

Message: 8
Date: Fri, 21 Jan 2011 12:17:00 +0100
From: "Schneider, Friederike Dr."
To: "rhelp@stat.math.ethz.ch"
Subject: [R] Function comparable to cutpt.coxph from "Survival
Analysis using S"
MessageID:
<
67CE706A4F74ED42A5936E106985CC405009A5C925@MITEX03N.helios.med.unimuenchen.de
>
ContentType: text/plain; charset="iso88591"
Dear Mrs Rachel Pearce,
I am looking for a function "cutptcoxph" in R  like you did some years
ago.
How have you solved the problem? Have you found it or a similar function?
thank you, Sincerely, Friederike
"The title says it all really; I am looking for a function along the lines
of
cutpt.coxph as described in "Survival Analysis Using S" (Tableman and
Kim), Chapter 6. As may be guessed, the function optimises the
cutpoint of a continuous variable for cox proportional hazard
modelling. I can't find it, or any similar function, on CRAN.
Alternatively, perhaps there is a way of extracting the likelihoods
from the output of coxph."
Dr. med. Friederike Schneider
Assistenz?rztin
Klinikum der LMU
Campus Grosshadern
Marchioninistr. 15
81377 M?nchen
Tel.: 0897099425
Friederike.Schneider@med.unimuenchen.de

Message: 9
Date: Fri, 21 Jan 2011 12:47:55 +0100
From: Karl Ove Hufthammer
To: rhelp@stat.math.ethz.ch
Subject: Re: [R] nlminb doesn't converge and produce a warning
MessageID:
ContentType: text/plain; charset="UTF8"
kamel gaanoun wrote:
> I use nlminb like this :
> res1<nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(Inf,
> n15)), upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n15)), control =
> list(maxit=1000) )
>
> and that's the result :
>
> Message d'avis :
> In nlminb(vect, V, lower = c(rep(0.01, 12), rep(0.01, 3), rep(Inf, :
> unrecognized control element(s) named `maxit' ignored
Just increase the maximum number of iterations. Which you tried to do, but
didn?t succeed in, as the above warnings shows. The argument is called
?iter.max?, not ?max.iter?.

Karl Ove Hufthammer

Message: 10
Date: Fri, 21 Jan 2011 14:26:26 +0200
From: christiaan pauw
To: rhelp@rproject.org
Subject: [R] User input in R program
MessageID:
ContentType: text/plain
HI Everybody
Does anyone know of documentation about different ways of obtaining user
input in R. I have used readline() but I wondered is there are sophisticated
packages that does things like validate answers or generate selection
lists.
bets regards
Christaan
[[alternative HTML version deleted]]

Message: 11
Date: Fri, 21 Jan 2011 18:32:26 +0530
From: "Bogaso Christofer"
To:
Subject: [R] How to look into the asterisked function?
MessageID: <001e01cbb96b$774941c0$65dbc540$@gmail.com>
ContentType: text/plain
Hi friends, there is methods() function to see the all available methods for
a particular function, for example:
> head(methods("print"))
[1] "print.acf" "print.anova" "print.aov" "print.aovlist"
"print.ar" "print.Arima"
In this list, there are some functions which are asterisked like
print.acf(). How can I see the contents of those function?
Thanks and regards,
[[alternative HTML version deleted]]

Message: 12
Date: Fri, 21 Jan 2011 10:45:45 0200
From: Henrique Dallazuanna
To: Bogaso Christofer
Cc: rhelp@rproject.org
Subject: Re: [R] How to look into the asterisked function?
MessageID:
ContentType: text/plain
Try this:
getS3method("print", "acf")
On Fri, Jan 21, 2011 at 11:02 AM, Bogaso Christofer <
bogaso.christofer@gmail.com> wrote:
> Hi friends, there is methods() function to see the all available methods
> for
> a particular function, for example:
>
>
>
> > head(methods("print"))
>
> [1] "print.acf" "print.anova" "print.aov" "print.aovlist"
> "print.ar" "print.Arima"
>
>
>
> In this list, there are some functions which are asterisked like
> print.acf(). How can I see the contents of those function?
>
>
>
> Thanks and regards,
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Henrique Dallazuanna
CuritibaParanáBrasil
25° 25' 40" S 49° 16' 22" O
[[alternative HTML version deleted]]

Message: 13
Date: Fri, 21 Jan 2011 07:49:36 0500
From: jim holtman
To: Bogaso Christofer
Cc: rhelp@rproject.org
Subject: Re: [R] How to look into the asterisked function?
MessageID:
ContentType: text/plain; charset=ISO88591
You can also use:
getAnywhere("functionName")
On Fri, Jan 21, 2011 at 8:02 AM, Bogaso Christofer
wrote:
> Hi friends, there is methods() function to see the all available methods
for
> a particular function, for example:
>
>
>
>> head(methods("print"))
>
> [1] "print.acf" ? ? "print.anova" ? "print.aov" ? ? "print.aovlist"
> "print.ar" ? ? ?"print.Arima"
>
>
>
> In this list, there are some functions which are asterisked like
> print.acf(). How can I see the contents of those function?
>
>
>
> Thanks and regards,
>
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 14
Date: Fri, 21 Jan 2011 07:58:04 0500
From: jim holtman
To: "analyst41@hotmail.com"
Cc: rhelp@rproject.org
Subject: Re: [R] data and parameters
MessageID:
>
ContentType: text/plain; charset=ISO88591
try 'sqldf'
> master=as.data.frame(list(clientId=c(1:4,2), date=1001:1005,
+ value=10001:10005))
> control=as.data.frame(list(clientId=c(2,3), mindate=c(100,1005),
+ maxdate=c(1005,1005), control.params=c(1,2)))
> master
clientId date value
1 1 1001 10001
2 2 1002 10002
3 3 1003 10003
4 4 1004 10004
5 2 1005 10005
> control
clientId mindate maxdate control.params
1 2 100 1005 1
2 3 1005 1005 2
> require(sqldf)
> sqldf("
+ select m.*
+ from master m, control c
+ where m.clientId = c.clientID
+ and m.date between c.mindate and c.maxdate
+ ")
clientId date value
1 2 1002 10002
2 2 1005 10005
>
>
On Thu, Jan 20, 2011 at 9:02 PM, analyst41@hotmail.com
wrote:
> (1) I have a master data frame that reads
>
> ClientID date value
>
> (2) I also have a control data frame that reads
>
> Client ID Min date Max date control parameters
>
> The control data set may not have all client IDs .
>
> I want to use the control data frame on the master data frame to
> remove client IDS that don't exist in the control data set and for
> those that do, remove dates outside the required range.
>
> (3) We can either put the control parameters on all rows corresponding
> to a client ID or look it up from the control data frame
>
> (4) The basic function call looks like
>
> do.something(df,control parameters)
>
> where df is the subset of the master data set that corresponds to a
> single client with unwanted dates removed and the control parameters
> pertain to that client.
>
> Any help would be appreciated.
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 15
Date: Fri, 21 Jan 2011 08:01:46 0500
From: jim holtman
To: "analyst41@hotmail.com"
Cc: rhelp@rproject.org
Subject: Re: [R] data and parameters
MessageID:
ContentType: text/plain; charset=ISO88591
forgot the control parameters:
> sqldf("
+ select m.*, c.control_params
+ from master m, control c
+ where m.clientId = c.clientID
+ and m.date between c.mindate and c.maxdate
+ ")
clientId date value control_params
1 2 1002 10002 1
2 2 1005 10005 1
>
On Thu, Jan 20, 2011 at 9:02 PM, analyst41@hotmail.com
wrote:
> (1) I have a master data frame that reads
>
> ClientID date value
>
> (2) I also have a control data frame that reads
>
> Client ID Min date Max date control parameters
>
> The control data set may not have all client IDs .
>
> I want to use the control data frame on the master data frame to
> remove client IDS that don't exist in the control data set and for
> those that do, remove dates outside the required range.
>
> (3) We can either put the control parameters on all rows corresponding
> to a client ID or look it up from the control data frame
>
> (4) The basic function call looks like
>
> do.something(df,control parameters)
>
> where df is the subset of the master data set that corresponds to a
> single client with unwanted dates removed and the control parameters
> pertain to that client.
>
> Any help would be appreciated.
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 16
Date: Fri, 21 Jan 2011 04:03:42 0800 (PST)
From: "michael.hopgood"
To: rhelp@rproject.org
Subject: Re: [R] Extraction and replacement of data in a data frame
MessageID: <12956114224523229476.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
Dear all,
Thank you for the prompt responses. It is until today that I have managed
to scrap together the time to develop my Rproject further. In my free
time, I have been reading various intro manuals, so I have a rough idea of
what needs doing. Sometimes, though, putting it into practice is more
troublesome than it looks. It is fascinating how pliable this programming
language is. I will report on my progress as soon as I can.
Sincerely,
Michael Hopgood.

View this message in context:
http://r.789695.n4.nabble.com/Extractionandreplacementofdatainadataframetp3221261p3229476.html
Sent from the R help mailing list archive at Nabble.com.

Message: 17
Date: Fri, 21 Jan 2011 14:25:38 +0200
From: Den
To: Rhelp
Subject: [R] complex transformation of data
MessageID: <1295612738.1880.45.camel@den2042desktop>
ContentType: text/plain; charset="UTF8"
Dear [R] people
Could you please help with following data transformation.
Any suggestions, hints, references and even guessing on performing any
of the following steps are highly appreciated. Those transformations are
crucial for my work.
(n_, _n, j_, k_ signify numbers)
SOURCE DATA:
id cycle1 cycle2 cycle3 ? cycle_n
1 c c c c
1 m m m m
1 f f f f
2 m m m NA
2 f f f NA
2 c c c NA
3 a a NA NA
3 c c c NA
3 f f f NA
3 NA NA m NA
...........................................
RESULT DATA1:
id cyc1 cyc2 cyc3 ? cyc_n
1 cfm cfm cfm cfm
2 cfm cfm cfm NA
3 acf acf cfm NA
...........................................
RESULT DATA2:
id treatment
1 n_cfm
2 j_cfm
3 2acf>k_cfm
...................
RESULT DATA3:
id regimen numOfCycles
1 cfm n_
2 cfm j_
3 asf>cfm {2+k_}
.............................
Thank you
Denis

Message: 18
Date: Fri, 21 Jan 2011 13:41:27 +0100
From: Hugo Mildenberger
To: rhelp@rproject.org
Subject: Re: [R] User input in R program
MessageID: <201101211341.28202.Hugo.Mildenberger@web.de>
ContentType: Text/Plain; charset="iso88591"
Hello Christian,
for an example of interacting with graphic output, just run
example(getGraphicsEvent)
However, on X11, that feature had ceased to work since a prerelease
of R2.12 if Cairo support was enabled at compile time. The reason for
this defect had already been documented in R's bugs database for long.
Maybe getGraphicsEvent still runs on Windows.
Best
Hugo
On Friday 21 January 2011 13:26:26 christiaan pauw wrote:
> HI Everybody
>
> Does anyone know of documentation about different ways of obtaining user
> input in R. I have used readline() but I wondered is there are
sophisticated
> packages that does things like validate answers or generate selection
> lists.
>
> bets regards
> Christaan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Message: 19
Date: Fri, 21 Jan 2011 06:03:25 0800 (PST)
From: Frank Harrell
To: rhelp@rproject.org
Subject: Re: [R] Function comparable to cutpt.coxph from "Survival
Analysis using S"
MessageID: <12956186059383229704.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
It is very uncommon for the assumptions underlying this method to be
satisfied. These assumptions include (1) the relationship between X and log
relative hazard is discontinuous at X=c and only X=c; (2) c is correctly
found as the cutpoint; (3) X vs log hazard is flat to the left of c; (4) X
vs log hazard is flat to the right of c; (5) the 'optimal' cutpoint does not
depend on the values of other predictors.
These relationships rarely occur in nature unless X=time. Failure to have
these assumptions satisfied will result in (1) great error in estimating c
(because c doesn't exist); (2) low predictive accuracy; (3) serious lack of
fit; (4) residual confounding; and (5) overestimation of effects of
remaining variables.
This nonexistence of cutpoints is why in medical research no two
investigators seem to find the same cutpoint for the same predictor in
different datasets.
Frank

Frank Harrell
Department of Biostatistics, Vanderbilt University

View this message in context:
http://r.789695.n4.nabble.com/FunctioncomparabletocutptcoxphfromSurvivalAnalysisusingStp3229420p3229704.html
Sent from the R help mailing list archive at Nabble.com.

Message: 20
Date: Fri, 21 Jan 2011 09:10:29 0500
From: Mojo
To: Achim Zeileis
Cc: rhelp@rproject.org
Subject: Re: [R] Regression Testing
MessageID: <4D3993D5.9050303@sispyrc.com>
ContentType: text/plain; charset=ISO88591; format=flowed
On 1/20/2011 4:42 PM, Achim Zeileis wrote:
> On Thu, 20 Jan 2011, Mojo wrote:
>
>> I'm new to R and some what new to the world of stats. I got
>> frustrated with excel and found R. Enough of that already.
>>
>> I'm trying to test and correct for Heteroskedasticity
>>
>> I have data in a csv file that I load and store in a dataframe.
>>
>>> ds < read.csv("book2.csv")
>>> df < data.frame(ds)
>>
>> I then preform a OLS regression:
>>
>>> lmfit < lm(df$y~df$x)
>
> Just btw: lm(y ~ x, data = df) is somewhat easier to read and also
> easier to write when the formula involves more regressors.
>
>> To test for Heteroskedasticity, I run the BPtest:
>>
>>> bptest(lmfit)
>>
>> studentized BreuschPagan test
>>
>> data: lmfit
>> BP = 11.6768, df = 1, pvalue = 0.0006329
>>
>> From the above, if I'm interpreting this correctly, there is
>> Heteroskedasticity present. To correct for this, I need to calculate
>> robust error terms.
>
> That is one option. Another one would be using WLS instead of OLS  or
> maybe FGLS. As the model just has one regressor, this might be
> possible and result in a more efficient estimate than OLS.
I thought that WLS (which I guessing is a weighted regression) is really
only useful when you know or at least have an idea of what is causing
the Heteroskedasticity? I'm not familiar with FGLS. I plan on adding
additional independent variables as I get more comfortable with everything.
>
>> From my reading on this list, it seems like I need to vcovHC.
>
> That's another option, yes.
>
>>> vcovHC(lmfit)
>> (Intercept) df$x
>> (Intercept) 1.057460e03 4.961118e05
>> df$x 4.961118e05 2.378465e06
>>
>> I'm having a little bit of a hard time following the help pages.
>
> Yes, the manual page is somewhat technical but the first thing the
> "Details" section does is: It points you to some references that
> should be easier to read. I recommend starting with
>
> Zeileis A (2004), Econometric Computing with HC and HAC Covariance
> Matrix Estimators. _Journal of Statistical Software_, *11*(10),
> 117. URL .
I will look into that.
Thanks,
Mojo

Message: 21
Date: Fri, 21 Jan 2011 15:13:27 +0100 (CET)
From: Achim Zeileis
To: Mojo
Cc: rhelp@rproject.org
Subject: Re: [R] Regression Testing
MessageID:
ContentType: TEXT/PLAIN; charset=USASCII; format=flowed
On Fri, 21 Jan 2011, Mojo wrote:
> On 1/20/2011 4:42 PM, Achim Zeileis wrote:
>> On Thu, 20 Jan 2011, Mojo wrote:
>>
>>> I'm new to R and some what new to the world of stats. I got frustrated
>>> with excel and found R. Enough of that already.
>>>
>>> I'm trying to test and correct for Heteroskedasticity
>>>
>>> I have data in a csv file that I load and store in a dataframe.
>>>
>>>> ds < read.csv("book2.csv")
>>>> df < data.frame(ds)
>>>
>>> I then preform a OLS regression:
>>>
>>>> lmfit < lm(df$y~df$x)
>>
>> Just btw: lm(y ~ x, data = df) is somewhat easier to read and also easier
>> to write when the formula involves more regressors.
>>
>>> To test for Heteroskedasticity, I run the BPtest:
>>>
>>>> bptest(lmfit)
>>>
>>> studentized BreuschPagan test
>>>
>>> data: lmfit
>>> BP = 11.6768, df = 1, pvalue = 0.0006329
>>>
>>> From the above, if I'm interpreting this correctly, there is
>>> Heteroskedasticity present. To correct for this, I need to calculate
>>> robust error terms.
>>
>> That is one option. Another one would be using WLS instead of OLS  or
>> maybe FGLS. As the model just has one regressor, this might be possible
and
>> result in a more efficient estimate than OLS.
>
> I thought that WLS (which I guessing is a weighted regression) is really
only
> useful when you know or at least have an idea of what is causing the
> Heteroskedasticity?
Yes. But with only a single variable that shouldn't be too hard to do.
Also in the BreuschPagan test you specify a hypothesized functional form
for the variance.
> I'm not familiar with FGLS.
There is a worked example in
demo("ChLinearRegression", package = "AER")
The corresponding book has some more details.
hth,
Z
> I plan on adding additional
> independent variables as I get more comfortable with everything.
>
>>
>>> From my reading on this list, it seems like I need to vcovHC.
>>
>> That's another option, yes.
>>
>>>> vcovHC(lmfit)
>>> (Intercept) df$x
>>> (Intercept) 1.057460e03 4.961118e05
>>> df$x 4.961118e05 2.378465e06
>>>
>>> I'm having a little bit of a hard time following the help pages.
>>
>> Yes, the manual page is somewhat technical but the first thing the
>> "Details" section does is: It points you to some references that should
be
>> easier to read. I recommend starting with
>>
>> Zeileis A (2004), Econometric Computing with HC and HAC Covariance
>> Matrix Estimators. _Journal of Statistical Software_, *11*(10),
>> 117. URL .
>
> I will look into that.
>
> Thanks,
> Mojo
>
>

Message: 22
Date: Fri, 21 Jan 2011 09:21:27 0500
From: Matt Shotwell
To: rhelp@rproject.org
Subject: Re: [R] User input in R program
MessageID: <1295619687.1588.4.camel@mattlaptop>
ContentType: text/plain; charset="UTF8"
Martyn Plummer's 'coda' package has some nice interactive menus. The
package appears to be written entirely in R. You could start with the
codamenu() function in the package source:
http://cran.rproject.org/web/packages/coda/index.html
Matt
On Fri, 20110121 at 14:26 +0200, christiaan pauw wrote:
> HI Everybody
>
> Does anyone know of documentation about different ways of obtaining user
> input in R. I have used readline() but I wondered is there are
sophisticated
> packages that does things like validate answers or generate selection
> lists.
>
> bets regards
> Christaan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.

Message: 23
Date: Fri, 21 Jan 2011 06:22:23 0800 (PST)
From: "D Kelly O'Day"
To: rhelp@rproject.org
Subject: Re: [R] User input in R program
MessageID: <12956197436313229738.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
Christian
Have you looked at the
http://www.stats.gla.ac.uk/~adrian/rpanel/rpanel
package?
I have a post which shows an example of interactive input that allows user
to adjust plot parameters.
http://chartsgraphs.wordpress.com/2009/05/08/rpanelpackageaddsinteractivecapabilitestor/
link

View this message in context:
http://r.789695.n4.nabble.com/UserinputinRprogramtp3229515p3229738.html
Sent from the R help mailing list archive at Nabble.com.

Message: 24
Date: Fri, 21 Jan 2011 14:25:56 +0000
From: "ONKELINX, Thierry"
To: Den , Rhelp
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain; charset="usascii"
Denis,
Have a look at paste(), aggregate(), ddply() (from the plyr package) and
melt() and cast() (both from the reshape package).
Best regards,
Thierry

ir. Thierry Onkelinx
Instituut voor natuur en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx@inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than
asking him to perform a postmortem examination: he may be able to say what
the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
> Oorspronkelijk bericht
> Van: rhelpbounces@rproject.org
> [mailto:rhelpbounces@rproject.org] Namens Den
> Verzonden: vrijdag 21 januari 2011 13:26
> Aan: Rhelp
> Onderwerp: [R] complex transformation of data
>
> Dear [R] people
> Could you please help with following data transformation.
> Any suggestions, hints, references and even guessing on
> performing any of the following steps are highly appreciated.
> Those transformations are crucial for my work.
>
> (n_, _n, j_, k_ signify numbers)
>
> SOURCE DATA:
> id cycle1 cycle2 cycle3 ... cycle_n
> 1 c c c c
> 1 m m m m
> 1 f f f f
> 2 m m m NA
> 2 f f f NA
> 2 c c c NA
> 3 a a NA NA
> 3 c c c NA
> 3 f f f NA
> 3 NA NA m NA
> ...........................................
>
>
>
> RESULT DATA1:
> id cyc1 cyc2 cyc3 ... cyc_n
> 1 cfm cfm cfm cfm
> 2 cfm cfm cfm NA
> 3 acf acf cfm NA
> ...........................................
>
>
> RESULT DATA2:
> id treatment
> 1 n_cfm
> 2 j_cfm
> 3 2acf>k_cfm
> ...................
>
>
> RESULT DATA3:
> id regimen numOfCycles
> 1 cfm n_
> 2 cfm j_
> 3 asf>cfm {2+k_}
> .............................
>
>
>
> Thank you
> Denis
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Message: 25
Date: Fri, 21 Jan 2011 15:46:06 +0100
From: "Moritz Grenke"
To: "'Den'" , "'Rhelp'"
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain; charset="iso88591"
Hi Denis,
#minimal example:
test<as.data.frame(list(id=c(1,1,1,2,2,2), cycle1=c("c", "m", "f", "m",
"f", "c")))
#gettin your first cell of Result 1
paste(sort(test$cycle1[test$id==1]), collapse="")
Hope this helps for the first task ...
Moritz
______________________
Moritz Grenke
http://www.360mix.de
Urspr?ngliche Nachricht
Von: rhelpbounces@rproject.org [mailto:rhelpbounces@rproject.org] Im
Auftrag von Den
Gesendet: Freitag, 21. Januar 2011 13:26
An: Rhelp
Betreff: [R] complex transformation of data
Dear [R] people
Could you please help with following data transformation.
Any suggestions, hints, references and even guessing on performing any
of the following steps are highly appreciated. Those transformations are
crucial for my work.
(n_, _n, j_, k_ signify numbers)
SOURCE DATA:
id cycle1 cycle2 cycle3 ? cycle_n
1 c c c c
1 m m m m
1 f f f f
2 m m m NA
2 f f f NA
2 c c c NA
3 a a NA NA
3 c c c NA
3 f f f NA
3 NA NA m NA
...........................................
RESULT DATA1:
id cyc1 cyc2 cyc3 ? cyc_n
1 cfm cfm cfm cfm
2 cfm cfm cfm NA
3 acf acf cfm NA
...........................................
RESULT DATA2:
id treatment
1 n_cfm
2 j_cfm
3 2acf>k_cfm
...................
RESULT DATA3:
id regimen numOfCycles
1 cfm n_
2 cfm j_
3 asf>cfm {2+k_}
.............................
Thank you
Denis
______________________________________________
Rhelp@rproject.org mailing list
https://stat.ethz.ch/mailman/listinfo/rhelp
PLEASE do read the posting guide http://www.Rproject.org/postingguide.html
and provide commented, minimal, selfcontained, reproducible code.

Message: 26
Date: Fri, 21 Jan 2011 15:46:56 +0100
From: Mauricio Zambrano
To: christiaan pauw
Cc: rhelp@rproject.org
Subject: Re: [R] User input in R program
MessageID:
ContentType: text/plain; charset=ISO88591
Probably, iplots may be useful for you:
http://cran.rproject.org/web/packages/iplots/index.html
Kinds,
Mauricio

===============================
Linux user #454569  Ubuntu user #17469
===============================
2011/1/21 christiaan pauw :
> HI Everybody
>
> Does anyone know of documentation about different ways of obtaining user
> input in R. I have used readline() but I wondered is there are
sophisticated
> packages that does things like validate answers or generate selection
> lists.
>
> bets regards
> Christaan
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Message: 27
Date: Fri, 21 Jan 2011 15:30:36 +0100
From: Rosario Garcia Gil
To: "rhelp@rproject.org"
Subject: [R] Error in ANOVA for model comparison
MessageID:
<74776A1FD44FB94E9182E2C524E78772BD0783A8B1@exmbx3.ad.slu.se>
ContentType: text/plain; charset="usascii"
Hello
I am trying to compare two models using anova(), however I get a message
error (see below).
In the net I only found some information on certain library(car) for which
one should use anova with A capital letter (Anova instead of anova), but I
could not find car library as it says it does not exist.
> Model < lm(interceptG ~ SW + TSC + FSC + PF + SlopeG + K, data=AllTrait)
> Model1 < lm(interceptG ~ SW + TSC + FSC + PF + SlopeG + PHt,
data=AllTrait)
Error in anova.lmlist(object, ...) :
models were not all fitted to the same size of dataset
I have NA in the datafile, should that be the problem?
Kind regards and thanks in advance
Rosario

Message: 28
Date: Fri, 21 Jan 2011 15:23:38 +0100
From: Torbj?rn Lorentzen
To: rhelp@Rproject.org
Subject: [R] HHTmethodology
MessageID: <4D3996EA.8000109@bjerknes.uib.no>
ContentType: text/plain; charset=ISO88591; format=flowed
Hello Rexperts,
I wonder whether any of the Rpackages cover the HilbertHuang Transform
methodology (HHT)?
Regards,
Torbjorn

Torbj?rn Lorentzen  torbjorn.lorentzen@bjerknes.uib.no
torbjorn.lorentzen@uni.no  http://www.bjerknes.uib.no/
Phone: +47 55 58 25 05  Cellphone: +47 906 972 36  Bjerknes Centre for
Climate Research  Geophysical Institute 
University of Bergen  Allegaten 55  NO5007 Bergen  Norway 

Message: 29
Date: Fri, 21 Jan 2011 15:52:56 +0100
From: Fabrice Tourre
To: rhelp@rproject.org
Subject: [R] Help for lattice. par(new=TRUE)
MessageID:
ContentType: text/plain; charset=ISO88591
Hi list,
I want to plot two plot in the same figure. I set par(new=TRUE). But
it does not work.
library(lattice)
myPanel < function(x,...)
{
panel.histogram(x,alpha=0.4,...)
ltext(0.4,1.5,paste("Mean=","0.05",digit=2)),cex=0.8)
ltext(0.8,1.5,paste("s.d.=","0.06",digit=2)),cex=0.8)
}
histogram(sh2,
type="percent",panel=myPanel,breaks=seq(0,1,by=0.01),ylim=c(0,5),col=rgb(0.1,0.1,0.8,0.5))
par(new=TRUE) #### Here is does not work. Warning message: In par(new
= TRUE) : calling par(new=TRUE) with no plot
histogram(sh2,
type="percent",panel=myPanel,breaks=seq(0,1,by=0.01),ylim=c(0,5))
I want to the two hist in the same map. How can I set it in lattice?
Thanks.

Message: 30
Date: Fri, 21 Jan 2011 10:00:32 0500
From: Mojo
To: Achim Zeileis
Cc: rhelp@rproject.org
Subject: Re: [R] Regression Testing
MessageID: <4D399F90.2020702@sispyrc.com>
ContentType: text/plain; charset=ISO88591; format=flowed
On 1/21/2011 9:13 AM, Achim Zeileis wrote:
> On Fri, 21 Jan 2011, Mojo wrote:
>
>> On 1/20/2011 4:42 PM, Achim Zeileis wrote:
>>> On Thu, 20 Jan 2011, Mojo wrote:
>>>
>>>> I'm new to R and some what new to the world of stats. I got
>>>> frustrated with excel and found R. Enough of that already.
>>>>
>>>> I'm trying to test and correct for Heteroskedasticity
>>>>
>>>> I have data in a csv file that I load and store in a dataframe.
>>>>
>>>>> ds < read.csv("book2.csv")
>>>>> df < data.frame(ds)
>>>>
>>>> I then preform a OLS regression:
>>>>
>>>>> lmfit < lm(df$y~df$x)
>>>
>>> Just btw: lm(y ~ x, data = df) is somewhat easier to read and also
>>> easier to write when the formula involves more regressors.
>>>
>>>> To test for Heteroskedasticity, I run the BPtest:
>>>>
>>>>> bptest(lmfit)
>>>>
>>>> studentized BreuschPagan test
>>>>
>>>> data: lmfit
>>>> BP = 11.6768, df = 1, pvalue = 0.0006329
>>>>
>>>> From the above, if I'm interpreting this correctly, there is
>>>> Heteroskedasticity present. To correct for this, I need to
>>>> calculate robust error terms.
>>>
>>> That is one option. Another one would be using WLS instead of OLS 
>>> or maybe FGLS. As the model just has one regressor, this might be
>>> possible and result in a more efficient estimate than OLS.
>>
>> I thought that WLS (which I guessing is a weighted regression) is
>> really only useful when you know or at least have an idea of what is
>> causing the Heteroskedasticity?
>
> Yes. But with only a single variable that shouldn't be too hard to do.
> Also in the BreuschPagan test you specify a hypothesized functional
> form for the variance.
>
>> I'm not familiar with FGLS.
>
> There is a worked example in
>
> demo("ChLinearRegression", package = "AER")
>
> The corresponding book has some more details.
>
> hth,
> Z
>
>> I plan on adding additional independent variables as I get more
>> comfortable with everything.
>>
>>>
>>>> From my reading on this list, it seems like I need to vcovHC.
>>>
>>> That's another option, yes.
>>>
>>>>> vcovHC(lmfit)
>>>> (Intercept) df$x
>>>> (Intercept) 1.057460e03 4.961118e05
>>>> df$x 4.961118e05 2.378465e06
>>>>
>>>> I'm having a little bit of a hard time following the help pages.
>>>
>>> Yes, the manual page is somewhat technical but the first thing the
>>> "Details" section does is: It points you to some references that
>>> should be easier to read. I recommend starting with
>>>
>>> Zeileis A (2004), Econometric Computing with HC and HAC Covariance
>>> Matrix Estimators. _Journal of Statistical Software_, *11*(10),
>>> 117. URL .
>>
>> I will look into that.
>>
>> Thanks,
>> Mojo
>>
>>
If I were to use vcovHAC instead of vcovHC, does that correct for serial
correlation as well as Heteroskedasticity?
Thanks,
Mojo

Message: 31
Date: Fri, 21 Jan 2011 16:20:15 +0100 (CET)
From: Achim Zeileis
To: Mojo
Cc: rhelp@rproject.org
Subject: Re: [R] Regression Testing
MessageID:
ContentType: TEXT/PLAIN; charset=USASCII; format=flowed
On Fri, 21 Jan 2011, Mojo wrote:
> On 1/21/2011 9:13 AM, Achim Zeileis wrote:
>> On Fri, 21 Jan 2011, Mojo wrote:
>>
>>> On 1/20/2011 4:42 PM, Achim Zeileis wrote:
>>>> On Thu, 20 Jan 2011, Mojo wrote:
>>>>
>>>>> I'm new to R and some what new to the world of stats. I got
frustrated
>>>>> with excel and found R. Enough of that already.
>>>>>
>>>>> I'm trying to test and correct for Heteroskedasticity
>>>>>
>>>>> I have data in a csv file that I load and store in a dataframe.
>>>>>
>>>>>> ds < read.csv("book2.csv")
>>>>>> df < data.frame(ds)
>>>>>
>>>>> I then preform a OLS regression:
>>>>>
>>>>>> lmfit < lm(df$y~df$x)
>>>>
>>>> Just btw: lm(y ~ x, data = df) is somewhat easier to read and also
easier
>>>> to write when the formula involves more regressors.
>>>>
>>>>> To test for Heteroskedasticity, I run the BPtest:
>>>>>
>>>>>> bptest(lmfit)
>>>>>
>>>>> studentized BreuschPagan test
>>>>>
>>>>> data: lmfit
>>>>> BP = 11.6768, df = 1, pvalue = 0.0006329
>>>>>
>>>>> From the above, if I'm interpreting this correctly, there is
>>>>> Heteroskedasticity present. To correct for this, I need to calculate
>>>>> robust error terms.
>>>>
>>>> That is one option. Another one would be using WLS instead of OLS  or
>>>> maybe FGLS. As the model just has one regressor, this might be possible
>>>> and result in a more efficient estimate than OLS.
>>>
>>> I thought that WLS (which I guessing is a weighted regression) is really
>>> only useful when you know or at least have an idea of what is causing
the
>>> Heteroskedasticity?
>>
>> Yes. But with only a single variable that shouldn't be too hard to do.
Also
>> in the BreuschPagan test you specify a hypothesized functional form for
>> the variance.
>>
>>> I'm not familiar with FGLS.
>>
>> There is a worked example in
>>
>> demo("ChLinearRegression", package = "AER")
>>
>> The corresponding book has some more details.
>>
>> hth,
>> Z
>>
>>> I plan on adding additional independent variables as I get more
>>> comfortable with everything.
>>>
>>>>
>>>>> From my reading on this list, it seems like I need to vcovHC.
>>>>
>>>> That's another option, yes.
>>>>
>>>>>> vcovHC(lmfit)
>>>>> (Intercept) df$x
>>>>> (Intercept) 1.057460e03 4.961118e05
>>>>> df$x 4.961118e05 2.378465e06
>>>>>
>>>>> I'm having a little bit of a hard time following the help pages.
>>>>
>>>> Yes, the manual page is somewhat technical but the first thing the
>>>> "Details" section does is: It points you to some references that should
>>>> be easier to read. I recommend starting with
>>>>
>>>> Zeileis A (2004), Econometric Computing with HC and HAC Covariance
>>>> Matrix Estimators. _Journal of Statistical Software_, *11*(10),
>>>> 117. URL .
>>>
>>> I will look into that.
>>>
>>> Thanks,
>>> Mojo
>>>
>>>
>
> If I were to use vcovHAC instead of vcovHC, does that correct for serial
> correlation as well as Heteroskedasticity?
Yes, as the name (HAC = Heteroskedasticity and Autocorrelation Consistent)
conveys. But for details please read the papers that accompany the
software package and the original references cited therein.
Z
> Thanks,
> Mojo
>

Message: 32
Date: Fri, 21 Jan 2011 21:23:27 +0530
From: "Bogaso Christofer"
To: "'jim holtman'"
Cc: rhelp@rproject.org
Subject: Re: [R] How to look into the asterisked function?
MessageID: <005001cbb983$5aa358e0$0fea0aa0$@gmail.com>
ContentType: text/plain; charset="iso88591"
Thanks Jim and Henrique for your replies. I would like to know why some
particular functions are asterisked? What is the pros and cons while making
a typical UDF asterisked? How can I make a typical function asterisked? For
example print.anova() is not asterisked however print.acf() is. How can I
make print.anova() asterisked?
Thanks and regards,
Original Message
From: jim holtman [mailto:jholtman@gmail.com]
Sent: 21 January 2011 18:20
To: Bogaso Christofer
Cc: rhelp@rproject.org
Subject: Re: [R] How to look into the asterisked function?
You can also use:
getAnywhere("functionName")
On Fri, Jan 21, 2011 at 8:02 AM, Bogaso Christofer
wrote:
> Hi friends, there is methods() function to see the all available
> methods for a particular function, for example:
>
>
>
>> head(methods("print"))
>
> [1] "print.acf" ? ? "print.anova" ? "print.aov" ? ? "print.aovlist"
> "print.ar" ? ? ?"print.Arima"
>
>
>
> In this list, there are some functions which are asterisked like
> print.acf(). How can I see the contents of those function?
>
>
>
> Thanks and regards,
>
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 33
Date: Fri, 21 Jan 2011 10:37:17 0500
From: "John Fox"
To: "'Rosario Garcia Gil'"
Cc: rhelp@rproject.org
Subject: Re: [R] Error in ANOVA for model comparison
MessageID: <002601cbb981$15e1cb30$41a56190$@mcmaster.ca>
ContentType: text/plain; charset="usascii"
Dear Rosario,
Because of missing data in the additional variable PHt, the two models
weren't fit to the same subset of valid observations  the default in lm()
is to use complete cases for the variables in the model.
A mechanical solution is to use na.omit() to filter your data set, only for
the variables you intend to use, to produce a data set with no NAs. Then
you'll fit each model to a consistent subset of valid cases.
Of course, if you have a substantial amount of missing data, completecase
analysis is probably a poor strategy.
I hope this helps,
John

John Fox
Senator William McMaster
Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox
> Original Message
> From: rhelpbounces@rproject.org [mailto:rhelpbounces@rproject.org]
> On Behalf Of Rosario Garcia Gil
> Sent: January2111 9:31 AM
> To: rhelp@rproject.org
> Subject: [R] Error in ANOVA for model comparison
>
> Hello
>
> I am trying to compare two models using anova(), however I get a message
> error (see below).
> In the net I only found some information on certain library(car) for
> which one should use anova with A capital letter (Anova instead of
> anova), but I could not find car library as it says it does not exist.
>
>
> > Model < lm(interceptG ~ SW + TSC + FSC + PF + SlopeG + K,
> data=AllTrait)
> > Model1 < lm(interceptG ~ SW + TSC + FSC + PF + SlopeG + PHt,
> data=AllTrait)
>
> Error in anova.lmlist(object, ...) :
> models were not all fitted to the same size of dataset
>
> I have NA in the datafile, should that be the problem?
>
> Kind regards and thanks in advance
> Rosario
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide http://www.Rproject.org/posting
> guide.html
> and provide commented, minimal, selfcontained, reproducible code.

Message: 34
Date: Fri, 21 Jan 2011 07:07:36 0800 (PST)
From: pete
To: rhelp@rproject.org
Subject: [R] clustering fuzzy
MessageID: <12956224567813229853.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
hello,
i'm pete ,how can i order rows of matrix by max to min value?
I have a matrix of membership degrees, with 82 (i) rows and K coloumns, K
are clusters.
I need first and second largest elements of the ith row.
for example
1 0.66 0.04 0.01 0.30
2 0.02 0.89 0.09 0.00
3 0.06 0.92 0.01 0.01
4 0.07 0.71 0.21 0.01
5 0.10 0.85 0.04 0.01
6 0.91 0.04 0.02 0.02
7 0.00 0.01 0.98 0.00
8 0.02 0.05 0.92 0.01
9 0.05 0.54 0.40 0.01
10 0.02 0.06 0.92 0.00
11 0.05 0.55 0.39 0.01
12 0.77 0.02 0.01 0.20
13 0.95 0.01 0.00 0.04
14 0.43 0.33 0.18 0.06
15 0.79 0.10 0.08 0.03
18 0.02 0.04 0.94 0.00
20 0.09 0.15 0.76 0.01
21 0.80 0.10 0.07 0.03
22 0.06 0.15 0.79 0.01
23 0.05 0.01 0.00 0.94
24 0.83 0.02 0.01 0.15
25 0.87 0.05 0.03 0.04
27 0.76 0.10 0.11 0.03
28 0.17 0.68 0.10 0.05
29 0.10 0.01 0.00 0.90
30 0.09 0.29 0.60 0.01
31 0.05 0.01 0.00 0.94
32 0.53 0.04 0.01 0.43
33 0.85 0.04 0.02 0.09
34 0.82 0.06 0.02 0.10
35 0.76 0.07 0.02 0.14
37 0.36 0.31 0.30 0.02
38 0.01 0.02 0.97 0.00
39 0.12 0.04 0.02 0.82
40 0.02 0.00 0.00 0.97
41 0.57 0.15 0.02 0.25
42 0.14 0.03 0.02 0.82
43 0.89 0.06 0.01 0.03
44 0.02 0.00 0.00 0.98
45 0.61 0.02 0.01 0.36
46 0.03 0.00 0.00 0.97
47 0.88 0.07 0.02 0.03
48 0.06 0.60 0.32 0.02
49 0.01 0.98 0.01 0.00
50 0.06 0.88 0.05 0.01
51 0.01 0.05 0.93 0.00
52 0.02 0.08 0.90 0.00
53 0.11 0.01 0.01 0.87
54 0.27 0.01 0.00 0.72
55 0.94 0.03 0.01 0.02
58 0.45 0.41 0.05 0.09
59 0.12 0.61 0.22 0.05
60 0.26 0.07 0.02 0.64
61 0.17 0.19 0.62 0.02
62 0.08 0.00 0.00 0.92
63 0.02 0.94 0.03 0.00
64 0.08 0.01 0.00 0.91
65 0.98 0.01 0.00 0.01
67 0.22 0.69 0.08 0.01
68 0.96 0.02 0.00 0.02
69 0.96 0.02 0.01 0.01
71 0.00 0.01 0.98 0.00
72 0.56 0.05 0.01 0.37
73 0.10 0.01 0.01 0.88
74 0.91 0.01 0.00 0.08
75 0.36 0.38 0.21 0.05
76 0.15 0.40 0.44 0.01
77 0.02 0.06 0.91 0.00
78 0.48 0.43 0.03 0.06
79 0.51 0.02 0.01 0.45
80 0.04 0.01 0.00 0.95
81 0.47 0.03 0.01 0.49
82 0.98 0.01 0.00 0.01
83 0.05 0.01 0.01 0.93
84 0.03 0.00 0.00 0.96
85 0.76 0.07 0.01 0.15
86 0.95 0.03 0.01 0.01
88 0.03 0.00 0.00 0.96
90 0.79 0.13 0.02 0.06
91 0.37 0.50 0.05 0.09
92 0.86 0.10 0.02 0.02
93 0.13 0.82 0.03 0.01
A[1,][order(A[1,],decreasing=TRUE)]
[1] 0.66 0.30 0.04 0.01
I want this for every row
thank you

View this message in context:
http://r.789695.n4.nabble.com/clusteringfuzzytp3229853p3229853.html
Sent from the R help mailing list archive at Nabble.com.

Message: 35
Date: Fri, 21 Jan 2011 14:16:47 0200
From: Henrique Dallazuanna
To: Den
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain
Try this:
aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse = "")
On Fri, Jan 21, 2011 at 10:25 AM, Den wrote:
> Dear [R] people
> Could you please help with following data transformation.
> Any suggestions, hints, references and even guessing on performing any
> of the following steps are highly appreciated. Those transformations are
> crucial for my work.
>
> (n_, _n, j_, k_ signify numbers)
>
> SOURCE DATA:
> id cycle1 cycle2 cycle3 … cycle_n
> 1 c c c c
> 1 m m m m
> 1 f f f f
> 2 m m m NA
> 2 f f f NA
> 2 c c c NA
> 3 a a NA NA
> 3 c c c NA
> 3 f f f NA
> 3 NA NA m NA
> ...........................................
>
>
>
> RESULT DATA1:
> id cyc1 cyc2 cyc3 … cyc_n
> 1 cfm cfm cfm cfm
> 2 cfm cfm cfm NA
> 3 acf acf cfm NA
> ...........................................
>
>
> RESULT DATA2:
> id treatment
> 1 n_cfm
> 2 j_cfm
> 3 2acf>k_cfm
> ...................
>
>
> RESULT DATA3:
> id regimen numOfCycles
> 1 cfm n_
> 2 cfm j_
> 3 asf>cfm {2+k_}
> .............................
>
>
>
> Thank you
> Denis
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Henrique Dallazuanna
CuritibaParanáBrasil
25° 25' 40" S 49° 16' 22" O
[[alternative HTML version deleted]]

Message: 36
Date: Fri, 21 Jan 2011 11:33:15 0500
From: jim holtman
To: pete
Cc: rhelp@rproject.org
Subject: Re: [R] clustering fuzzy
MessageID:
ContentType: text/plain; charset=ISO88591
use 'apply':
> head(x.m)
V2 V3 V4 V5
[1,] 0.66 0.04 0.01 0.30
[2,] 0.02 0.89 0.09 0.00
[3,] 0.06 0.92 0.01 0.01
[4,] 0.07 0.71 0.21 0.01
[5,] 0.10 0.85 0.04 0.01
[6,] 0.91 0.04 0.02 0.02
> x.m.sort < apply(x.m, 1, sort, decreasing = TRUE)
> head(t(x.m.sort))
[,1] [,2] [,3] [,4]
[1,] 0.66 0.30 0.04 0.01
[2,] 0.89 0.09 0.02 0.00
[3,] 0.92 0.06 0.01 0.01
[4,] 0.71 0.21 0.07 0.01
[5,] 0.85 0.10 0.04 0.01
[6,] 0.91 0.04 0.02 0.02
>
On Fri, Jan 21, 2011 at 10:07 AM, pete wrote:
>
> hello,
> i'm pete ,how can i order rows of matrix by max to min value?
> I have a matrix of membership degrees, with 82 (i) rows and K coloumns, K
> are clusters.
> I need first and second largest elements of the ith row.
>
> for example
> 1 ?0.66 0.04 0.01 0.30
> 2 ?0.02 0.89 0.09 0.00
> 3 ?0.06 0.92 0.01 0.01
> 4 ?0.07 0.71 0.21 0.01
> 5 ?0.10 0.85 0.04 0.01
> 6 ?0.91 0.04 0.02 0.02
> 7 ?0.00 0.01 0.98 0.00
> 8 ?0.02 0.05 0.92 0.01
> 9 ?0.05 0.54 0.40 0.01
> 10 0.02 0.06 0.92 0.00
> 11 0.05 0.55 0.39 0.01
> 12 0.77 0.02 0.01 0.20
> 13 0.95 0.01 0.00 0.04
> 14 0.43 0.33 0.18 0.06
> 15 0.79 0.10 0.08 0.03
> 18 0.02 0.04 0.94 0.00
> 20 0.09 0.15 0.76 0.01
> 21 0.80 0.10 0.07 0.03
> 22 0.06 0.15 0.79 0.01
> 23 0.05 0.01 0.00 0.94
> 24 0.83 0.02 0.01 0.15
> 25 0.87 0.05 0.03 0.04
> 27 0.76 0.10 0.11 0.03
> 28 0.17 0.68 0.10 0.05
> 29 0.10 0.01 0.00 0.90
> 30 0.09 0.29 0.60 0.01
> 31 0.05 0.01 0.00 0.94
> 32 0.53 0.04 0.01 0.43
> 33 0.85 0.04 0.02 0.09
> 34 0.82 0.06 0.02 0.10
> 35 0.76 0.07 0.02 0.14
> 37 0.36 0.31 0.30 0.02
> 38 0.01 0.02 0.97 0.00
> 39 0.12 0.04 0.02 0.82
> 40 0.02 0.00 0.00 0.97
> 41 0.57 0.15 0.02 0.25
> 42 0.14 0.03 0.02 0.82
> 43 0.89 0.06 0.01 0.03
> 44 0.02 0.00 0.00 0.98
> 45 0.61 0.02 0.01 0.36
> 46 0.03 0.00 0.00 0.97
> 47 0.88 0.07 0.02 0.03
> 48 0.06 0.60 0.32 0.02
> 49 0.01 0.98 0.01 0.00
> 50 0.06 0.88 0.05 0.01
> 51 0.01 0.05 0.93 0.00
> 52 0.02 0.08 0.90 0.00
> 53 0.11 0.01 0.01 0.87
> 54 0.27 0.01 0.00 0.72
> 55 0.94 0.03 0.01 0.02
> 58 0.45 0.41 0.05 0.09
> 59 0.12 0.61 0.22 0.05
> 60 0.26 0.07 0.02 0.64
> 61 0.17 0.19 0.62 0.02
> 62 0.08 0.00 0.00 0.92
> 63 0.02 0.94 0.03 0.00
> 64 0.08 0.01 0.00 0.91
> 65 0.98 0.01 0.00 0.01
> 67 0.22 0.69 0.08 0.01
> 68 0.96 0.02 0.00 0.02
> 69 0.96 0.02 0.01 0.01
> 71 0.00 0.01 0.98 0.00
> 72 0.56 0.05 0.01 0.37
> 73 0.10 0.01 0.01 0.88
> 74 0.91 0.01 0.00 0.08
> 75 0.36 0.38 0.21 0.05
> 76 0.15 0.40 0.44 0.01
> 77 0.02 0.06 0.91 0.00
> 78 0.48 0.43 0.03 0.06
> 79 0.51 0.02 0.01 0.45
> 80 0.04 0.01 0.00 0.95
> 81 0.47 0.03 0.01 0.49
> 82 0.98 0.01 0.00 0.01
> 83 0.05 0.01 0.01 0.93
> 84 0.03 0.00 0.00 0.96
> 85 0.76 0.07 0.01 0.15
> 86 0.95 0.03 0.01 0.01
> 88 0.03 0.00 0.00 0.96
> 90 0.79 0.13 0.02 0.06
> 91 0.37 0.50 0.05 0.09
> 92 0.86 0.10 0.02 0.02
> 93 0.13 0.82 0.03 0.01
>
>
> ?A[1,][order(A[1,],decreasing=TRUE)]
> [1] 0.66 0.30 0.04 0.01
>
> I want this for every row
> thank you
> 
> View this message in context:
http://r.789695.n4.nabble.com/clusteringfuzzytp3229853p3229853.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 37
Date: Fri, 21 Jan 2011 09:34:40 0800
From: Hongwei Dong
To: rhelp@rproject.org
Subject: [R] Maxiter specification in R
MessageID:
>
ContentType: text/plain
Dear R users,
I'm having a problem with maxiter specification in VGLM function. I tried to
increase the number of iteration to 100, but it still stopped at 30, which
is the default. Here is my script:
FIT < vglm(SFH_PCT ~ RD_DEN + CAR_HH + TRS + RES_L, tobit(Lower=0), maxiter
= 100)
Thanks
Gary
[[alternative HTML version deleted]]

Message: 38
Date: Fri, 21 Jan 2011 12:49:59 0500
From: David Winsemius
To: Hongwei Dong
Cc: rhelp@rproject.org
Subject: Re: [R] Maxiter specification in R
MessageID: <92440801393A4E6AA57375007CCC4413@comcast.net>
ContentType: text/plain; charset=USASCII; format=flowed; delsp=yes
On Jan 21, 2011, at 12:34 PM, Hongwei Dong wrote:
> Dear R users,
>
> I'm having a problem with maxiter specification in VGLM function. I
> tried to
> increase the number of iteration to 100, but it still stopped at 30,
> which
> is the default. Here is my script:
>
> FIT < vglm(SFH_PCT ~ RD_DEN + CAR_HH + TRS + RES_L, tobit(Lower=0),
> maxiter
> = 100)
?vglm.control
>

David Winsemius, MD
West Hartford, CT

Message: 39
Date: Fri, 21 Jan 2011 11:57:36 0600
From: Terry Therneau
To: Hongwei Dong
Cc: "rhelp@lists.Rproject.org"
Subject: Re: [R] number of iterations in a Tobit model
MessageID: <1295632656.840.12.camel@punchbuggy>
ContentType: text/plain
 begin inclusion 
I'm running a Tobit model but convergence can not be reached within 30
iterations. Is there anyway I can change the max number of iterations?
Thanks.
 end inclusion 
"Tobit" is simply a linear model with censored data. You don't say how
you are fitting this, but I'll assume you are using survreg
fit < survreg(Surv(time, status) ~ x1 + x2, dist='gaussian',..)
with appropriate additional arguments to the Surv function if the data
is left or interval censored.
If survreg doesn't converge in 30 iterations it likely won't converge
in 100 or more. The NewtonRaphson algoritm has gotton lost. Data sets
with a very large fraction of censored observations can be numerically
challenging. help(survreg.control) will tell you all the necessary
details however.
Over the years I have accumulated a few data sets that were very
difficult maximizations for survreg, and led to further tuning of the
underlying algorithm. Yours would be the first new one in a while; if
you are willing to share it that would help me track down the issue.
You likely will need to use specific starting estimates.
If you are not using survreg, try it. Perhaps it is already robust
enough for your data.
Terry Therneau

Message: 40
Date: Fri, 21 Jan 2011 13:12:01 0500
From: "Liaw, Andy"
To: "Czerminski, Ryszard" ,
Subject: Re: [R] randomForest: too many elements specified?
MessageID:
ContentType: text/plain; charset="usascii"
I grep for "n, n)" in all the R code of the package (current version),
and the only place that happens is in creating proximity. Can you do a
traceback() and see where it happens?
You should seriously consider upgrading R and the packages...
Andy
> Original Message
> From: rhelpbounces@rproject.org
> [mailto:rhelpbounces@rproject.org] On Behalf Of Czerminski, Ryszard
> Sent: Thursday, January 20, 2011 1:08 PM
> To: rhelp@stat.math.ethz.ch
> Subject: [R] randomForest: too many elements specified?
>
> I getting "Error in matrix(0, n, n) : too many elements specified"
> while building randomForest model, which looks like memory allocation
> error.
> Software versions are: randomForest 4.525, R version 2.7.1
>
> Dataset is big (~90K rows, ~200 columns), but this is on a
> big machine (
> ~120G RAM)
> and I call randomForest like this: randomForest(x,y)
> i.e. in supervised mode and not requesting proximity matrix, therefore
> answer from Andy Liaw to an email reporting the same problems in 2005
> (see below)
> is probably not directly applicable, still it looks like it is too big
> data set for this dataset/machine combination.
>
> How does memory usage in randomForest scale with dataset size?
> Is there a way to build global rf model with dataset of this size?
>
> Best regards,
> Ryszard
>
> Ryszard Czerminski
> AstraZeneca Pharmaceuticals LP
> 35 Gatehouse Drive
> Waltham, MA 02451
> USA
> 7818394304
> ryszard.czerminski@astrazeneca.com
>
> RE: [R] randomForest: too many element specified?
> Liaw, Andy
> Mon, 17 Jan 2005 05:56:28 0800
> > From: luk
> >
> > When I run randonForest with a 169453x5 matrix, I got the
> > following message.
> >
> > Error in matrix(0, n, n) : matrix: too many elements specified
> >
> > Can you please advise me how to solve this problem?
> >
> > Thanks,
> >
> > Lu
>
> 1. When asking new questions, please don't reply to other posts.
>
> 2. When asking questions like these, please do show the commands you
> used.
>
> My guess is that you asked for the proximity matrix, or is running
> unsupervised randomForest (by not providing a response vector). This
> will
> requires a couple of n by n matrices to be created (on top of other
> things),
> n being 169453 in this case. To store a 169453 x 169453 matrix in
> double
> precision, you need 169453^2 * 8 bytes, or or nearly 214 GB of memory.
> Even
> if you have that kind of hardware, I doubt you'll be able to make much
> sense
> out of the result.
>
> Andy
>
>
>
> 
> 
> Confidentiality Notice: This message is private and may
> ...{{dropped:11}}
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>
Notice: This email message, together with any attachme...{{dropped:11}}

Message: 41
Date: Fri, 21 Jan 2011 12:24:55 0600
From: Douglas Bates
To: kamel gaanoun
Cc: rhelp@rproject.org
Subject: Re: [R] nlminb doesn't converge and produce a warning
MessageID:
>
ContentType: text/plain; charset=ISO88591
On Fri, Jan 21, 2011 at 3:51 AM, kamel gaanoun
wrote:
> Hi Everybody,
>
> My problem is that nlminb doesn't converge, in minimising a logLikelihood
> function, with 31*6 parameters(2 weibull parameters+29 regressors repeated
6
> times).
Hmm, the length of the parameter vector shown below is 189, which is
neither 31*6 nor 2 + 29*6.
I suppose it is possible to do nonlinear optimization with box
constraints on such a large number of parameters but you should expect
it to take a long time and perhaps a lot of memory. Even if the
optimizer converges, it would be optimistic to expect that the
parameter value returned is necessarily the global optimum. I would
recommend trying to simplify the optimization problem. A method like
this is just using the computer as a blunt instrument with which to
bludgeon the problem to death (sometimes called the "SAS approach").
>
>
> I use nlminb like this :
> res1<nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(Inf,
n15)),
> upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n15)), control =
> list(maxit=1000) )
>
> and that's the result :
>
> Message d'avis :
> In nlminb(vect, V, lower = c(rep(0.01, 12), rep(0.01, 3), rep(Inf, ?:
> ?unrecognized control element(s) named `maxit' ignored
>> res1
> $par
> ?[1] ? 2.48843979 ? 4.75209125 ? 2.57199837 ?16.80712783 ? 3.15211075
> 16.86606178 ?58.61925499 ?37.85793462 ?48.78215699
> ?[10] 151.64638501 ?43.60420299 ?15.14639541 ? 0.58754382 ? 0.76180935
> 0.66191763 ?0.26802757 ?0.96378197 ?0.68369525
> ?[19] ? 0.37813096 ? 0.89778593 10.26471908 ?0.87265813 ? 6.43973968
> 1.74417166 ?12.00193419 ? 0.60638326 ?1.66675589
> ?[28] ? 1.29312079 ? 1.39846863 ?0.48449361 ?20.14470193 ?0.50729841
> 2.15177967 ?0.78155345 ? 0.41857810 ?0.40863744
> ?[37] 17.18489562 ?1.69140562 ? 1.45236861 ?0.23738183 ? 5.47688642
> 0.71546576 ? 9.95015047 ?2.16096138 ?0.74503151
> ?[46] ?0.66258461 ? 5.38871217 ? 2.53147752 12.58827379 ?0.45669589
> 0.37285088 ? 2.15116198 ?2.50414066 ?0.99752892
> ?[55] ? 4.83972450 ?1.16496925 ?3.53429528 ? 0.56083677 ?9.87490932
> 1.75153657 ? 9.87912224 ?0.75783517 ?9.95423392
> ?[64] ?0.07530469 ?0.73466191 ?0.27397382 ?15.15891548 ?0.02489436
> 12.91493065 ?4.65335356 ? 0.03524561 ? 0.00000000
> ?[73] ?9.06720312 ?0.25413758 ?0.18578765 ? 0.53283198 ?4.02688497
> 0.50581412 ?0.31544940 ? 0.57450848 ? 6.15206152
> ?[82] ? 0.08178377 ? 0.82978606 ? 0.39337352 ?3.65304712 ?0.06833839
> 3.87790848 ?1.08017043 ? 3.62779184 ?0.14700541
> ?[91] 13.95610827 ?1.50385432 ? 8.05851743 ?1.24250013 ?0.01249817
> 0.38085483 ?4.97064573 ?0.98852401 ?3.00305183
> [100] ? 0.35053875 ?4.26833889 ?0.12463188 ?16.05828402 ? 0.41736764
> 0.94678922 ?0.75813452 ? 2.15378348 ? 0.39586048
> [109] ? 1.41359441 ? 0.81603207 ?4.43963958 ?0.79438435 ? 0.49530882
> 0.11197484 ?8.43196798 ? 1.00456535 22.04423030
> [118] ?0.11532887 ? 2.58085765 ? 1.41912515 ?0.78120889 ?1.23850824
> 12.39079062 ? 0.23567444 ? 1.39557879 ?2.22993802
> [127] 12.58827379 ?0.45669589 ?0.37285088 ?0.73563805 ? 3.40201735
> 0.58550247 ?3.62769828 ? 0.21657740 ?7.37785506
> [136] ?0.68218180 ? 6.41876225 ? 0.38708385 ?0.33009429 ?0.25230736
> 3.53672719 ? 1.53676202 ? 3.65074513 ? 0.42623602
> [145] ?7.26982010 ? 0.70597611 23.15198788 ?0.36822845 ?2.29863267
> 0.70223129 14.45665129 ?0.54094864 ?2.17858443
> [154] ?0.56501734 ? 2.50032796 ?0.45677181 ?12.04113439 ?1.42294094
> 16.16874444 ?0.49101846 ?6.29724769 ?1.38333722
> [163] 14.16552579 ? 1.57502968 ? 5.04329383 ? 0.24857745 ?1.69885428
> 0.46757266 ? 4.41795651 ?2.41006349 ? 4.61648610
> [172] ? 0.42235314 ?3.22153895 ?0.15443857 ? 1.07661101 ?0.63653449
> 2.74034265 ? 0.20898466 ? 1.37927183 ? 0.26722477
> [181] 15.09685067 ? 0.87160467 24.79722150 ? 1.48810684 ? 1.70068893
> 0.22538026 ? 7.63908028 ? 1.60431981 ?7.52661064
>
> $objective
> [1] 1514.691
>
> $convergence
> [1] 1
>
> $message
> [1] "iteration limit reached without convergence (9)"
>
> $iterations
> [1] 150
>
> $evaluations
> function gradient
> ? ? 176 ? ?44935
>
> I tried many times to take the res1$par as initial values and retry againe
> but still doesn't converge.
>
>
> Any help will save me Thanks
>
> 
> Kamel Gaanoun
> (+33) (0)6.76.04.65.77
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Message: 42
Date: Fri, 21 Jan 2011 13:26:52 0500
From: "Ravi Varadhan"
To: "'Karl Ove Hufthammer'" ,
Subject: Re: [R] nlminb doesn't converge and produce a warning
MessageID: <001801cbb998$c646b000$52d41000$@edu>
ContentType: text/plain; charset="utf8"
Hi,
It is indeed annoying that each optimization code has different names for
the parameters that control the behavior of the algorithms. This is one of
the reasons that we have developed "optimx"  to unify the calling
convention for the various algorithms. You can call the optimization
algorithm of your choice without having to worry about the names of the
control parameters.
Ravi.

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins University
Ph. (410) 5022619
email: rvaradhan@jhmi.edu
Original Message
From: rhelpbounces@rproject.org [mailto:rhelpbounces@rproject.org] On
Behalf Of Karl Ove Hufthammer
Sent: Friday, January 21, 2011 6:48 AM
To: rhelp@stat.math.ethz.ch
Subject: Re: [R] nlminb doesn't converge and produce a warning
kamel gaanoun wrote:
> I use nlminb like this :
> res1<nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(Inf,
> n15)), upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n15)), control =
> list(maxit=1000) )
>
> and that's the result :
>
> Message d'avis :
> In nlminb(vect, V, lower = c(rep(0.01, 12), rep(0.01, 3), rep(Inf, :
> unrecognized control element(s) named `maxit' ignored
Just increase the maximum number of iterations. Which you tried to do, but
didn?t succeed in, as the above warnings shows. The argument is called
?iter.max?, not ?max.iter?.

Karl Ove Hufthammer
______________________________________________
Rhelp@rproject.org mailing list
https://stat.ethz.ch/mailman/listinfo/rhelp
PLEASE do read the posting guide http://www.Rproject.org/postingguide.html
and provide commented, minimal, selfcontained, reproducible code.

Message: 43
Date: Fri, 21 Jan 2011 13:30:53 0500
From: Duncan Murdoch
To: "D Kelly O'Day"
Cc: rhelp@rproject.org
Subject: Re: [R] Unexpected Gap in simple line plot
MessageID: <4D39D0DD.6070805@gmail.com>
ContentType: text/plain; charset=ISO88591; format=flowed
On 20/01/2011 9:33 PM, D Kelly O'Day wrote:
> Bill& Duncan
>
> Thanks for your quick reply. I would still be looking for days.
>
> Now I have to figure out how the bad data got into cts since I generate
this
> file each month.
When I read that .csv file in OpenOffice, the lines with the NAs arise
because the line before has an extra column. That might be a hint as to
what's going wrong in the generation...
Duncan Murdoch

Message: 44
Date: Fri, 21 Jan 2011 19:41:50 +0100
From: JiHO
To: R Help
Subject: [R] Marginality rule between powers and interaction terms in
lm()
MessageID:
ContentType: text/plain; charset=UTF8
Dear all,
I have a model with simple terms, quadratic effects, and interactions.
I am wondering what to do when a variable is involved in a significant
interaction and in a nonsignificant quadratic effect. Here is an
example
d = data.frame(a=runif(20), b=runif(20))
d$y = d$a + d$b^2
So I create both an simple effect of a and a quadratic effect of b.
m = lm(y ~ a + b + I(a^2) + I(b^2) + a:b, data=d)
drop1(m)
...
Df Sum of Sq RSS AIC
0.000000 1487.56
I(a^2) 1 0.000000 0.000000 1482.04
I(b^2) 1 0.098444 0.098444 96.28
a:b 1 0.000000 0.000000 1488.37
Here R cleverly shows that I can drop a:b or any quadratic term
(suggesting that they have equal marginality?) but not simple terms
since they are marginal to the quadratic or the interaction terms. At
this point the interaction is not significant so the situation is
simple: drop a:b, then drop a^2 and then stop.
Now let's add an interaction
d[d$b > 0.5, "y"] = d[d$b > 0.5, "y"] + 0.01*d[d$b > 0.5, "a"]
m = lm(y ~ a + b + I(a^2) + I(b^2) + a:b, data=d)
summary(m)
...
(Intercept) 3.275e04 1.585e03 0.207 0.83932
a 9.988e01 5.839e03 171.070 < 2e16 ***
b 1.613e04 5.492e03 0.029 0.97698
I(a^2) 6.515e05 5.159e03 0.013 0.99010
I(b^2) 1.001e+00 4.892e03 204.593 < 2e16 ***
a:b 1.191e02 3.221e03 3.698 0.00238 **
Now the interaction *is* significant, but a^2 still isn't. drop1()
still suggests that I can remove either the interaction or the
quadratic terms:
drop1(m)
...
Df Sum of Sq RSS AIC
0.000033 254.306
I(a^2) 1 0.000000 0.000033 256.306
I(b^2) 1 0.098611 0.098644 96.239
a:b 1 0.000032 0.000065 242.674
However, this: http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf
suggests that marginality rules between powers of variables might not
be implemented (although they might have been since 2000).
My question is: I am "allowed", according to marginality rules, to remove
a^2?
I have found plenty of information on how the coefficients
corresponding to single terms change meaning when a quadratic term or
an interation is involved, and why they should not be removed in most
circumstances. I haven't found anything related to quadratic vs.
interactions.
Thanks in advance for your help. Sincerely,
JiHO

http://maururu.net

Message: 45
Date: Fri, 21 Jan 2011 13:47:49 0500
From: Xebar Saram
To: rhelp@stat.math.ethz.ch
Subject: [R] extracting random intercept
MessageID:
>
ContentType: text/plain
Hi all
I am using this model for a time series analysis :
lung_new < (glmmPQL(LUNG ~ 1, random = ~ 1  GUID, family = poisson, data =
ts0004lag)
Im interested in extracting just the random intercept
can anyone point me in the right direction
thx
zeltak
[[alternative HTML version deleted]]

Message: 46
Date: Fri, 21 Jan 2011 13:51:00 0500
From: Xebar Saram
To: rhelp@stat.math.ethz.ch
Subject: [R] Extracting random intercept
MessageID:
ContentType: text/plain; charset=ISO88591
Hi all
I am using this model for a time series analysis :
lung_new < (glmmPQL(LUNG ~ 1, random = ~ 1  GUID, family = poisson,
data = ts0004lag)
Im?interested?in extracting just the random intercept
can anyone point me in the right direction
thx
zeltak

Message: 47
Date: Fri, 21 Jan 2011 11:29:56 0800
From: "MacQueen, Don"
To: John Helly , "rhelp@rproject.org"
Subject: Re: [R] Inconsisten graphics i/o when using Rscript versus
GUI
MessageID:
>
ContentType: text/plain
John,
The first thing I would do is create a simpler example, i.e., to help
isolate the issue. Here’s a simple example:
The contents of a file are:

#! /usr/bin/Rscript
pdf('test1.pdf')
plot(1:10)
dev.off()
pdf('test2.pdf')
plot(10:1)
dev.off()

With this file, I get both pdf files either way.
Since you’re using plotting functions from ggplot2, you may need to wrap
print() around the qplot() call in the second one. That is,
print( qplot(fitted(profiles.spl), residuals(profiles.spl)) )
The ‘null device’ message is what dev.off() returns, as in this example:
> x11()
> dev.off()
null device
1
So it’s not relevant. However, with my simple example above, I get the ‘null
device’ message twice when I run it as an Rscript.
What’s the first line of your file look like? Try including the 
restore option, if you have not already:
#! /usr/bin/Rscript —restore
Your .RData file is not automatically loaded with Rscript, and the plot that
isn’t happening may depend on some object that is loaded from .RData.
Although, in that case, I would expect an error message.
Don
On 1/20/11 6:53 PM, "John Helly" wrote:
Hi.
I'm running R OS X GUI 1.35dev Leopard build 64bit. When I run the
following code (snippet from a larger code) from the GUI I obtain 2 separate
*.pdf files as you would expect from the highlighted code. However, when I
run from Rscript (commandline), I only get the first one. No errors appear
in the console log however I do get a 'null device' message that I don't
understand. It's probably related but I have no clue how to debug this.
Perhaps the second output file is not getting initialized? I've tried a
few variations to see if I can unearth the cause but no joy so far. Any
suggestions would be appreciated.
Thanks.
...
profiles.spl < smooth.spline(x, y)
(profiles.spl)
x_pred = seq(1,as.integer(max(x)))
B = data.frame(predict(profiles.spl,x_pred))
pdf(file=paste("/Volumes/SLR_Data_001/USN_SERDP_SLR/data/level1/beach_profiles_Flick/",Filename,".pdf",sep=""))
caption = paste(aLocation," (", aYear,".",aMonth,".",aDay,")",sep="")
credits = paste("splineWriter.R / hellyj@ucsd.edu / 20110120")
xrng = range(x)
yrng = range(y)
pred = qplot(x,y, data=B, xlab="Distance (m)", ylab = "Elevation (m)",
xlim=c(0,1000), ylim=c(12,4))
pred + geom_text(aes(700,2,label=caption)) +
geom_text(aes(180,12,label=credits),size=2.7)
dev.off()
## Residual (Tukey Anscombe) plot:
pdf(file=paste("/Volumes/SLR_Data_001/USN_SERDP_SLR/data/level1/beach_profiles_Flick/",Filename,"TA.pdf",sep=""))
qplot(fitted(profiles.spl), residuals(profiles.spl))
dev.off()
...

John Helly, University of California, San Diego / San Diego Supercomputer
Center / Scripps Institution of Oceanography / stonesteps (Skype) /
stonesteps7 (iChat) / http://www.sdsc.edu/~hellyj
[[alternative HTML version deleted]]
______________________________________________
Rhelp@rproject.org mailing list
https://stat.ethz.ch/mailman/listinfo/rhelp
PLEASE do read the posting guide http://www.Rproject.org/postingguide.html
and provide commented, minimal, selfcontained, reproducible code.

Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
925 4231062
[[alternative HTML version deleted]]

Message: 48
Date: Fri, 21 Jan 2011 17:56:52 0200
From: Henrique Dallazuanna
To: Den
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain
Try this:
aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN =
paste, collapse = "", na.action = na.pass)
On Fri, Jan 21, 2011 at 5:45 PM, Den wrote:
> Dear Henrique
> Thank you again for helping me
> Unfortunately, your code seems not to be working
>
> > aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "")
> id cycle1 cycle2 cycle3
> 1 1 cmf cmf cmf
> 2 2 mfc mfc mfc
> 3 3 cf cf cf
>
> (letter 'a' missing in df[3,c("cycle1",cycle2")]
>
> You suggested very interesting approach, however. Those '.~ id' and
> 'as.character' gave me hope for success.
> With very best regards
> Denis
>
>
> Ð£ ÐŸÑ Ñ‚, 21/01/2011 Ñƒ 14:16 0200, Henrique Dallazuanna Ð¿Ñ–ÑˆÐ°:
> > Try this:
> >
> > aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse =
> > "")
> >
> > On Fri, Jan 21, 2011 at 10:25 AM, Den wrote:
> > Dear [R] people
> > Could you please help with following data transformation.
> > Any suggestions, hints, references and even guessing on
> > performing any
> > of the following steps are highly appreciated. Those
> > transformations are
> > crucial for my work.
> >
> > (n_, _n, j_, k_ signify numbers)
> >
> > SOURCE DATA:
> > id cycle1 cycle2 cycle3 â€¦ cycle_n
> > 1 c c c c
> > 1 m m m m
> > 1 f f f f
> > 2 m m m NA
> > 2 f f f NA
> > 2 c c c NA
> > 3 a a NA NA
> > 3 c c c NA
> > 3 f f f NA
> > 3 NA NA m NA
> > ...........................................
> >
> >
> >
> > RESULT DATA1:
> > id cyc1 cyc2 cyc3 â€¦ cyc_n
> > 1 cfm cfm cfm cfm
> > 2 cfm cfm cfm NA
> > 3 acf acf cfm NA
> > ...........................................
> >
> >
> > RESULT DATA2:
> > id treatment
> > 1 n_cfm
> > 2 j_cfm
> > 3 2acf>k_cfm
> > ...................
> >
> >
> > RESULT DATA3:
> > id regimen numOfCycles
> > 1 cfm n_
> > 2 cfm j_
> > 3 asf>cfm {2+k_}
> > .............................
> >
> >
> >
> > Thank you
> > Denis
> >
> > ______________________________________________
> > Rhelp@rproject.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/rhelp
> > PLEASE do read the posting guide
> > http://www.Rproject.org/postingguide.html
> > and provide commented, minimal, selfcontained, reproducible
> > code.
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParanÃ¡Brasil
> > 25Â° 25' 40" S 49Â° 16' 22" O
>
>
>

Henrique Dallazuanna
CuritibaParanÃ¡Brasil
25Â° 25' 40" S 49Â° 16' 22" O
[[alternative HTML version deleted]]

Message: 49
Date: Fri, 21 Jan 2011 18:00:42 0200
From: Henrique Dallazuanna
To: Den
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain
correction:
aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "",
na.action = na.pass)
On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna wrote:
> Try this:
>
> aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN =
> paste, collapse = "", na.action = na.pass)
>
>
> On Fri, Jan 21, 2011 at 5:45 PM, Den wrote:
>
>> Dear Henrique
>> Thank you again for helping me
>> Unfortunately, your code seems not to be working
>>
>> > aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "")
>> id cycle1 cycle2 cycle3
>> 1 1 cmf cmf cmf
>> 2 2 mfc mfc mfc
>> 3 3 cf cf cf
>>
>> (letter 'a' missing in df[3,c("cycle1",cycle2")]
>>
>> You suggested very interesting approach, however. Those '.~ id' and
>> 'as.character' gave me hope for success.
>> With very best regards
>> Denis
>>
>>
>> Ð£ ÐŸÑ Ñ‚, 21/01/2011 Ñƒ 14:16 0200, Henrique Dallazuanna Ð¿Ñ–ÑˆÐ°:
>> > Try this:
>> >
>> > aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse =
>> > "")
>> >
>> > On Fri, Jan 21, 2011 at 10:25 AM, Den wrote:
>> > Dear [R] people
>> > Could you please help with following data transformation.
>> > Any suggestions, hints, references and even guessing on
>> > performing any
>> > of the following steps are highly appreciated. Those
>> > transformations are
>> > crucial for my work.
>> >
>> > (n_, _n, j_, k_ signify numbers)
>> >
>> > SOURCE DATA:
>> > id cycle1 cycle2 cycle3 â€¦ cycle_n
>> > 1 c c c c
>> > 1 m m m m
>> > 1 f f f f
>> > 2 m m m NA
>> > 2 f f f NA
>> > 2 c c c NA
>> > 3 a a NA NA
>> > 3 c c c NA
>> > 3 f f f NA
>> > 3 NA NA m NA
>> > ...........................................
>> >
>> >
>> >
>> > RESULT DATA1:
>> > id cyc1 cyc2 cyc3 â€¦ cyc_n
>> > 1 cfm cfm cfm cfm
>> > 2 cfm cfm cfm NA
>> > 3 acf acf cfm NA
>> > ...........................................
>> >
>> >
>> > RESULT DATA2:
>> > id treatment
>> > 1 n_cfm
>> > 2 j_cfm
>> > 3 2acf>k_cfm
>> > ...................
>> >
>> >
>> > RESULT DATA3:
>> > id regimen numOfCycles
>> > 1 cfm n_
>> > 2 cfm j_
>> > 3 asf>cfm {2+k_}
>> > .............................
>> >
>> >
>> >
>> > Thank you
>> > Denis
>> >
>> > ______________________________________________
>> > Rhelp@rproject.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/rhelp
>> > PLEASE do read the posting guide
>> > http://www.Rproject.org/postingguide.html
>> > and provide commented, minimal, selfcontained, reproducible
>> > code.
>> >
>> >
>> >
>> > 
>> > Henrique Dallazuanna
>> > CuritibaParanÃ¡Brasil
>> > 25Â° 25' 40" S 49Â° 16' 22" O
>>
>>
>>
>
>
> 
> Henrique Dallazuanna
> CuritibaParanÃ¡Brasil
> 25Â° 25' 40" S 49Â° 16' 22" O
>

Henrique Dallazuanna
CuritibaParanÃ¡Brasil
25Â° 25' 40" S 49Â° 16' 22" O
[[alternative HTML version deleted]]

Message: 50
Date: Fri, 21 Jan 2011 19:59:38 +0000
From: Akash
To: rhelp@rproject.org
Subject: [R] Information
MessageID:
ContentType: text/plain
Hello
I am student of Bioinformatics and I am doin somework in R in which some
problem occurs. So Please help me to solve these problems.
I have two problems:
1. How to generate a graph in which there are 8 rows and 20 columns are
present?
2. And how to put some title in the end of the graph i.e for example after
generating the rows if I want to give the name in the end of those rows like
1,2,3...8.. how can I do this thing?
Right now I am using this code.
graph< function(X)
{
for(j in 1:8)
{
for(k in 1:20)
{
xx<((j1)*10)
rect(xx,y(j,k1,X),(xx)+10,y(j,k,X), col=colmap[k])
if ( X[k,j] != 0)
{
text( (xx+5),(y(j,k1,X) + round(X[k,j])/2), a[k])
}
}
}
}
plot(c(0,10*8),c(0,abc), col="white")
where "a" is sumthing which I have to put inside of those rows and columns
Looking for your positive reply.
Thanking You
With Regards
Akash
[[alternative HTML version deleted]]

Message: 51
Date: Fri, 21 Jan 2011 21:45:27 +0200
From: Den
To: Henrique Dallazuanna
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID: <1295639127.7130.27.camel@den2042desktop>
ContentType: text/plain; charset="UTF8"
Dear Henrique
Thank you again for helping me
Unfortunately, your code seems not to be working
> aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "")
id cycle1 cycle2 cycle3
1 1 cmf cmf cmf
2 2 mfc mfc mfc
3 3 cf cf cf
(letter 'a' missing in df[3,c("cycle1",cycle2")]
You suggested very interesting approach, however. Those '.~ id' and
'as.character' gave me hope for success.
With very best regards
Denis
? ???, 21/01/2011 ? 14:16 0200, Henrique Dallazuanna ????:
> Try this:
>
> aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse =
> "")
>
> On Fri, Jan 21, 2011 at 10:25 AM, Den wrote:
> Dear [R] people
> Could you please help with following data transformation.
> Any suggestions, hints, references and even guessing on
> performing any
> of the following steps are highly appreciated. Those
> transformations are
> crucial for my work.
>
> (n_, _n, j_, k_ signify numbers)
>
> SOURCE DATA:
> id cycle1 cycle2 cycle3 ? cycle_n
> 1 c c c c
> 1 m m m m
> 1 f f f f
> 2 m m m NA
> 2 f f f NA
> 2 c c c NA
> 3 a a NA NA
> 3 c c c NA
> 3 f f f NA
> 3 NA NA m NA
> ...........................................
>
>
>
> RESULT DATA1:
> id cyc1 cyc2 cyc3 ? cyc_n
> 1 cfm cfm cfm cfm
> 2 cfm cfm cfm NA
> 3 acf acf cfm NA
> ...........................................
>
>
> RESULT DATA2:
> id treatment
> 1 n_cfm
> 2 j_cfm
> 3 2acf>k_cfm
> ...................
>
>
> RESULT DATA3:
> id regimen numOfCycles
> 1 cfm n_
> 2 cfm j_
> 3 asf>cfm {2+k_}
> .............................
>
>
>
> Thank you
> Denis
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible
> code.
>
>
>
> 
> Henrique Dallazuanna
> CuritibaParan?Brasil
> 25? 25' 40" S 49? 16' 22" O

Message: 52
Date: Fri, 21 Jan 2011 07:51:47 0800 (PST)
From: dpender
To: rhelp@rproject.org
Subject: [R] Storm Clustering using clusters in evd
MessageID: <12956251077423229951.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
Hi,
I am using the clusters function in the evd package in order to determine
storm events from a wave time series.
So far I have the code working as I want it for wave height on its own but I
would now like to include the period as well. The input data is in the form
of:
H t
H t
H t
so every height measurement has a corresponding period.
The storms are defined when the wave height exceeds a certain value and what
I am looking to do is to retain the corresponding periods relating to the
wave heights in the cluster. This would essentially result in a cluster
with 2 variables.
Does any one have any ideas?
Thanks in advance,
Doug

View this message in context:
http://r.789695.n4.nabble.com/StormClusteringusingclustersinevdtp3229951p3229951.html
Sent from the R help mailing list archive at Nabble.com.

Message: 53
Date: Fri, 21 Jan 2011 11:33:21 0500
From: Francesco Petrogalli
To: rhelp@rproject.org
Subject: [R] confidence interval
MessageID:
>
ContentType: text/plain; charset=ISO88591
Hi,
I have a circular shaped set of point on the plane (X,Y) centered in
zero. The distribution is more dense close to zero and less dense far
from zero.
I need to find the radius of a circle centered in zero that contains
65% of the points in the sample. Is there any R directive that can do
this?
I wanna start with 2D set of points, but the real case scenario is
with a 5D set of points.
Thanks,
Francesco

Message: 54
Date: Fri, 21 Jan 2011 14:38:42 0500
From: Francesco Petrogalli
To: rhelp@rproject.org
Subject: [R] ordering a vector
MessageID:
ContentType: text/plain; charset=ISO88591
Hi,
is there a R function that order a matrix according to some criteria
based on the rows(or cols) of that matrix?
For example, let's say that my matrix S is composed by n rows S_1,
S_2,.., S_n and that I compute some real value g_i=g(S_i) for each
row.
Then I want to order this set of g_i (from smaller to bigger) and
order the correspondent row to the new position.
Is it possible (apart from looping on the index) to do this with some
predefined R function?
Thanks,
Francesco

Message: 55
Date: Fri, 21 Jan 2011 09:26:48 0800 (PST)
From: poppinkid
To: rhelp@rproject.org
Subject: [R] How to find data that includes certain values
MessageID: <12956308086833230161.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
I am trying to return an index for a data set by searching using filenames.
The name may be ANG_AUT.N.0734C70411A1_1sA_0734C70411A.fasta, but i'd just
like to search it using the term "0734C70411" as the file may be
0734C70411A or 0734C70411C or 0734C70411D
Any way to do this other than doing something like this. where 0734C70411A
is part of matrix list[,8]
samp=paste("ANG_AUT.N.",list[i,8],"1_1sA_",list[i,8],".fasta",sep="")
data[which(data[,2]==samp),]
This is similar to the =~/ / function in perl.
Thanks

View this message in context:
http://r.789695.n4.nabble.com/Howtofinddatathatincludescertainvaluestp3230161p3230161.html
Sent from the R help mailing list archive at Nabble.com.

Message: 56
Date: Fri, 21 Jan 2011 18:10:21 +0000 (UTC)
From: jverzani
To: rhelp@stat.math.ethz.ch
Subject: Re: [R] User input in R program
MessageID:
ContentType: text/plain; charset=usascii
christiaan pauw gmail.com> writes:
>
> HI Everybody
>
> Does anyone know of documentation about different ways of obtaining user
> input in R. I have used readline() but I wondered is there are
sophisticated
> packages that does things like validate answers or generate selection
> lists.
You might consider the gWidgets package. Like rpanel, there are many
functions
that make this kind of thing quite easy to implement.

Message: 57
Date: Fri, 21 Jan 2011 11:42:35 0500
From: Michael Costello
To: rhelp@rproject.org
Subject: [R] Looping with incremented object name and increment
function
MessageID:
ContentType: text/plain
Folks,
I am trying to get a loop to run which increments the object name as part of
the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression models
that I have created.
> for (ii in c(1:4)){
+ SSE[ii]=rbind(anova(fit[ii])$"Sum Sq")
+ dfe[ii]=rbind(summary(fit[ii])$df)
+ }
Error in anova(fit[ii]) : object 'fit' not found
Why isn't it looking for object 'fit1' instead of 'fit'?
The idea is that it would store in SSE1 the Sum Sq of the model fit1, and so
on for the other 3 models. Is there a way to do this in R? I can do it in
Stata, but am only somewhat knowledgeable in R.
Michael
[[alternative HTML version deleted]]

Message: 58
Date: Fri, 21 Jan 2011 10:00:23 0800 (PST)
From: pete
To: rhelp@rproject.org
Subject: Re: [R] clustering fuzzy
MessageID: <12956328237363230228.post@n4.nabble.com>
ContentType: text/plain; charset=usascii
thank you ,you have been very kind

View this message in context:
http://r.789695.n4.nabble.com/clusteringfuzzytp3229853p3230228.html
Sent from the R help mailing list archive at Nabble.com.

Message: 59
Date: Fri, 21 Jan 2011 15:37:12 0500
From: jim holtman
To: poppinkid
Cc: rhelp@rproject.org
Subject: Re: [R] How to find data that includes certain values
MessageID:
ContentType: text/plain; charset=ISO88591
There are several pattern matching functions that will solve your problem:
grep regexpr
do RSiteSearch("pattern match")
On Fri, Jan 21, 2011 at 12:26 PM, poppinkid wrote:
>
> I am trying to return an index for a data set by searching using
filenames.
>
> The name may be ANG_AUT.N.0734C70411A1_1sA_0734C70411A.fasta, but i'd
just
> like to search it using the term "0734C70411" ?as the file may be
> 0734C70411A or 0734C70411C or 0734C70411D
>
> Any way to do this other than doing something like this. ?where
0734C70411A
> is part of matrix list[,8]
>
> samp=paste("ANG_AUT.N.",list[i,8],"1_1sA_",list[i,8],".fasta",sep="")
> data[which(data[,2]==samp),]
>
> This is similar to the =~/ / function in perl.
>
>
> Thanks
> 
> View this message in context:
http://r.789695.n4.nabble.com/Howtofinddatathatincludescertainvaluestp3230161p3230161.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 60
Date: Fri, 21 Jan 2011 18:37:36 0200
From: Henrique Dallazuanna
To: Den
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID:
ContentType: text/plain
Just change the FUN function:
aggregate(.~ id, lapply(df, as.character), FUN = function(x)paste(sort(x),
collapse = ''), na.action = na.pass)
On Fri, Jan 21, 2011 at 6:27 PM, Den wrote:
>
> Thank you for your efforts.
> Although it is still not working, it feels like getting closer and
> closer.
>
> id cycle1 cycle2 cycle3
> 1 1 cmf cmf cmf
> 2 2 mfc mfc mfc
> 3 3 acfNA acfNA NAcfm
>
> I really appreciate transformation from subsets ("c","m","f") to "cmf".
> That was critical for me.
> Hopefully, I'll figure out the rest later with ddply from plyr package.
> At least this is my idea for now.
>
>
>
> Ð£ ÐŸÑ Ñ‚, 21/01/2011 Ñƒ 18:00 0200, Henrique Dallazuanna Ð¿Ñ–ÑˆÐ°:
> > correction:
> > aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "",
> > na.action = na.pass)
> >
> > On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna
> > wrote:
> > Try this:
> >
> > aggregate(.~ id, lapply(replace(df, is.na(df), ''),
> > as.character), FUN = paste, collapse = "", na.action =
> > na.pass)
> >
> >
> >
> > On Fri, Jan 21, 2011 at 5:45 PM, Den
> > wrote:
> > Dear Henrique
> > Thank you again for helping me
> > Unfortunately, your code seems not to be working
> >
> > > aggregate(.~ id, lapply(df, as.character), FUN =
> > paste, collapse = "")
> > id cycle1 cycle2 cycle3
> > 1 1 cmf cmf cmf
> > 2 2 mfc mfc mfc
> > 3 3 cf cf cf
> >
> > (letter 'a' missing in df[3,c("cycle1",cycle2")]
> >
> > You suggested very interesting approach, however.
> > Those '.~ id' and
> > 'as.character' gave me hope for success.
> > With very best regards
> > Denis
> >
> >
> > Ð£ ÐŸÑ Ñ‚, 21/01/2011 Ñƒ 14:16 0200, Henrique
Dallazuanna
> > Ð¿Ñ–ÑˆÐ°:
> >
> > > Try this:
> > >
> > > aggregate(.~ id, lapply(test, as.character), FUN =
> > paste, collapse =
> > > "")
> > >
> > > On Fri, Jan 21, 2011 at 10:25 AM, Den
> > wrote:
> > > Dear [R] people
> > > Could you please help with following data
> > transformation.
> > > Any suggestions, hints, references and even
> > guessing on
> > > performing any
> > > of the following steps are highly
> > appreciated. Those
> > > transformations are
> > > crucial for my work.
> > >
> > > (n_, _n, j_, k_ signify numbers)
> > >
> > > SOURCE DATA:
> > > id cycle1 cycle2 cycle3 â€¦
> > cycle_n
> > > 1 c c c c
> > > 1 m m m m
> > > 1 f f f f
> > > 2 m m m NA
> > > 2 f f f NA
> > > 2 c c c NA
> > > 3 a a NA NA
> > > 3 c c c NA
> > > 3 f f f NA
> > > 3 NA NA m NA
> > > ...........................................
> > >
> > >
> > >
> > > RESULT DATA1:
> > > id cyc1 cyc2 cyc3 â€¦
> > cyc_n
> > > 1 cfm cfm cfm cfm
> > > 2 cfm cfm cfm NA
> > > 3 acf acf cfm NA
> > > ...........................................
> > >
> > >
> > > RESULT DATA2:
> > > id treatment
> > > 1 n_cfm
> > > 2 j_cfm
> > > 3 2acf>k_cfm
> > > ...................
> > >
> > >
> > > RESULT DATA3:
> > > id regimen numOfCycles
> > > 1 cfm n_
> > > 2 cfm j_
> > > 3 asf>cfm {2+k_}
> > > .............................
> > >
> > >
> > >
> > > Thank you
> > > Denis
> > >
> > >
> > ______________________________________________
> > > Rhelp@rproject.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/rhelp
> > > PLEASE do read the posting guide
> > > http://www.Rproject.org/postingguide.html
> > > and provide commented, minimal,
> > selfcontained, reproducible
> > > code.
> > >
> > >
> > >
> > > 
> > > Henrique Dallazuanna
> > > CuritibaParanÃ¡Brasil
> > > 25Â° 25' 40" S 49Â° 16' 22" O
> >
> >
> >
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParanÃ¡Brasil
> > 25Â° 25' 40" S 49Â° 16' 22" O
> >
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParanÃ¡Brasil
> > 25Â° 25' 40" S 49Â° 16' 22" O
>
>
>

Henrique Dallazuanna
CuritibaParanÃ¡Brasil
25Â° 25' 40" S 49Â° 16' 22" O
[[alternative HTML version deleted]]

Message: 61
Date: Fri, 21 Jan 2011 18:38:12 0200
From: Henrique Dallazuanna
To: poppinkid
Cc: rhelp@rproject.org
Subject: Re: [R] How to find data that includes certain values
MessageID:
ContentType: text/plain
Take a look on grep function.
On Fri, Jan 21, 2011 at 3:26 PM, poppinkid wrote:
>
> I am trying to return an index for a data set by searching using
filenames.
>
> The name may be ANG_AUT.N.0734C70411A1_1sA_0734C70411A.fasta, but i'd
just
> like to search it using the term "0734C70411" as the file may be
> 0734C70411A or 0734C70411C or 0734C70411D
>
> Any way to do this other than doing something like this. where
0734C70411A
> is part of matrix list[,8]
>
> samp=paste("ANG_AUT.N.",list[i,8],"1_1sA_",list[i,8],".fasta",sep="")
> data[which(data[,2]==samp),]
>
> This is similar to the =~/ / function in perl.
>
>
> Thanks
> 
> View this message in context:
>
http://r.789695.n4.nabble.com/Howtofinddatathatincludescertainvaluestp3230161p3230161.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Henrique Dallazuanna
CuritibaParanáBrasil
25° 25' 40" S 49° 16' 22" O
[[alternative HTML version deleted]]

Message: 62
Date: Fri, 21 Jan 2011 15:39:50 0500
From: jim holtman
To: Francesco Petrogalli
Cc: rhelp@rproject.org
Subject: Re: [R] ordering a vector
MessageID:
ContentType: text/plain; charset=ISO88591
look at 'order'
yourMatrix[order(yourMatrix[, 'yourCol']), ]
On Fri, Jan 21, 2011 at 2:38 PM, Francesco Petrogalli
wrote:
> Hi,
> is there a R function that order a matrix according to some criteria
> based on the rows(or cols) of that matrix?
>
> For example, let's say that my matrix S is composed by n rows S_1,
> S_2,.., S_n and that I compute some real value g_i=g(S_i) for each
> row.
> Then I want to order this set of g_i (from smaller to bigger) and
> order the correspondent row to the new position.
>
> Is it possible (apart from looping on the index) to do this with some
> predefined R function?
>
> Thanks,
>
> Francesco
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?

Message: 63
Date: Fri, 21 Jan 2011 12:42:06 0800
From: Peter Langfelder
To: Francesco Petrogalli
Cc: rhelp@rproject.org
Subject: Re: [R] ordering a vector
MessageID:
ContentType: text/plain; charset=ISO88591
I think you want the following, assuming you defined your function g():
gValues = apply(S, 1, g);
Sordered = S[order(gValues), ]
Peter
On Fri, Jan 21, 2011 at 11:38 AM, Francesco Petrogalli
wrote:
> Hi,
> is there a R function that order a matrix according to some criteria
> based on the rows(or cols) of that matrix?
>
> For example, let's say that my matrix S is composed by n rows S_1,
> S_2,.., S_n and that I compute some real value g_i=g(S_i) for each
> row.
> Then I want to order this set of g_i (from smaller to bigger) and
> order the correspondent row to the new position.
>
> Is it possible (apart from looping on the index) to do this with some
> predefined R function?
>
> Thanks,
>
> Francesco
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Message: 64
Date: Fri, 21 Jan 2011 16:03:31 0500
From: David Winsemius
To: "Brahmachary, Manisha"
Cc: Rhelp@rproject.org
Subject: Re: [R] Pearson correlation with randomization
MessageID: <5D127B1666684132BB15DC5E96FEC629@comcast.net>
ContentType: text/plain; charset=USASCII; format=flowed; delsp=yes
On Jan 21, 2011, at 3:29 PM, Brahmachary, Manisha wrote:
> Hi David,
>
> Thanks a lot for you inputs. I have modified my code accordingly.
> There
> is one more place that I need some help.
> This is my code:
>
> =
> =
> ======================================================================
> ======
>
> X< read.table("X.txt",as.is=T,header=T,row.names=1)
> Y< read.table("Y.txt",as.is=T,header=T,row.names=1)
>
> X.mat< as.matrix(X)
> Y.mat< as.matrix(Y)
>
> # calculating the true correlation values from my original dataset
> True.Corrs< matrix()
> for (k in 1:nrow(SNP.mat)){
> True.Corrs[k]< cor.test(X.mat[k,],Y.mat[k,],alternative
> =c("greater"),method= c("pearson"))$p.value
> }
>
> # Creating the random distribution of Correlation pvalues
> X.rand < list()
> Y.rand< list()
>
> X.rand<replicate(1000,(X[sample(1:ncol(Y))]),simplify=FALSE) #
> Randomizing the column values for each row
> Y.rand<replicate(1000,Y,simplify=FALSE) # Creating an equivalent list
> of the Y matrix (nonrandomised), to be able to do a pairwise
> cor.test
>
> Corrs.rand< list()
> tmp< list()
> for (i in 1:2){
> for (j in 1:3){
> # How to store a multiple values per element of list?
> tmp[[j]] < cor.test(t(X.rand[[i]][j,]),t(Y.rand[[i]][j,]),alternative
> =c("greater"),method= c("pearson"))$p.value
> Corrs.rand[[i]] < rbind(Corrs.rand[[j]],tmp[[j]])
> }
> }
>
> =
> =
> ======================================================================
>
> At this step:
>
> for (i in 1:length(X.rand)){
> for (j in 1:nrow(X.rand[[1]]){
> # How to store a multiple values per element of list?
> tmp[[j]] < cor.test(t(X.rand[[i]][j,]),t(Y.rand[[i]][j,]),alternative
> =c("greater"),method= c("pearson"))$p.value
> Corrs.rand[[i]] < rbind(Corrs.rand[[j]],tmp[[j]])
> }
> }
>
> I am not sure how I can store multiple values per element.
The usual way would be to preallocate a matrix or a data.frame and
then use "[<" to assign either a whole row at a time or assign
individual elements one by one. rbind in a loop is definitely going to
slow you down.
I haven't followed through the individual steps of all the forloops.
I guess I have lost the ability to think that way after learning to
use the matrix and indexing features of R, alas. If Corrs.rand is a
1000 x 12 data.frame (which is just a special square list) then you
can assign the ith row with:
Corrs.rand[i, ] <
Or you can assign the i,jth element with:
Corrs.rand[i,j ] <
The same syntax works for matrices.

David.
> For eg. I
> want a list of length 1000 (which is the number of random
> permutations I
> have generated for my dataset) and in each element of the list I
> need to
> store 12 p.values where 12 corresponds to the number of rows I have in
> my randomized dataset. Eg.
>
> [[1]]
> 0.23
> 0.05
> 0.78
> 0.78
> 0.87
> 0.11
> 0.003
> 0.9
> 0.76
> 0.11
> 0.23
> 0.56
> [[2]]
> 0.08
> 0.67
> 0.45
> 0.23
> 0.35
> 0.85
> 0.99
> 0.78
> 0.66
> 0.45
> 0.06
> 0.1
> [[3]]
> So on...
>
> I maybe going about this in a complicated way and there may be other
> ways of storing the p.values for each of my randomized dataset. So if
> anybody has ideas please oblige me.
> ======================================================
> X dataset:(sample)
> #Probes X10851 X12144 X12155 X11882 X10860 X12762 X12239
X12154
> 1 1 1 0 0 1 0 2 0
> 2 0 0 0 0 0 0 0 0
> 3 2 2 2 2 1 2 1 2
> 4 0 0 0 0 0 0 0 0
> 5 2 2 2 2 2 2 2 2
> 6 0 1 0 0 1 1 1 1
> 7 2 2 NaN 2 2 2 2 2
> 8 2 2 2 2 2 2 2 2
> 9 0 1 0 1 1 NaN 1 2
> 10 2 2 2 2 2 2 2 2
> 11 2 0 0 0 0 0 0 0
> 12 0 1 0 1 1 0 1 1
>
>
> Y dataset:(sample)
>
> Probes X10851 X12144 X12155 X11882 X10860 X12762 X12239
X12154
> 1 793.0830793 788.1813828 867.8504057 729.8321265
> 816.8519963 805.2113707 774.5990003 854.6384306
> 2 12.8695023 4.312894024 10.69769375 5.872212512
> 13.79299806 9.394132659 6.297552848 9.307943304
> 3 699.7791876 826.997429 795.6409729 770.9376141
> 806.1241089 782.3970486 817.107482 859.7154906
> 4 892.8217221 869.0481458 806.3386667 812.0431017
> 873.5565439 794.4752191 813.9587056 814.8681274
> 5 892.8217221 869.0481458 806.3386667 812.0431017
> 873.5565439 794.4752191 813.9587056 814.8681274
> 6 839.7350251 943.4455677 950.7575323 859.0208018
> 894.246041 853.524053 941.4841508 913.0246205
> 7 653.1272418 751.5217836 750.1757745 737.382114
> 757.8486157 758.2407075 724.2185775 770.8669409
> 8 12.8695023 4.312894024 10.69769375 5.872212512
> 13.79299806 9.394132659 6.297552848 9.307943304
> 9 839.7350251 943.4455677 950.7575323 859.0208018
> 894.246041 853.524053 941.4841508 913.0246205
> 10 653.1272418 751.5217836 750.1757745 737.382114
> 757.8486157 758.2407075 724.2185775 770.8669409
> 11 653.1272418 751.5217836 750.1757745 737.382114
> 757.8486157 758.2407075 724.2185775 770.8669409
> 12 839.7350251 943.4455677 950.7575323 859.0208018
> 894.246041 853.524053 941.4841508 913.0246205
>
> Thanks again
>
> Manisha
>
>
>
>
> Original Message
> From: David Winsemius [mailto:dwinsemius@comcast.net]
> Sent: Tuesday, January 18, 2011 11:56 PM
> To: Brahmachary, Manisha
> Cc: Rhelp@rproject.org
> Subject: Re: [R] Pearson correlation with randomization
>
>
> On Jan 18, 2011, at 11:23 PM, Brahmachary, Manisha wrote:
>
>> Hello,
>>
>>
>>
>> I will be very obliged if someone can help me with this statistical R
>> problem:
>>
>> I am trying to do a Pearson correlation on my datasets X, Y with
>> randomization test. My X and Y datasets are pairs.
>>
>> 1. I want to randomize (rearrange) only my X dataset per
>> row ,while
>> keeping the my Y dataset as it is.
>
> X < X[sample(1:nrow(Y)), ]
>
>>
>> 2. Then Calculate the correlation for this pair, and compare it
>> to
>> your true value of correlation.
>>
>> 3. Repeat 2 and 3 maybe a 100 times
>
> You may want to look at the replicate function.
>
>>
>> 4. If your true pvalue is greater than 95% of the random
>> values,
>> then you can reject the null hypothesis at p<0.05.
>
> You won't have a very stable estimate of the 95th order statistics
> with "maybe" 100 replications.
>
> 
> David.
>>
>>
>>
>> I am stuck at the randomization step. I need some help in
>> implementing
>> it the appropriate randomization step in my correlation.
>>
>> Below is my incomplete code. I will be very obliged if someone could
>> help:
>>
>>
>>
>> X < read.table("X.txt",as.is=T,header=T,row.names=1)
>>
>> Y < read.table("Y.txt",as.is=T,header=T,row.names=1)
>>
>>
>>
>> X.mat< as.matrix(X)
>>
>> Y.mat< as.matrix(Y)
>>
>>
>>
>> Corrs< cor.test(X.mat[1,],Y.mat[1,],alternative
>> =c("greater"),method=
>> c("pearson"))
>>
>>
>>
>> Corrs.rand < list()
>>
>>
>>
>> for (i in 1:length(X.mat)){
>>
>> for (j in 1:100){
>>
>>
>>
>> # This doesnot seem to wrok correctly. How do I run sample function
>> 100
>> times for the same row?
>>
>>
>>
>> SNP.rand< sample(SNP.mat[i,],56, replace = FALSE, prob = NULL)
>>
>> Corrs.rand[[j]]< cor.test(SNP.rand,CNV.mat[j,],alternative
>> =c("greater"),method= c("pearson"))
>>
>>
>>
>> # need to calculate how many times my pvalue from true pvalue>
>> random
>> pvalue
>>
>> }
>>
>> }
>>
>>
>>
>> X dataset:
>>
>>
>>
>> #Probes
>>
>> X10851
>>
>> X12144
>>
>> X12155
>>
>> X11882
>>
>> X10860
>>
>> X12762
>>
>> X12239
>>
>> X12154
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 0
>>
>> 2
>>
>> 0
>>
>> 2
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 3
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 1
>>
>> 2
>>
>> 1
>>
>> 2
>>
>> 4
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 5
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 6
>>
>> 0
>>
>> 1
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 1
>>
>> 7
>>
>> 2
>>
>> 2
>>
>> NaN
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 8
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 9
>>
>> 0
>>
>> 1
>>
>> 0
>>
>> 1
>>
>> 1
>>
>> NaN
>>
>> 1
>>
>> 2
>>
>> 10
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 2
>>
>> 11
>>
>> 2
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 12
>>
>> 0
>>
>> 1
>>
>> 0
>>
>> 1
>>
>> 1
>>
>> 0
>>
>> 1
>>
>> 1
>>
>>
>>
>> Y dataset:
>>
>> Probes
>>
>> X10851
>>
>> X12144
>>
>> X12155
>>
>> X11882
>>
>> X10860
>>
>> X12762
>>
>> X12239
>>
>> X12154
>>
>> 1
>>
>> 793.0831
>>
>> 788.1814
>>
>> 867.8504
>>
>> 729.8321
>>
>> 816.852
>>
>> 805.2114
>>
>> 774.599
>>
>> 854.6384
>>
>> 2
>>
>> 12.8695
>>
>> 4.312894
>>
>> 10.69769
>>
>> 5.872213
>>
>> 13.793
>>
>> 9.394133
>>
>> 6.297553
>>
>> 9.307943
>>
>> 3
>>
>> 699.7792
>>
>> 826.9974
>>
>> 795.641
>>
>> 770.9376
>>
>> 806.1241
>>
>> 782.397
>>
>> 817.1075
>>
>> 859.7155
>>
>> 4
>>
>> 892.8217
>>
>> 869.0481
>>
>> 806.3387
>>
>> 812.0431
>>
>> 873.5565
>>
>> 794.4752
>>
>> 813.9587
>>
>> 814.8681
>>
>> 5
>>
>> 892.8217
>>
>> 869.0481
>>
>> 806.3387
>>
>> 812.0431
>>
>> 873.5565
>>
>> 794.4752
>>
>> 813.9587
>>
>> 814.8681
>>
>> 6
>>
>> 839.735
>>
>> 943.4456
>>
>> 950.7575
>>
>> 859.0208
>>
>> 894.246
>>
>> 853.5241
>>
>> 941.4842
>>
>> 913.0246
>>
>> 7
>>
>> 653.1272
>>
>> 751.5218
>>
>> 750.1758
>>
>> 737.3821
>>
>> 757.8486
>>
>> 758.2407
>>
>> 724.2186
>>
>> 770.8669
>>
>> 8
>>
>> 12.8695
>>
>> 4.312894
>>
>> 10.69769
>>
>> 5.872213
>>
>> 13.793
>>
>> 9.394133
>>
>> 6.297553
>>
>> 9.307943
>>
>> 9
>>
>> 839.735
>>
>> 943.4456
>>
>> 950.7575
>>
>> 859.0208
>>
>> 894.246
>>
>> 853.5241
>>
>> 941.4842
>>
>> 913.0246
>>
>> 10
>>
>> 653.1272
>>
>> 751.5218
>>
>> 750.1758
>>
>> 737.3821
>>
>> 757.8486
>>
>> 758.2407
>>
>> 724.2186
>>
>> 770.8669
>>
>> 11
>>
>> 653.1272
>>
>> 751.5218
>>
>> 750.1758
>>
>> 737.3821
>>
>> 757.8486
>>
>> 758.2407
>>
>> 724.2186
>>
>> 770.8669
>>
>> 12
>>
>> 839.735
>>
>> 943.4456
>>
>> 950.7575
>>
>> 859.0208
>>
>> 894.246
>>
>> 853.5241
>>
>> 941.4842
>>
>> 913.0246
>>
>>
>>
>>
>>
>>
>>
>> Thanks in advance
>>
>>
>>
>> Manisha
>>
>>
>>
>> Mount Sinai School of Medicine
>>
>> Icahn Medical Institute,
>>
>> 1425 Madison Avenue, Box 1498
>>
>> NY10029, NEWYORK, USA
>>
>>
>>
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> Rhelp@rproject.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/rhelp
>> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
>> and provide commented, minimal, selfcontained, reproducible code.
>
> David Winsemius, MD
> West Hartford, CT
>
David Winsemius, MD
West Hartford, CT

Message: 65
Date: Fri, 21 Jan 2011 16:07:04 0500
From: David Winsemius
To: Akash
Cc: rhelp@rproject.org
Subject: Re: [R] Information
MessageID: <227A9130ACD3446FB6F8F748E2FC4684@comcast.net>
ContentType: text/plain; charset=USASCII; format=flowed; delsp=yes
On Jan 21, 2011, at 2:59 PM, Akash wrote:
> Hello
>
> I am student of Bioinformatics and I am doin somework in R in which
> some
> problem occurs. So Please help me to solve these problems.
> I have two problems:
>
> 1. How to generate a graph in which there are 8 rows and 20 columns
> are
> present?
> 2. And how to put some title in the end of the graph i.e for example
> after
> generating the rows if I want to give the name in the end of those
> rows like
> 1,2,3...8.. how can I do this thing?
matplot will let you specify the plotting character with the pch
argument. Coloring is also available and legends are reasonably simple
as well.
?matplot
?legend
If you had presented data with the dput() function I would have
returned working code, But I have gotten tired of making up examples
when people don't post their own sample data.

David.
>
> Right now I am using this code.
>
> graph< function(X)
> {
> for(j in 1:8)
> {
> for(k in 1:20)
> {
> xx<((j1)*10)
> rect(xx,y(j,k1,X),(xx)+10,y(j,k,X), col=colmap[k])
> if ( X[k,j] != 0)
> {
> text( (xx+5),(y(j,k1,X) + round(X[k,j])/2), a[k])
> }
> }
> }
> }
>
> plot(c(0,10*8),c(0,abc), col="white")
>
> where "a" is sumthing which I have to put inside of those rows and
> columns
>
>
> Looking for your positive reply.
>
> Thanking You
>
> With Regards
> Akash
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
David Winsemius, MD
West Hartford, CT

Message: 66
Date: Fri, 21 Jan 2011 16:19:04 0500
From: David Winsemius
To: Francesco Petrogalli
Cc: rhelp@rproject.org
Subject: Re: [R] confidence interval
MessageID: <3AB1FCBA4E19480EBC6C60D3096785B0@comcast.net>
ContentType: text/plain; charset=USASCII; format=flowed; delsp=yes
On Jan 21, 2011, at 11:33 AM, Francesco Petrogalli wrote:
> Hi,
> I have a circular shaped set of point on the plane (X,Y) centered in
> zero. The distribution is more dense close to zero and less dense far
> from zero.
>
> I need to find the radius of a circle centered in zero that contains
> 65% of the points in the sample. Is there any R directive that can do
> this?
>
> I wanna start with 2D set of points, but the real case scenario is
> with a 5D set of points.
Something along the lines of
dxy= with(dfm, sqrt(x^2 +y^2))
quantile(dxy, probs=0.65)
The generalization to 5 dimensions appears trivial. Even the
generalization to finding the radius around an arbitrary point seems
trivial assuming an L2 norm.

David Winsemius, MD
West Hartford, CT

Message: 67
Date: Fri, 21 Jan 2011 14:43:31 0700
From: Greg Snow
To: Michael Costello ,
"rhelp@rproject.org"
Subject: Re: [R] Looping with incremented object name and increment
function
MessageID:
ContentType: text/plain; charset="usascii"
This is FAQ 7.21.
The real gem in the answer there is at the end where it tells you that it is
easier to just use a list. If your fit1, fit2, fit3, and fit4 were elements
in a list then you can just loop through the list elements, or even easier
use the lapply function to loop through the list elements for you.
The syntax fit[ii] means that you want the ii'th element of the vector named
"fit", the FAQ shows how to do what you want, but in the long run (and the
medium run, and even the short run) using a list instead of separate global
variables will make your life easier.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow@imail.org
801.408.8111
> Original Message
> From: rhelpbounces@rproject.org [mailto:rhelpbounces@r
> project.org] On Behalf Of Michael Costello
> Sent: Friday, January 21, 2011 9:43 AM
> To: rhelp@rproject.org
> Subject: [R] Looping with incremented object name and increment
> function
>
> Folks,
>
> I am trying to get a loop to run which increments the object name as
> part of
> the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression
> models
> that I have created.
>
> > for (ii in c(1:4)){
> + SSE[ii]=rbind(anova(fit[ii])$"Sum Sq")
> + dfe[ii]=rbind(summary(fit[ii])$df)
> + }
> Error in anova(fit[ii]) : object 'fit' not found
>
> Why isn't it looking for object 'fit1' instead of 'fit'?
>
> The idea is that it would store in SSE1 the Sum Sq of the model fit1,
> and so
> on for the other 3 models. Is there a way to do this in R? I can do
> it in
> Stata, but am only somewhat knowledgeable in R.
>
> Michael
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide http://www.Rproject.org/posting
> guide.html
> and provide commented, minimal, selfcontained, reproducible code.

Message: 68
Date: Fri, 21 Jan 2011 22:27:57 +0200
From: Den
To: Henrique Dallazuanna
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID: <1295641677.7130.43.camel@den2042desktop>
ContentType: text/plain; charset="UTF8"
Thank you for your efforts.
Although it is still not working, it feels like getting closer and
closer.
id cycle1 cycle2 cycle3
1 1 cmf cmf cmf
2 2 mfc mfc mfc
3 3 acfNA acfNA NAcfm
I really appreciate transformation from subsets ("c","m","f") to "cmf".
That was critical for me.
Hopefully, I'll figure out the rest later with ddply from plyr package.
At least this is my idea for now.
? ???, 21/01/2011 ? 18:00 0200, Henrique Dallazuanna ????:
> correction:
> aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = "",
> na.action = na.pass)
>
> On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna
> wrote:
> Try this:
>
> aggregate(.~ id, lapply(replace(df, is.na(df), ''),
> as.character), FUN = paste, collapse = "", na.action =
> na.pass)
>
>
>
> On Fri, Jan 21, 2011 at 5:45 PM, Den
> wrote:
> Dear Henrique
> Thank you again for helping me
> Unfortunately, your code seems not to be working
>
> > aggregate(.~ id, lapply(df, as.character), FUN =
> paste, collapse = "")
> id cycle1 cycle2 cycle3
> 1 1 cmf cmf cmf
> 2 2 mfc mfc mfc
> 3 3 cf cf cf
>
> (letter 'a' missing in df[3,c("cycle1",cycle2")]
>
> You suggested very interesting approach, however.
> Those '.~ id' and
> 'as.character' gave me hope for success.
> With very best regards
> Denis
>
>
> ? ???, 21/01/2011 ? 14:16 0200, Henrique Dallazuanna
> ????:
>
> > Try this:
> >
> > aggregate(.~ id, lapply(test, as.character), FUN =
> paste, collapse =
> > "")
> >
> > On Fri, Jan 21, 2011 at 10:25 AM, Den
> wrote:
> > Dear [R] people
> > Could you please help with following data
> transformation.
> > Any suggestions, hints, references and even
> guessing on
> > performing any
> > of the following steps are highly
> appreciated. Those
> > transformations are
> > crucial for my work.
> >
> > (n_, _n, j_, k_ signify numbers)
> >
> > SOURCE DATA:
> > id cycle1 cycle2 cycle3 ?
> cycle_n
> > 1 c c c c
> > 1 m m m m
> > 1 f f f f
> > 2 m m m NA
> > 2 f f f NA
> > 2 c c c NA
> > 3 a a NA NA
> > 3 c c c NA
> > 3 f f f NA
> > 3 NA NA m NA
> > ...........................................
> >
> >
> >
> > RESULT DATA1:
> > id cyc1 cyc2 cyc3 ?
> cyc_n
> > 1 cfm cfm cfm cfm
> > 2 cfm cfm cfm NA
> > 3 acf acf cfm NA
> > ...........................................
> >
> >
> > RESULT DATA2:
> > id treatment
> > 1 n_cfm
> > 2 j_cfm
> > 3 2acf>k_cfm
> > ...................
> >
> >
> > RESULT DATA3:
> > id regimen numOfCycles
> > 1 cfm n_
> > 2 cfm j_
> > 3 asf>cfm {2+k_}
> > .............................
> >
> >
> >
> > Thank you
> > Denis
> >
> >
> ______________________________________________
> > Rhelp@rproject.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/rhelp
> > PLEASE do read the posting guide
> > http://www.Rproject.org/postingguide.html
> > and provide commented, minimal,
> selfcontained, reproducible
> > code.
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParan?Brasil
> > 25? 25' 40" S 49? 16' 22" O
>
>
>
>
>
>
> 
> Henrique Dallazuanna
> CuritibaParan?Brasil
> 25? 25' 40" S 49? 16' 22" O
>
>
>
>
> 
> Henrique Dallazuanna
> CuritibaParan?Brasil
> 25? 25' 40" S 49? 16' 22" O

Message: 69
Date: Fri, 21 Jan 2011 12:59:14 0800 (PST)
From: eniven
To: rhelp@rproject.org
Subject: [R] Help with LMSreg
MessageID: <12956435545423230611.post@n4.nabble.com>
ContentType: text/plain
I'm doing regression with least median squares (LMS) using the lmsreg
command. I've got the coefficients (slope and intercept), but how do I get
the LMS correlation coefficient?
[[elided Yahoo spam]]

View this message in context:
http://r.789695.n4.nabble.com/HelpwithLMSregtp3230611p3230611.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML version deleted]]

Message: 70
Date: Fri, 21 Jan 2011 21:51:33 +0100
From: Freddy Gamma
To: rhelp@rproject.org
Subject: [R] TRADUCING lmer() syntax into lme()
MessageID:
ContentType: text/plain
 Forwarded message 
From: Freddy Gamma
Date: 2011/1/21
Subject: TRADUCING lmer() syntax into lme()
To: rsigmixedmodels@rproject.org
Dear Rsociety,
I'd like to kingly ask to anyone is willing to answer me how to implement a
NON NESTED random effects structure in lme()
In particular I've tried the following translation from lmer to lme, as
suggested from some web example
mod1<lmer(y~x*z+(x*zfactorA1/factorB)+(x*zfactorA2/factorB)) # y,x,z
continuous
mod2<lme(y~x*z, random= pdBlocked(list(pdIdent(~1factorA1/factorB
),pdIdent(~1factorA2/factorB))))
In detail check how I've tried to state in mod1 that Iwant to evaluate
randomness in the interaction x*z (i.e intercept, slope, interaction)
grouped by by a general nesting structure that sets factorA1 and factorA2 as
same level effects (hence non nested) and factorB as nested in both.
I also must express my momentaneous sheer ignorange on the pdMat objects,
thing that prabably is not helping me in the process
Kindly Regards
Federico Bonofiglio
[[alternative HTML version deleted]]

Message: 71
Date: Fri, 21 Jan 2011 15:33:56 0500
From: las65@buffalo.edu
To:
Subject: [R] building package
MessageID: <19068.1295642036@buffalo.edu>
ContentType: text/plain; charset="utf8"
I have built a package that I would like to submit to the CRAN. When I
perform a R CMD
check I get the following warning:
* checking Rd crossreferences ... WARNING
Error in .find.package(package, lib.loc) :
there is no package called 'foreign'
Calls: > lapply > FUN > .find.package
Execution halted
I believe this has to do with the fact I use mapply function utilizing
internal
functions I have within the package? Am I wrong in this assumption? How
would I remedy
this in order to get rid of the warning?
Any advice is appreciated.
Thank you
Lori

Message: 72
Date: Fri, 21 Jan 2011 15:29:54 0500
From: "Brahmachary, Manisha"
To: "David Winsemius"
Cc: Rhelp@rproject.org
Subject: Re: [R] Pearson correlation with randomization
MessageID:
<018787A29AB84E449A098AB1DFC73E7E01EE59C0@EXCHEVS2.ExchMail.mssm.edu
>
ContentType: text/plain; charset="usascii"
Hi David,
Thanks a lot for you inputs. I have modified my code accordingly. There
is one more place that I need some help.
This is my code:
========================================================================
======
X< read.table("X.txt",as.is=T,header=T,row.names=1)
Y< read.table("Y.txt",as.is=T,header=T,row.names=1)
X.mat< as.matrix(X)
Y.mat< as.matrix(Y)
# calculating the true correlation values from my original dataset
True.Corrs< matrix()
for (k in 1:nrow(SNP.mat)){
True.Corrs[k]< cor.test(X.mat[k,],Y.mat[k,],alternative
=c("greater"),method= c("pearson"))$p.value
}
# Creating the random distribution of Correlation pvalues
X.rand < list()
Y.rand< list()
X.rand<replicate(1000,(X[sample(1:ncol(Y))]),simplify=FALSE) #
Randomizing the column values for each row
Y.rand<replicate(1000,Y,simplify=FALSE) # Creating an equivalent list
of the Y matrix (nonrandomised), to be able to do a pairwise cor.test
Corrs.rand< list()
tmp< list()
for (i in 1:2){
for (j in 1:3){
# How to store a multiple values per element of list?
tmp[[j]] < cor.test(t(X.rand[[i]][j,]),t(Y.rand[[i]][j,]),alternative
=c("greater"),method= c("pearson"))$p.value
Corrs.rand[[i]] < rbind(Corrs.rand[[j]],tmp[[j]])
}
}
========================================================================
At this step:
for (i in 1:length(X.rand)){
for (j in 1:nrow(X.rand[[1]]){
# How to store a multiple values per element of list?
tmp[[j]] < cor.test(t(X.rand[[i]][j,]),t(Y.rand[[i]][j,]),alternative
=c("greater"),method= c("pearson"))$p.value
Corrs.rand[[i]] < rbind(Corrs.rand[[j]],tmp[[j]])
}
}
I am not sure how I can store multiple values per element. For eg. I
want a list of length 1000 (which is the number of random permutations I
have generated for my dataset) and in each element of the list I need to
store 12 p.values where 12 corresponds to the number of rows I have in
my randomized dataset. Eg.
[[1]]
0.23
0.05
0.78
0.78
0.87
0.11
0.003
0.9
0.76
0.11
0.23
0.56
[[2]]
0.08
0.67
0.45
0.23
0.35
0.85
0.99
0.78
0.66
0.45
0.06
0.1
[[3]]
So on...
I maybe going about this in a complicated way and there may be other
ways of storing the p.values for each of my randomized dataset. So if
anybody has ideas please oblige me.
======================================================
X dataset:(sample)
#Probes X10851 X12144 X12155 X11882 X10860 X12762 X12239 X12154
1 1 1 0 0 1 0 2 0
2 0 0 0 0 0 0 0 0
3 2 2 2 2 1 2 1 2
4 0 0 0 0 0 0 0 0
5 2 2 2 2 2 2 2 2
6 0 1 0 0 1 1 1 1
7 2 2 NaN 2 2 2 2 2
8 2 2 2 2 2 2 2 2
9 0 1 0 1 1 NaN 1 2
10 2 2 2 2 2 2 2 2
11 2 0 0 0 0 0 0 0
12 0 1 0 1 1 0 1 1
Y dataset:(sample)
Probes X10851 X12144 X12155 X11882 X10860 X12762 X12239 X12154
1 793.0830793 788.1813828 867.8504057 729.8321265
816.8519963 805.2113707 774.5990003 854.6384306
2 12.8695023 4.312894024 10.69769375 5.872212512
13.79299806 9.394132659 6.297552848 9.307943304
3 699.7791876 826.997429 795.6409729 770.9376141
806.1241089 782.3970486 817.107482 859.7154906
4 892.8217221 869.0481458 806.3386667 812.0431017
873.5565439 794.4752191 813.9587056 814.8681274
5 892.8217221 869.0481458 806.3386667 812.0431017
873.5565439 794.4752191 813.9587056 814.8681274
6 839.7350251 943.4455677 950.7575323 859.0208018
894.246041 853.524053 941.4841508 913.0246205
7 653.1272418 751.5217836 750.1757745 737.382114
757.8486157 758.2407075 724.2185775 770.8669409
8 12.8695023 4.312894024 10.69769375 5.872212512
13.79299806 9.394132659 6.297552848 9.307943304
9 839.7350251 943.4455677 950.7575323 859.0208018
894.246041 853.524053 941.4841508 913.0246205
10 653.1272418 751.5217836 750.1757745 737.382114
757.8486157 758.2407075 724.2185775 770.8669409
11 653.1272418 751.5217836 750.1757745 737.382114
757.8486157 758.2407075 724.2185775 770.8669409
12 839.7350251 943.4455677 950.7575323 859.0208018
894.246041 853.524053 941.4841508 913.0246205
Thanks again
Manisha
Original Message
From: David Winsemius [mailto:dwinsemius@comcast.net]
Sent: Tuesday, January 18, 2011 11:56 PM
To: Brahmachary, Manisha
Cc: Rhelp@rproject.org
Subject: Re: [R] Pearson correlation with randomization
On Jan 18, 2011, at 11:23 PM, Brahmachary, Manisha wrote:
> Hello,
>
>
>
> I will be very obliged if someone can help me with this statistical R
> problem:
>
> I am trying to do a Pearson correlation on my datasets X, Y with
> randomization test. My X and Y datasets are pairs.
>
> 1. I want to randomize (rearrange) only my X dataset per
> row ,while
> keeping the my Y dataset as it is.
X < X[sample(1:nrow(Y)), ]
>
> 2. Then Calculate the correlation for this pair, and compare it
> to
> your true value of correlation.
>
> 3. Repeat 2 and 3 maybe a 100 times
You may want to look at the replicate function.
>
> 4. If your true pvalue is greater than 95% of the random values,
> then you can reject the null hypothesis at p<0.05.
You won't have a very stable estimate of the 95th order statistics
with "maybe" 100 replications.

David.
>
>
>
> I am stuck at the randomization step. I need some help in implementing
> it the appropriate randomization step in my correlation.
>
> Below is my incomplete code. I will be very obliged if someone could
> help:
>
>
>
> X < read.table("X.txt",as.is=T,header=T,row.names=1)
>
> Y < read.table("Y.txt",as.is=T,header=T,row.names=1)
>
>
>
> X.mat< as.matrix(X)
>
> Y.mat< as.matrix(Y)
>
>
>
> Corrs< cor.test(X.mat[1,],Y.mat[1,],alternative =c("greater"),method=
> c("pearson"))
>
>
>
> Corrs.rand < list()
>
>
>
> for (i in 1:length(X.mat)){
>
> for (j in 1:100){
>
>
>
> # This doesnot seem to wrok correctly. How do I run sample function
> 100
> times for the same row?
>
>
>
> SNP.rand< sample(SNP.mat[i,],56, replace = FALSE, prob = NULL)
>
> Corrs.rand[[j]]< cor.test(SNP.rand,CNV.mat[j,],alternative
> =c("greater"),method= c("pearson"))
>
>
>
> # need to calculate how many times my pvalue from true pvalue> random
> pvalue
>
> }
>
> }
>
>
>
> X dataset:
>
>
>
> #Probes
>
> X10851
>
> X12144
>
> X12155
>
> X11882
>
> X10860
>
> X12762
>
> X12239
>
> X12154
>
> 1
>
> 1
>
> 1
>
> 0
>
> 0
>
> 1
>
> 0
>
> 2
>
> 0
>
> 2
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 3
>
> 2
>
> 2
>
> 2
>
> 2
>
> 1
>
> 2
>
> 1
>
> 2
>
> 4
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 5
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 6
>
> 0
>
> 1
>
> 0
>
> 0
>
> 1
>
> 1
>
> 1
>
> 1
>
> 7
>
> 2
>
> 2
>
> NaN
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 8
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 9
>
> 0
>
> 1
>
> 0
>
> 1
>
> 1
>
> NaN
>
> 1
>
> 2
>
> 10
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 2
>
> 11
>
> 2
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 0
>
> 12
>
> 0
>
> 1
>
> 0
>
> 1
>
> 1
>
> 0
>
> 1
>
> 1
>
>
>
> Y dataset:
>
> Probes
>
> X10851
>
> X12144
>
> X12155
>
> X11882
>
> X10860
>
> X12762
>
> X12239
>
> X12154
>
> 1
>
> 793.0831
>
> 788.1814
>
> 867.8504
>
> 729.8321
>
> 816.852
>
> 805.2114
>
> 774.599
>
> 854.6384
>
> 2
>
> 12.8695
>
> 4.312894
>
> 10.69769
>
> 5.872213
>
> 13.793
>
> 9.394133
>
> 6.297553
>
> 9.307943
>
> 3
>
> 699.7792
>
> 826.9974
>
> 795.641
>
> 770.9376
>
> 806.1241
>
> 782.397
>
> 817.1075
>
> 859.7155
>
> 4
>
> 892.8217
>
> 869.0481
>
> 806.3387
>
> 812.0431
>
> 873.5565
>
> 794.4752
>
> 813.9587
>
> 814.8681
>
> 5
>
> 892.8217
>
> 869.0481
>
> 806.3387
>
> 812.0431
>
> 873.5565
>
> 794.4752
>
> 813.9587
>
> 814.8681
>
> 6
>
> 839.735
>
> 943.4456
>
> 950.7575
>
> 859.0208
>
> 894.246
>
> 853.5241
>
> 941.4842
>
> 913.0246
>
> 7
>
> 653.1272
>
> 751.5218
>
> 750.1758
>
> 737.3821
>
> 757.8486
>
> 758.2407
>
> 724.2186
>
> 770.8669
>
> 8
>
> 12.8695
>
> 4.312894
>
> 10.69769
>
> 5.872213
>
> 13.793
>
> 9.394133
>
> 6.297553
>
> 9.307943
>
> 9
>
> 839.735
>
> 943.4456
>
> 950.7575
>
> 859.0208
>
> 894.246
>
> 853.5241
>
> 941.4842
>
> 913.0246
>
> 10
>
> 653.1272
>
> 751.5218
>
> 750.1758
>
> 737.3821
>
> 757.8486
>
> 758.2407
>
> 724.2186
>
> 770.8669
>
> 11
>
> 653.1272
>
> 751.5218
>
> 750.1758
>
> 737.3821
>
> 757.8486
>
> 758.2407
>
> 724.2186
>
> 770.8669
>
> 12
>
> 839.735
>
> 943.4456
>
> 950.7575
>
> 859.0208
>
> 894.246
>
> 853.5241
>
> 941.4842
>
> 913.0246
>
>
>
>
>
>
>
> Thanks in advance
>
>
>
> Manisha
>
>
>
> Mount Sinai School of Medicine
>
> Icahn Medical Institute,
>
> 1425 Madison Avenue, Box 1498
>
> NY10029, NEWYORK, USA
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
David Winsemius, MD
West Hartford, CT

Message: 73
Date: Fri, 21 Jan 2011 15:16:14 0800
From: Horace Tso
To: rhelp
Subject: [R] glitch in building R package
MessageID:
<5C3F9922B1D5FB4886B2D2045AB952F3056E4D0C3F@IPEXMAIL.corp.dom>
ContentType: text/plain
I follow Alan Lenarcic's very helpful tutorial on building R package for
Windows (XP), which could be found in
www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf
<
http://www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf>.
The package involves a small dll compiled from some very simple C++ codes.
The build process seemed to work smoothly, until i install. Then I got an
error saying the C function was not in the load table. This is rather
mysterious because I've been able to call this function from R with
dyn.load("name.dll"). So the dll is working.
The install error says :
C:\Rtest>R CMD INSTALL build FirstPack_0.1.tar.gz
* installing to library 'c:/R/R2.12.0/library'
* installing *source* package 'FirstPack' ...
** libs
cygwin warning:
MSDOS style path detected: c:/R/R2.12.0/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/R/R2.12.0/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwinugnet/using.html#usingpathnames
g++ I"c:/R/R2.12.0/include" O2 Wall c XDemo.cpp o XDemo.o
g++ I"c:/R/R2.12.0/include" O2 Wall c XDemo_main.cpp o
XDemo_main
.o
g++ shared s staticlibgcc o FirstPack.dll tmp.def XDemo.o XDemo_main.o
Lc:
/R/R2.12.0/bin/i386 lR
installing to c:/R/R2.12.0/library/FirstPack/libs/i386
** R
** data
Warning: empty 'data' directory
** preparing package for lazy loading
Error in .C("DemoAutoCor", OutVec = as.double(vector("numeric", OutLength)),
:
C symbol name "DemoAutoCor" not in load table
ERROR: lazy loading failed for package 'FirstPack'
* removing 'c:/R/R2.12.0/library/FirstPack'
Here is how i built the package. I have the directory structure as described
in "Writing R Extensions" and I issued the following command in DOS prompt,
C:\Rtest>R CMD build FirstPack
* checking for file 'FirstPack/DESCRIPTION' ... OK
* preparing 'FirstPack':
* checking DESCRIPTION metainformation ... OK
* cleaning src
cygwin warning:
MSDOS style path detected: C:/Rtest/FirstPack_0.1.tar
Preferred POSIX equivalent is: /cygdrive/c/Rtest/FirstPack_0.1.tar
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwinugnet/using.html#usingpathnames
cygwin warning:
MSDOS style path detected: C:/Rtest/FirstPack_0.1.tar
Preferred POSIX equivalent is: /cygdrive/c/Rtest/FirstPack_0.1.tar
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwinugnet/using.html#usingpathnames
Warning in readLines(ldpath) :
incomplete final line found on 'FirstPack/DESCRIPTION'
* checking for LF lineendings in source and make files
* checking for empty or unneeded directories
WARNING: directory 'FirstPack/data' is empty
* building 'FirstPack_0.1.tar.gz'
cygwin warning:
MSDOS style path detected: C:/Rtest/FirstPack_0.1.tar
Preferred POSIX equivalent is: /cygdrive/c/Rtest/FirstPack_0.1.tar
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwinugnet/using.html#usingpathnames
cygwin warning:
MSDOS style path detected: C:/Rtest/FirstPack_0.1.tar
Preferred POSIX equivalent is: /cygdrive/c/Rtest/FirstPack_0.1.tar
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwinugnet/using.html#usingpathnames
Thanks in advance.
H
[[alternative HTML version deleted]]

Message: 74
Date: Fri, 21 Jan 2011 20:29:32 0500
From: Duncan Murdoch
To: las65@buffalo.edu
Cc: rhelp@rproject.org
Subject: Re: [R] building package
MessageID: <4D3A32FC.3010509@gmail.com>
ContentType: text/plain; charset=ISO88591; format=flowed
On 110121 3:33 PM, las65@buffalo.edu wrote:
> I have built a package that I would like to submit to the CRAN. When I
perform a R CMD
> check I get the following warning:
> * checking Rd crossreferences ... WARNING
> Error in .find.package(package, lib.loc) :
> there is no package called 'foreign'
> Calls: > lapply > FUN > .find.package
> Execution halted
>
> I believe this has to do with the fact I use mapply function utilizing
internal
> functions I have within the package? Am I wrong in this assumption? How
would I remedy
> this in order to get rid of the warning?
This message is about your documentation files, not your R code. Search
your .Rd files for "foreign" and either remove the reference, or add a
Depends statement to your DESCRIPTION saying you depend on the foreign
package.
Duncan Murdoch
>
> Any advice is appreciated.
> Thank you
> Lori
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.

Message: 75
Date: Sat, 22 Jan 2011 01:10:45 +0200
From: Den
To: Henrique Dallazuanna
Cc: Rhelp
Subject: Re: [R] complex transformation of data
MessageID: <1295651445.1724.0.camel@den2042desktop>
ContentType: text/plain; charset="UTF8"
[[elided Yahoo spam]]
It is a pure magic which makes my head spin.
aggregate(.~ id, lapply(df, as.character), FUN =
function(x)paste(sort(x), collapse = ''), na.action = na.pass)
1. help says:
Note that ?paste()? coerces ?NA_character_?, the character missing
value, to ?"NA"'
And at the same time:
?na.pass? returns the object unchanged.
I am happy, that I don't have NAs in mydata. I just don't understand
how
it happened.
2. Can't see the real difference between 'FUN = function(x) paste(x)'
and 'FUN = paste'. However, former working perfectly while latter simply
not.
3.Finally, all help says about LHS in formulas like '.~id' is that it's
name is "dot notation". And not a single word more. Thus, I have no
clue, what dot in that formula really means.
Conclusion:
1. It's a magic.
2. You definitely saved my investigation. (When I've started I had no
idea it would be so difficult to arrange those chemotherapy cycles in
dataframe, although I dare to call myself pharmacoepidemiologist (which
sounds rather funny after that story))
3. THANK YOU!!!!!!
Sincerely yours
Denis Kazakiewicz
Belarus
? ???, 21/01/2011 ? 18:37 0200, Henrique Dallazuanna ????:
> Just change the FUN function:
>
> aggregate(.~ id, lapply(df, as.character), FUN =
> function(x)paste(sort(x), collapse = ''), na.action = na.pass)
>
> On Fri, Jan 21, 2011 at 6:27 PM, Den wrote:
>
> Thank you for your efforts.
> Although it is still not working, it feels like getting closer
> and
> closer.
>
> id cycle1 cycle2 cycle3
> 1 1 cmf cmf cmf
> 2 2 mfc mfc mfc
>
> 3 3 acfNA acfNA NAcfm
>
> I really appreciate transformation from subsets ("c","m","f")
> to "cmf".
> That was critical for me.
> Hopefully, I'll figure out the rest later with ddply from
> plyr package.
> At least this is my idea for now.
>
>
>
> ? ???, 21/01/2011 ? 18:00 0200, Henrique Dallazuanna ????:
>
> > correction:
> > aggregate(.~ id, lapply(df, as.character), FUN = paste,
> collapse = "",
> > na.action = na.pass)
> >
> > On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna
> > wrote:
> > Try this:
> >
> > aggregate(.~ id, lapply(replace(df, is.na(df), ''),
> > as.character), FUN = paste, collapse = "", na.action
> =
> > na.pass)
> >
> >
> >
> > On Fri, Jan 21, 2011 at 5:45 PM, Den
>
> > wrote:
> > Dear Henrique
> > Thank you again for helping me
> > Unfortunately, your code seems not to be
> working
> >
> > > aggregate(.~ id, lapply(df, as.character),
> FUN =
> > paste, collapse = "")
> > id cycle1 cycle2 cycle3
> > 1 1 cmf cmf cmf
> > 2 2 mfc mfc mfc
> > 3 3 cf cf cf
> >
> > (letter 'a' missing in
> df[3,c("cycle1",cycle2")]
> >
> > You suggested very interesting approach,
> however.
> > Those '.~ id' and
> > 'as.character' gave me hope for success.
> > With very best regards
> > Denis
> >
> >
> > ? ???, 21/01/2011 ? 14:16 0200, Henrique
> Dallazuanna
> > ????:
> >
> > > Try this:
> > >
> > > aggregate(.~ id, lapply(test,
> as.character), FUN =
> > paste, collapse =
> > > "")
> > >
> > > On Fri, Jan 21, 2011 at 10:25 AM, Den
> > wrote:
> > > Dear [R] people
> > > Could you please help with
> following data
> > transformation.
> > > Any suggestions, hints, references
> and even
> > guessing on
> > > performing any
> > > of the following steps are highly
> > appreciated. Those
> > > transformations are
> > > crucial for my work.
> > >
> > > (n_, _n, j_, k_ signify numbers)
> > >
> > > SOURCE DATA:
> > > id cycle1 cycle2 cycle3 ?
> > cycle_n
> > > 1 c c c
> c
> > > 1 m m m
> m
> > > 1 f f f
> f
> > > 2 m m m
> NA
> > > 2 f f f
> NA
> > > 2 c c c
> NA
> > > 3 a a NA
> NA
> > > 3 c c c
> NA
> > > 3 f f f
> NA
> > > 3 NA NA m
> NA
> > >
> ...........................................
> > >
> > >
> > >
> > > RESULT DATA1:
> > > id cyc1 cyc2 cyc3 ?
> > cyc_n
> > > 1 cfm cfm cfm
> cfm
> > > 2 cfm cfm cfm
> NA
> > > 3 acf acf cfm
> NA
> > >
> ...........................................
> > >
> > >
> > > RESULT DATA2:
> > > id treatment
> > > 1 n_cfm
> > > 2 j_cfm
> > > 3 2acf>k_cfm
> > > ...................
> > >
> > >
> > > RESULT DATA3:
> > > id regimen numOfCycles
> > > 1 cfm n_
> > > 2 cfm j_
> > > 3 asf>cfm {2+k_}
> > > .............................
> > >
> > >
> > >
> > > Thank you
> > > Denis
> > >
> > >
> >
> ______________________________________________
> > > Rhelp@rproject.org mailing list
> > >
> https://stat.ethz.ch/mailman/listinfo/rhelp
> > > PLEASE do read the posting guide
> > >
> http://www.Rproject.org/postingguide.html
> > > and provide commented, minimal,
> > selfcontained, reproducible
> > > code.
> > >
> > >
> > >
> > > 
> > > Henrique Dallazuanna
> > > CuritibaParan?Brasil
> > > 25? 25' 40" S 49? 16' 22" O
> >
> >
> >
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParan?Brasil
> > 25? 25' 40" S 49? 16' 22" O
> >
> >
> >
> >
> > 
> > Henrique Dallazuanna
> > CuritibaParan?Brasil
> > 25? 25' 40" S 49? 16' 22" O
>
>
>
>
>
>
> 
> Henrique Dallazuanna
> CuritibaParan?Brasil
> 25? 25' 40" S 49? 16' 22" O

Message: 76
Date: Sat, 22 Jan 2011 03:04:30 +0200
From: Den
To: poppinkid
Cc: Rhelp
Subject: Re: [R] How to find data that includes certain values
MessageID: <1295658270.1947.19.camel@den2042desktop>
ContentType: text/plain; charset="UTF8"
Hello
Consider following dataframe named df
var1 var2 var3
3771 354 565
654654 963 6677
775 147 657754
df < read.table('clipboard', header = TRUE)
df
#find indexes with '77' in var 1
myIndexes < grep( glob2rx("*77*"), df$var1)
myIndexes
#find actual values of seach above
myValu < grep( glob2rx("*77*"), df$var1, value=TRUE)
myValu
#find all '77' in entire dataframe
all77 < lapply(df, function(x)grep( glob2rx("*77*"), x, value=TRUE))
all77
#OR indexes
all77ind <lapply(df, function(x)grep( glob2rx("*77*"), x))
all77ind
Hope that helps
With best regards
Denis

Message: 77
Date: Sat, 22 Jan 2011 03:03:08 +0100
From: jochen laubrock
To: rhelp@rproject.org
Subject: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y))
MessageID: <58726081253A432699890D00037C3CCC@gmail.com>
ContentType: text/plain; charset=usascii
Dear list,
the following came up in an introductory class. Please help me understand
the 1 (or 0+) syntax in formulae: Why do the enumerator dfs, Fstatisics
etc. differ between the models lm(y ~ x1) and lm(y ~ x0 + x1  1), if x0 is
a vector containing simply ones?
Example:
N < 40
x0 < rep(1,N)
x1 < 1:N
vare < N/8
set.seed(4)
e < rnorm(N, 0, vare^2)
X < cbind(x0, x1)
beta < c(.4, 1)
y < X %*% beta + e
summary(lm(y ~ x1))
# [...]
# Residual standard error: 20.92 on 38 degrees of freedom
# Multiple Rsquared: 0.1151, Adjusted Rsquared: 0.09182
# Fstatistic: 4.943 on 1 and 38 DF, pvalue: 0.03222
summary(lm(y ~ x0 + x1  1)) # or summary(lm(y ~ 0 + x0 + x1))
# [...]
# Residual standard error: 20.92 on 38 degrees of freedom
# Multiple Rsquared: 0.6888, Adjusted Rsquared: 0.6724
# Fstatistic: 42.05 on 2 and 38 DF, pvalue: 2.338e10
Thanks in advance,
Jochen

Jochen Laubrock, Dept. of Psychology, University of Potsdam,
KarlLiebknechtStrasse 2425, 14476 Potsdam, Germany
phone: +493319772346, fax: +493319772793

Message: 78
Date: Fri, 21 Jan 2011 18:31:13 0800
From: Dennis Murphy
To: Michael Costello
Cc: rhelp@rproject.org
Subject: Re: [R] Looping with incremented object name and increment
function
MessageID:
ContentType: text/plain
Hi:
Here's an example of how to extract pieces from model objects using the plyr
package. I'm using the attitude data set from the datasets package
(autoloaded).
# Generate four models
m1 < lm(rating ~ ., data = attitude)
m2 < lm(rating ~ complaints + learning, data = attitude)
m3 < lm(rating ~ complaints * learning, data = attitude)
m4 < lm(rating ~ complaints, data = attitude)
# Combine them into a list
mlist < list(m1 = m1, m2 = m2, m3 = m3, m4 = m4)
# Utility functions:
# In this context, x represents a generic model object. We want
# to extract the same information from each object.
# Can package these (or others) into a single function if you
# wish to output a list object.
# Sums of squares extraction:
ss < function(x) summary(x)$coefficients[, 2]
# R^2
r2 < function(x) summary(x)$r.squared
# Model and residual df:
dfs < function(x) summary(x)$df[1:2]
# ldply() takes a list object as input and returns a data frame object
# llply() takes a list object as input and returns a list
# Each call applies a utility function to each component model in the list
library(plyr)
ldply(mlist, r2)
ldply(mlist, dfs)
llply(mlist, ss)
HTH,
Dennis
On Fri, Jan 21, 2011 at 8:42 AM, Michael Costello <
michaelavcostello@gmail.com> wrote:
> Folks,
>
> I am trying to get a loop to run which increments the object name as part
> of
> the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression
> models
> that I have created.
>
> > for (ii in c(1:4)){
> + SSE[ii]=rbind(anova(fit[ii])$"Sum Sq")
> + dfe[ii]=rbind(summary(fit[ii])$df)
> + }
> Error in anova(fit[ii]) : object 'fit' not found
>
> Why isn't it looking for object 'fit1' instead of 'fit'?
>
> The idea is that it would store in SSE1 the Sum Sq of the model fit1, and
> so
> on for the other 3 models. Is there a way to do this in R? I can do it
in
> Stata, but am only somewhat knowledgeable in R.
>
> Michael
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
> http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>
[[alternative HTML version deleted]]

Message: 79
Date: Fri, 21 Jan 2011 22:48:06 0500
From: David Winsemius
To: jochen laubrock
Cc: rhelp@rproject.org
Subject: Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y))
MessageID:
ContentType: text/plain; charset=USASCII; format=flowed; delsp=yes
On Jan 21, 2011, at 9:03 PM, jochen laubrock wrote:
> Dear list,
>
> the following came up in an introductory class. Please help me
> understand the 1 (or 0+) syntax in formulae: Why do the enumerator
> dfs, Fstatisics etc. differ between the models lm(y ~ x1) and lm(y
> ~ x0 + x1  1), if x0 is a vector containing simply ones?
You are testing something different. In the first case you are testing
the difference between the baseline and the second level of x1 (so
there is only one d.f.), while in the second case you are testing for
both of the coefficients being zero (so the numerator has 2 d.f.). It
would be easier to see if you did print() on the fit object. The first
model would give you an estimate for an "Intercept", which is really
an estimate for the first level of x1. Having been taught to think of
anova as just a special case of regression is helpful here. Look at
the model first and only then look at the anova table.
>
> Example:
>
> N < 40
> x0 < rep(1,N)
> x1 < 1:N
> vare < N/8
> set.seed(4)
> e < rnorm(N, 0, vare^2)
>
> X < cbind(x0, x1)
> beta < c(.4, 1)
> y < X %*% beta + e
>
> summary(lm(y ~ x1))
> # [...]
> # Residual standard error: 20.92 on 38 degrees of freedom
> # Multiple Rsquared: 0.1151, Adjusted Rsquared: 0.09182
> # Fstatistic: 4.943 on 1 and 38 DF, pvalue: 0.03222
>
> summary(lm(y ~ x0 + x1  1)) # or summary(lm(y ~ 0 + x0 + x1))
> # [...]
> # Residual standard error: 20.92 on 38 degrees of freedom
> # Multiple Rsquared: 0.6888, Adjusted Rsquared: 0.6724
> # Fstatistic: 42.05 on 2 and 38 DF, pvalue: 2.338e10
>
>
> Thanks in advance,
> Jochen
>
>
> 
> Jochen Laubrock, Dept. of Psychology, University of Potsdam,
> KarlLiebknechtStrasse 2425, 14476 Potsdam, Germany
> phone: +493319772346, fax: +493319772793
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
David Winsemius, MD
West Hartford, CT

Message: 80
Date: Fri, 21 Jan 2011 22:10:05 0500
From: Mingo
To: Rhelp@rproject.org
Subject: [R] R  Vectorization and Functional Programming Constructs
MessageID:
>
ContentType: text/plain
Hello, I am new to R (coming from Perl) and have what is, at least at this
point, a philosophical question and a request for comment on some basic
code. As I understand it  R emphasizes ,or at least supports, the
functional programming model. I've come across some code that was markedly
absent in for loops  and have been seeing some constructs that relate to
functional programming and vectorized code (not that is at all unique to R
of course). But I'm also new to the concept of vectorizing code.
However, since I anticipate dealing with vectors of large sizes I think that
this approach is probably going to serve well in terms of performance. As an
example I anticipate having vector operations calling for shifting. I'll be
shifting vectors to the right (or left) like below while maintaining the
length and filling with zeros. Keep in mind I'll ultimately be dealing with
vectors with very large length.
>x < c(0,3,2,1,0,0,0)
>vlen < length(x)
[1] 7
One solution to accomplish the right shift is to do something like:
>x=c(0,x[1:vlen1])
>x
1] 0 0 3 2 1 0 0
this does the trick though I'm wondering if this is in the spirit of
"Vectorization". I could make recursive function that would cycle through
the whole vector eventually leaving it full of 0s thus ending the recursion.
Though does this capture the spirit of R programming and vectorizing ? Are
there more primitive operators "closer" to the underlying C code that would
serve performance interests better ?
[[alternative HTML version deleted]]

Message: 81
Date: Fri, 21 Jan 2011 20:18:30 0800
From: Bert Gunter
To: David Winsemius
Cc: rhelp@rproject.org
Subject: Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y))
MessageID:
ContentType: text/plain; charset=ISO88591
Well ... as x1 is continuous(numeric), it has no levels. So ...??
Note that the fits are identical for both models. The issue is only
what is the Null that you are testing in the two cases. In the first
case, it is just y = constant, so you are testing the 1 df for x1. In
the second, it is y = 0 (which rarely makes any sense) and you are
testing the 2 df for the two terms (x0 and x1). Etc. etc.
 Bert
On Fri, Jan 21, 2011 at 7:48 PM, David Winsemius
wrote:
>
> On Jan 21, 2011, at 9:03 PM, jochen laubrock wrote:
>
>> Dear list,
>>
>> the following came up in an introductory class. Please help me understand
>> the 1 (or 0+) syntax in formulae: Why do the enumerator dfs, Fstatisics
>> etc. differ between the models lm(y ~ x1) and lm(y ~ x0 + x1  1), if x0
is
>> a vector containing simply ones?
>
> You are testing something different. In the first case you are testing the
> difference between the baseline and the second level of x1 (so there is
only
> one d.f.), while in the second case you are testing for both of the
> coefficients being zero (so the numerator has 2 d.f.). It would be easier
to
> see if you did print() on the fit object. The first model would give you
an
> estimate for an "Intercept", which is really an estimate for the first
level
> of x1. ?Having been taught to think of anova as just a special case of
> regression is helpful here. Look at the model first ?and only then look at
> the anova table.
>
>
>>
>> Example:
>>
>> N ?< 40
>> x0 < rep(1,N)
>> x1 < 1:N
>> vare < N/8
>> set.seed(4)
>> e < rnorm(N, 0, vare^2)
>>
>> X < cbind(x0, x1)
>> beta < c(.4, 1)
>> y < X %*% beta + e
>>
>> summary(lm(y ~ x1))
>> # [...]
>> # Residual standard error: 20.92 on 38 degrees of freedom
>> # Multiple Rsquared: 0.1151, ? Adjusted Rsquared: 0.09182
>> # Fstatistic: 4.943 on 1 and 38 DF, ?pvalue: 0.03222
>>
>> summary(lm(y ~ x0 + x1  1)) ? ? ? ?# or summary(lm(y ~ 0 + x0 + x1))
>> # [...]
>> # Residual standard error: 20.92 on 38 degrees of freedom
>> # Multiple Rsquared: 0.6888, ? Adjusted Rsquared: 0.6724
>> # Fstatistic: 42.05 on 2 and 38 DF, ?pvalue: 2.338e10
>>
>>
>> Thanks in advance,
>> Jochen
>>
>>
>> 
>> Jochen Laubrock, Dept. of Psychology, University of Potsdam,
>> KarlLiebknechtStrasse 2425, 14476 Potsdam, Germany
>> phone: +493319772346, fax: +493319772793
>>
>> ______________________________________________
>> Rhelp@rproject.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/rhelp
>> PLEASE do read the posting guide
>> http://www.Rproject.org/postingguide.html
>> and provide commented, minimal, selfcontained, reproducible code.
>
> David Winsemius, MD
> West Hartford, CT
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>

Bert Gunter
Genentech Nonclinical Biostatistics
4677374
http://devo.gene.com/groups/devo/depts/ncb/home.shtml

Message: 82
Date: Sat, 22 Jan 2011 05:33:06 +0100
From: jochen laubrock
To: Bert Gunter
Cc: rhelp@rproject.org
Subject: Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1  1) with x0 < rep(1,
length(y))
MessageID:
ContentType: text/plain; charset=usascii
Thank you all (including Dennis), this was elucidating.
I would have (maybe naively) anticipated that in this somewhat pathological
case of fitting without an intercept and reintroducing it via constant x1,
R might check whether the design matrix includes a column of ones, and
adjust the degrees of freedom accordingly. But now I can see that by
explicitly requesting via the formula interface not to fit a constant, I am
implicitly stating my hypothesis that y==0, even if I reintroduce my
suspicion that y==mu via x1 < 1. If I understood correctly, x1 is treated
as a variable in the latter case, right?
On Jan 22, 2011, at 5:18 , Bert Gunter wrote:
> Well ... as x1 is continuous(numeric), it has no levels. So ...??
>
> Note that the fits are identical for both models. The issue is only
> what is the Null that you are testing in the two cases. In the first
> case, it is just y = constant, so you are testing the 1 df for x1. In
> the second, it is y = 0 (which rarely makes any sense) and you are
> testing the 2 df for the two terms (x0 and x1). Etc. etc.
>
>  Bert
>
> On Fri, Jan 21, 2011 at 7:48 PM, David Winsemius
wrote:
>>
>> On Jan 21, 2011, at 9:03 PM, jochen laubrock wrote:
>>
>>> Dear list,
>>>
>>> the following came up in an introductory class. Please help me
understand
>>> the 1 (or 0+) syntax in formulae: Why do the enumerator dfs,
Fstatisics
>>> etc. differ between the models lm(y ~ x1) and lm(y ~ x0 + x1  1), if x0
is
>>> a vector containing simply ones?
>>
>> You are testing something different. In the first case you are testing
the
>> difference between the baseline and the second level of x1 (so there is
only
>> one d.f.), while in the second case you are testing for both of the
>> coefficients being zero (so the numerator has 2 d.f.). It would be easier
to
>> see if you did print() on the fit object. The first model would give you
an
>> estimate for an "Intercept", which is really an estimate for the first
level
>> of x1. Having been taught to think of anova as just a special case of
>> regression is helpful here. Look at the model first and only then look
at
>> the anova table.
>>
>>
>>>
>>> Example:
>>>
>>> N < 40
>>> x0 < rep(1,N)
>>> x1 < 1:N
>>> vare < N/8
>>> set.seed(4)
>>> e < rnorm(N, 0, vare^2)
>>>
>>> X < cbind(x0, x1)
>>> beta < c(.4, 1)
>>> y < X %*% beta + e
>>>
>>> summary(lm(y ~ x1))
>>> # [...]
>>> # Residual standard error: 20.92 on 38 degrees of freedom
>>> # Multiple Rsquared: 0.1151, Adjusted Rsquared: 0.09182
>>> # Fstatistic: 4.943 on 1 and 38 DF, pvalue: 0.03222
>>>
>>> summary(lm(y ~ x0 + x1  1)) # or summary(lm(y ~ 0 + x0 + x1))
>>> # [...]
>>> # Residual standard error: 20.92 on 38 degrees of freedom
>>> # Multiple Rsquared: 0.6888, Adjusted Rsquared: 0.6724
>>> # Fstatistic: 42.05 on 2 and 38 DF, pvalue: 2.338e10
>>>
>>>
>>> Thanks in advance,
>>> Jochen
>>>
>>>
>>> 
>>> Jochen Laubrock, Dept. of Psychology, University of Potsdam,
>>> KarlLiebknechtStrasse 2425, 14476 Potsdam, Germany
>>> phone: +493319772346, fax: +493319772793
>>>
>>> ______________________________________________
>>> Rhelp@rproject.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/rhelp
>>> PLEASE do read the posting guide
>>> http://www.Rproject.org/postingguide.html
>>> and provide commented, minimal, selfcontained, reproducible code.
>>
>> David Winsemius, MD
>> West Hartford, CT
>>
>> ______________________________________________
>> Rhelp@rproject.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/rhelp
>> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
>> and provide commented, minimal, selfcontained, reproducible code.
>>
>
>
>
> 
> Bert Gunter
> Genentech Nonclinical Biostatistics
> 4677374
> http://devo.gene.com/groups/devo/depts/ncb/home.shtml

Jochen Laubrock, Dept. of Psychology, University of Potsdam,
KarlLiebknechtStrasse 2425, 14476 Potsdam, Germany
phone: +493319772346, fax: +493319772793

Message: 83
Date: Sat, 22 Jan 2011 12:13:35 +0530
From: pratik wankhade
To: rhelp@rproject.org
Subject: [R] about matrices merge and retrieve algorithm.
MessageID:
ContentType: text/plain
I have a problem as follows:
1. If we have 3 matrices A,B,C and we merge them in a single matrix ABC by
any method like addition , subtraction division,multiplication,etc
2. and then we want to retrieve original 3 matrices A,B,C from single ABC
matrix
What will be the algorithm?
[[alternative HTML version deleted]]

Message: 84
Date: Sat, 22 Jan 2011 12:20:10 +0530
From: Ajay Ohri
To: rsigdebian@rproject.org, R list
Subject: [R] Debian ?Ubuntu version of latest R using synaptic in
Ubuntu 10.10
MessageID:
ContentType: text/plain
Dear List
I use synaptic to download R on my Ubuntu 10.10. It seems latest version of
R on Ubuntu is 2.11.1
Even when I use debian.cran.rproject.org to update my packages the problem
remains (latest versions on CRAN are almost always 2 updates ahead of Debian
packages) This is also true for a lot of other packages as well
My specific problem is while I can use sudo aptget to update packages from
Debian repository I get a permission denied when I am trying to update from
CRAN from within R. I am a Linux newbie
Please help
Regards
Ajay
Websites
http://decisionstats.com
[[alternative HTML version deleted]]

Message: 85
Date: Sat, 22 Jan 2011 08:58:11 +0100 (CET)
From: Sascha Vieweg
To: Spencer Graves
Cc: rhelp@rproject.org, PtitBleu
Subject: Re: [R] Accessing MySQL Database in R
MessageID:
ContentType: TEXT/PLAIN; charset=UTF8; format=flowed
I think this is not an R issue, but one of MAMP. On my server's
sql service, I can connect using password, however, on my local
MAMP, I need the socket:
dbCon < dbConnect(dbdr, user="root", password="root",
dbname="mydb",
unix.socket="/Applications/MAMP/tmp/mysql/mysql.sock")
HTH, *S*
On 110120 08:30, Spencer Graves wrote:
> The following worked for me recently:
>
>
> library(RMySQL)
> MySQL. < MySQL()
> MySQLcon < dbConnect(MySQL., user='thisuser', password='thispassword',
> dbname='desiredDB')
>
>
> I have the following suggestions and questions for you:
>
>
> 1. Have you tried supplying "dbname" rather than "host"?
>
>
> 2. Please provide "sessionInfo()". Many packages have a
> function named "dbConnect", and I don't know which one you are using.
>
>
> 3. I don't know if "MySQL()" is equivalent to
dbDriver("MySQL"),
> which you used. It might be; I don't know.
>
>
> 4. The standard "install.packages('RMySQL')" may not work,
> because this package needs to be built to configure itself properly to
your
> local operating system and versions of MySQL and R installed.
Installation
> instructions are available at
> "http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL". If you have not
already
> followed those instructions, please do so. There is a good chance that
will
> fix your problem, I think.
>
>
> 5. If this is not adequate, I suggest you post this question
to
> "rsigdb@stat.math.ethz.ch". [I suggest you subscribe first. This list
has
> low volume and you can unsubscribe later if you prefer. And please also
> provide "sessionInfo()".]
>
>
> 6. Or use RODBC as suggested by Ptit Bleu. It comes highly
> recommended (including by Brian Ripley). However, I had difficulties
getting
> positive results from both RMySQL and RODBC. I tried both, with each
> receiving similar quantities of expletives. Finally, I got RMySQL to do
what
> I wanted and suspended my schoolboy exercises with RODBC.
>
>
> Hope this helps.
> Spencer
>
>
> On 1/20/2011 5:55 AM, PtitBleu wrote:
>> Hello,
>>
>> I used to use RMySQL but as there is no more package for windows, I
>> decided
>> to move to RODBC.
>> I installed ODBC driver for MySQL (downloaded on the MySQL website) and
>> then
>> the RODBC package.
>>
>> I finally discovered that it was not needed to "register" your database
>> with
>> ODBC before using it.
>> These commands below work for me.
>>
>> library(RODBC)
>> ch<odbcDriverConnect(connection="SERVER=localhost;DRIVER=MySQL ODBC 5.1
>> Driver;DATABASE=my_database;UID=root;PWD=my_password;case=tolower")
>> resultdb<sqlQuery(ch,"SELECT * from my_table")
>> odbcClose(ch)
>>
>> Try to modify them for your case.
>> I hope it will work for you.
>> Good luck,
>> Ptit Bleu.
>>
>>
>> Re: Accessing MySQL Database in R
>> Jan 18, 2011; 12:10am ? by djmuseR [User is online] djmuseR
>> Hi:
>>
>> Because R does not have a direct interface to MySQL?
>>
>> You need to load a communication package  the two most common ones are
>> RODBC and RMySQL. The former requires that you register your MySQL
>> database
>> table(s) with ODBC before using the RODBC package on them, whereas the
>> latter works with specific version combinations of MySQL and R. The
RODBC
>> package has a very informative vignette; for information re the RMySQL
>> package, see
>> http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL
>>
>> HTH,
>> Dennis
>>
>> On Mon, Jan 17, 2011 at 1:30 PM, schlafly<[hidden email]> wrote:
>>
>> > I have a local installation of MySQL on my computer.
>> >
>> > I enter the following to access MySQL from the command line:
>> > /Applications/MAMP/Library/bin/mysql h localhost u root p
>> > I am then prompted for a password, and I use: root
>> > This connects me to MySQL in the command line.
>> >
>> > I now want to access MySQL databases in R. I enter the following:
>> > mysql< dbDriver("MySQL")
>> > conn< dbConnect(mysql,user='root',host='localhost', password='root')
>> >
>> > I get the following error message: Error in mysqlNewConnection(drv,
...)
>> > :
>> > RSDBI driver: (Failed to connect to database: Error: Access denied
for
>> > user
>> > 'root'@'localhost' (using password: YES)
>> >
>> > Does anyone know why these aren't equivalent?
>> > 
>> > View this message in context:
>> >
http://r.789695.n4.nabble.com/AccessingMySQLDatabaseinRtp3221264p3221264.html
>> > Sent from the R help mailing list archive at Nabble.com
>
> ______________________________________________
> Rhelp@rproject.org mailing list
> https://stat.ethz.ch/mailman/listinfo/rhelp
> PLEASE do read the posting guide
http://www.Rproject.org/postingguide.html
> and provide commented, minimal, selfcontained, reproducible code.
>
>

Sascha Vieweg, saschaview@gmail.com

Message: 86
Date: Sat, 22 Jan 2011 00:06:38 0800
From: "Daniel Nordlund"
To: "'R list'"
Subject: Re: [R] [RsigDebian] Debian ?Ubuntu version of latest R
using synaptic inUbuntu 10.10
MessageID: <55D5B0CC6D2C47578059AA1BE5295B92@Aragorn>
ContentType: text/plain; charset="utf8"
> Original Message
> From: rsigdebianbounces@rproject.org [mailto:rsigdebianbounces@r
> project.org] On Behalf Of Ajay Ohri
> Sent: Friday, January 21, 2011 10:50 PM
> To: rsigdebian@rproject.org; R list
> Subject: [RsigDebian] Debian ?Ubuntu version of latest R using synaptic
> inUbuntu 10.10
>
> Dear List
>
> I use synaptic to download R on my Ubuntu 10.10. It seems latest version
> of
> R on Ubuntu is 2.11.1
>
> Even when I use debian.cran.rproject.org to update my packages the
> problem
> remains (latest versions on CRAN are almost always 2 updates ahead of
> Debian
> packages) This is also true for a lot of other packages as well
>
> My specific problem is while I can use sudo aptget to update packages
> from
> Debian repository I get a permission denied when I am trying to update
> from
> CRAN from within R. I am a Linux newbie
>
> Please help
>
> Regards
>
> Ajay
>
Ajay,
To update from within R, start R using sudo and you should solve your
permissions problem. In addition, go to the Linux section of "Download and
Install R" on CRAN and see the instructions for downloading and installing
the latest version of R for your version of Ubuntu.
Hope this is helpful,
Dan
Daniel Nordlund
Bothell, WA USA

Message: 87
Date: Sat, 22 Jan 2011 09:55:49 +0000
From: Steve Powell
To: rhelp@rproject.org
Subject: [R] effect size measure for dependent samples
MessageID:
ContentType: text/plain
Any advice on which package I can use for calculating effect sizes for two
dependent samples? compute.es seems only to consider independent samples.
Thanks in advance
Steve Powell
[[alternative HTML version deleted]]

_______________________________________________
Rhelp@rproject.org mailing list
https://stat.ethz.ch/mailman/listinfo/rhelp
PLEASE do read the posting guide http://www.Rproject.org/postingguide.html
and provide commented, minimal, selfcontained, reproducible code.
End of Rhelp Digest, Vol 95, Issue 22
**************************************
[[alternative HTML version deleted]]