Re: [R] Permuting rows of a matrix

2011-02-10 Thread Dennis Murphy
Hi: One way: x[sample(nrow(x)), ] HTH, Dennis On Wed, Feb 9, 2011 at 10:45 PM, Diogo Almeida dala...@gmail.com wrote: Hi, I need to permute the rows of a matrix, where each row is independently rearranged. A simple solution is this: shuffled - datamatrix - matrix(1:24, ncol = 4) for (i

Re: [R] Permuting rows of a matrix

2011-02-10 Thread Petr Savicky
On Thu, Feb 10, 2011 at 01:45:46AM -0500, Diogo Almeida wrote: Hi, I need to permute the rows of a matrix, where each row is independently rearranged. A simple solution is this: shuffled - datamatrix - matrix(1:24, ncol = 4) for (i in 1:nrow(datamatrix)) { shuffled[i, ] -

Re: [R] A question on Duplicating

2011-02-10 Thread Keith Jewell
Unless I've made a mistake (it happens!) that gives FALSE on the data which the OP said should give TRUE. Ravi Varadhan suggested duplicated(a) duplicated(b) but that gives the same result for b - c(n, m, o, m) for which I think the OP would like FALSE I think this may do it all((a %in%

Re: [R] Permuting rows of a matrix

2011-02-10 Thread Petr Savicky
On Thu, Feb 10, 2011 at 01:45:46AM -0500, Diogo Almeida wrote: Hi, I need to permute the rows of a matrix, where each row is independently rearranged. A simple solution is this: shuffled - datamatrix - matrix(1:24, ncol = 4) for (i in 1:nrow(datamatrix)) { shuffled[i, ] -

[R] loop problem

2011-02-10 Thread Rocio Ponce
Hi there, I'm new working with R and I am trying to find the unchosen set of islands that are closer to all the possible combination (of 2 out of 13) of a set of chosen islands. In other words, if I have a set of 13 islands (1, 2, ...13) and choose all the possible combination of 2 islands (1-2,

Re: [R] Problem with long number (from character to numeric class)

2011-02-10 Thread PtitBleu
Hello Dan, I just need to make substractions, comparisons and to use them in a split command. Ptit Bleu. Hello, I have a text file with one column containing long number but stored as string. I download the file with read.table (and colClass) and the first row of this column is :

[R] minimum spanning tree

2011-02-10 Thread amir
Hi, I have a graph G with n nodes (n=1..100). I want to find the spanning tree over only some specific nodes (not all nodes in G), for instance nodes (2,3,6). Is there any way in R that can do this? Maybe one solution is create another subgraph g' of graph G which consists nodes 2,3,6 and their

[R] Longitudinal Weights in PLM package

2011-02-10 Thread Arne
Hi all, I a semi-beginner with R and I am working with the plm package to examine a longitudinal dataset. Each individual in this dataset has a longitudinal weight for the probability that he or she remains in the sample. Unfortunately, I have not found an argument to use weights in the plm

[R] Installing R on cygwin

2011-02-10 Thread Deb Midya
Hi R users,   Thanks in advance.   Is it possible to install R on cygwin? If yes, can anyone assist me how can I install R on cygwin?   Currently, I am using R on Windows XP. I have found that binary version of some packages such as RCurl is not available.    Once again, thank you very much for

[R] plz help with rasch model

2011-02-10 Thread rman81
The following is what I have done: 1)##made an data frame: X=c(1,1,1,1, 1,1,1,2, 1,1,2,1, 1,1,2,2, 1,2,1,1, 1,2,1,2, 1,2,2,1, 1,2,2,2, 2,1,1,1, 2,1,1,2, 2,1,2,1, 2,1,2,2, 2,2,1,1, 2,2,1,2, 2,2,2,1, 2,2,2,2) X=matrix(X,4,16) X=t(X) freq=c(20,2,6,1,9,2,4,1,38,7,25,6,24,6,23,42)

[R] JGR and font antialiasing

2011-02-10 Thread Matthias Rieber
Hi, I've noticed that font antialiasing is enabled in the console window, but not in the editor windows. I'm using R version 2.12.1. JGR 1.7.4 and the jdk from Ubuntu 10.04, which claims to be: OpenJDK Runtime Environment (IcedTea6 1.9.5) (6b20-1.9.5-0ubuntu1~10.04.1). Is that a problem with my

Re: [R] Installing R on cygwin

2011-02-10 Thread Prof Brian Ripley
On Thu, 10 Feb 2011, Deb Midya wrote: Hi R users, ? Thanks?in advance. ? Is it possible to install R on cygwin? If yes, can anyone assist me how can I install R on cygwin? That *is* described in the 'R Installation and Administration' manual. ? Currently, I am using R on Windows XP. I have

Re: [R] Installing R on cygwin

2011-02-10 Thread Mike Marchywka
I'm not sure I did anything special to install R for use with cygwin. Availability of RCurl appears to relate to windohs AFAICT from the CRAN page. I have never bothered to use this since I already use the related linux tools available through cygwin. Building from source may have become an

[R] Longitudinal Weights in PLM package

2011-02-10 Thread Millo Giovanni
Dear Arne, the inclusion of weights in the (mainly-GLS-related-) procedures in 'plm' is not obvious: at least, it is not to me. Maybe you might apply the weights to the data before using them in estimation, which I have done in the past, although it was then meant to reflect stratification, not

Re: [R] Running out of memory when importing SPSS files

2011-02-10 Thread Kenn Konstabel
On Wed, Feb 18, 2009 at 9:21 PM, dobomode dobom...@gmail.com wrote: I am trying to import a large dataset from SPSS into R. The SPSS file is in .SAV format and is about 1GB in size. I use read.spss to import the file and get an error saying that I have run out of memory. I am on a MAC OS X

[R] extracting characters from string

2011-02-10 Thread Yan Jiao
Dear R gurus, If I got a vector with string characters like abcd_efgh_12ab3_dfsfd, how could I extract 12ab3, which is the characters after second underscore and before the third underscore? Tons of thanks yan

Re: [R] extracting characters from string

2011-02-10 Thread Henrique Dallazuanna
Try this: gsub(.*_.*_(.*)_.*, \\1, abcd_efgh_12ab3_dfsfd) On Thu, Feb 10, 2011 at 9:42 AM, Yan Jiao y.j...@ucl.ac.uk wrote: Dear R gurus, If I got a vector with string characters like abcd_efgh_12ab3_dfsfd, how could I extract 12ab3, which is the characters after second underscore and

Re: [R] subscription

2011-02-10 Thread Sarah Goslee
The answer to that question is at the bottom of each and every message that appears on this list: https://stat.ethz.ch/mailman/listinfo/r-help On Wed, Feb 9, 2011 at 11:53 PM, Julie Smith smit...@plu.edu wrote: Hi, How can I unsubscribe from the mailing list? Best, Julie mith        

[R] Installing cairo-package fails / solaris

2011-02-10 Thread Reinhard Sy
Hi, I have installed the latest version of libglib-2.0 (2.28.0) and cairo 1.10.2 Then I have compiled R 2.12.1 But when i I try to install Cairo (1.4-6) I get the following unreferenced Symbol error: *** installing help indices ** building package indices ... ** testing if installed package

Re: [R] Error in plot.window(...) : invalid 'xlim' value from plot(...par(new = TRUE))

2011-02-10 Thread Duncan Murdoch
On 11-02-09 7:40 PM, David Wolfskill wrote: [New to the community; still in early part of R's learning curve.] In the call below that has plot(..., par(new=TRUE)) you don't name the parameter to which par(new=TRUE) will be bound, so the first available is chosen, which was apparently xlim.

Re: [R] Installing cairo-package fails / solaris

2011-02-10 Thread Prof Brian Ripley
First, it is 'Cairo' (R is case sensitive), and this is wrong list (see the posting guide). But in any case we can't help you as what you show is far from complete and this is not an R issue. Usually there are multiple versions of such libraries on a Solaris system: the problem is most

Re: [R] Installing cairo-package fails / solaris

2011-02-10 Thread Reinhard Sy
If you read my email carefully then: if I wrote Cairo I mean the R Package Cairo else I mean the Library cairo from carographics.org! I need to use Cairo because we are creating a huge amount of graphics in BATCH mode for reporting purpose. I think pango is not the solution I need for

Re: [R] Applying multiple functions to one object

2011-02-10 Thread Karl Ove Hufthammer
Den wrote: 'Aggregate multiple functions into a single function. Combine multiple functions to a single function returning a named vector of outputs' This is a short description of each() function from plyr package Here is an example from help each(min, max)(1:10) Thanks! I really

[R] Modeling a wind driven boat journey

2011-02-10 Thread Andrew Craven
Hi I am trying to model path of a wind powered boat. I have some wind data, model as the frequency of the wind with its strength and direction. What I like to be able to calculate is for some random period in time for points a b c what was the wind strength and what was its direction.

[R] modifynig some elements of a vector

2011-02-10 Thread Eric Elguero
He everybody, I want to add 1 to some elements of a vector: x is a vector u is a vector of idices, that is, integers assumed to be within the range 1..length(x) and I want to add 1 to the elements of x each time their index appears in u x[u]-x[u]+1 works only when there are no duplicated

[R] maximum likelihood classifier

2011-02-10 Thread Víctor Rodríguez Galiano
Hello, I am interested in classifying some data using a maximum likelihood classifer. Does anybody know a package which include this classifier? Thanks [[alternative HTML version deleted]] __

[R] Ggplot: free x-scales in a facet-grid

2011-02-10 Thread Strategische Analyse CSD Hasselt
Hello, I have a ggplot that has the looks of the plot that I want, but it doesn't have the right layout. The data is an ordered melted dataframe: - ID - type (to use for a faced grid) - time - type - time - value (POSIXct) - pos (to use for a faced grid, this is an index to split the plot)

Re: [R] assign factor levels based on list

2011-02-10 Thread Tim Howard
David and Bill, Thank you so much for your rapid and exceptional help. Bill, the reason I had gone with lists within the list was because I thought I might use the list for holding other information - and because it was easier to get the column name. Your simple-list suggestion is cleaner and

[R] stochastic growth models

2011-02-10 Thread Vassily Shfets
Hello, It's not easy to express clearly what I have in mind by stochastic growth models. I've been working with a couple of titles -Stochastic Models in Biology, for one, but both date back a decade or more. I'll try to illustrate the model a little more. A reasonably comparable situation is

[R] MatchIt and sensitivity analysis

2011-02-10 Thread moleps islon
Dear all, Is there a package that allows me to run a sensitivy analysis on a matched dataset created using MatchIt? I am aware of both rbounds and the sensitivy function in the twang package but they do not allow matched objects from MatchIt as input. //M

Re: [R] modifynig some elements of a vector

2011-02-10 Thread jim holtman
should be able to: u - unique(u) x[u] - x[u] + 1 On Thu, Feb 10, 2011 at 6:50 AM, Eric Elguero eric.elgu...@ird.fr wrote: He everybody, I want to add 1 to some elements of  a vector: x is a vector u is a vector of idices, that is, integers assumed to be within the range 1..length(x) and

Re: [R] Cohen's Kappa for beginners

2011-02-10 Thread David Winsemius
On Feb 10, 2011, at 12:23 AM, Matthew Schmidt wrote: Refresh list was used, but a restart of the client was necessary for updates to become active. I was under the impression which I have just corrected that it would be a simple matter to detach() a package and reload it. My efforts to

[R] directed minimum spanning tree

2011-02-10 Thread amir
Hi, Is there any function in R to find the Directed Minimum Spanning tree? There are some for undirected but I am looking for a directed tree. Regards, Amir -- ___ Amir Darehshoorzadeh |Comp. Architecture Dept. PhD Student

Re: [R] Error Running TinnR with R

2011-02-10 Thread Kalle
The single assignement works excellent for my R_2.12.1 and Tinn-R_2.3.7.1 in Windows 7 x64 on a limited user account (changes to profile.site has to be done with adm priv though). Thanks! -- View this message in context:

[R] help - the condition has length 1 and only the first element will be used

2011-02-10 Thread Bodnar Laszlo EB_HU
Hello there, I don't know if I'm addressing my question to the right e-mail address, I hope I do. Actually I have a little problem concerning writing a code in R. I try to briefly sum up my problem. As you can see below, I created the functions Equation1 and Equation2 with some conditions.

[R] help - the condition has length 1 and only the first element will be used

2011-02-10 Thread Bodnar Laszlo EB_HU
Hello there, I don't know if I'm addressing my question to the right e-mail address, I hope I do. Actually I have a little problem concerning writing a code in R. I try to briefly sum up my problem. As you can see below, I created the functions Equation1 and Equation2 with some conditions.

Re: [R] modifynig some elements of a vector

2011-02-10 Thread Petr Savicky
On Thu, Feb 10, 2011 at 12:50:03PM +0100, Eric Elguero wrote: He everybody, I want to add 1 to some elements of a vector: x is a vector u is a vector of idices, that is, integers assumed to be within the range 1..length(x) and I want to add 1 to the elements of x each time their index

[R] help - the condition has length 1 and only the first element will be used

2011-02-10 Thread Bodnar Laszlo EB_HU
Hi again! I just wanted to say that during typing my message before I mistyped certain of characters and I was just afraid that it might spoil the understanding of my message. So I corrected the characters and now I'm sending you this corrected letter again. Terribly sorry for my mistake.

[R] highest and second highest value in row for each combination

2011-02-10 Thread Alain D.
Dear R-List, I have a dataframe area-c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) type-c(rep(1:10,5)) a-rnorm(50) b-rnorm(50) c-rnorm(50) d-rnorm(50) df-cbind(area,type,a,b,c,d) df area type a b c d [1,]11 0.45608192

Re: [R] help - the condition has length 1 and only the first element will be used

2011-02-10 Thread Jonathan P Daily
The issue here is that if only accepts a single True/False argument. Try these functions: ?ifelse ?all ?any -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its

[R] Help using tm text mining package - preprocessing

2011-02-10 Thread dunner
Thanks all for your help. I fear text mining is an abstract little corner of R. I have imported 3228 text (.txt) files, each a news story, into R using [tm]: textd - Corpus(DirSource(other/docs), readerControl = list(reader =readPlain)) I can pre-process each individual document using

[R] Conditional sampling

2011-02-10 Thread Hosack, Michael
R experts, I need to sample two rows without replacement from the following data frame such that neither row contains the same 'DOW'. For example, I cannot select both a Monday morning and a Monday afternoon. I am using STRATA_NUM as an index to randomly select rows from, since this

[R] randomly generated binary matrix (with conditions)

2011-02-10 Thread Baptiste Coulmont
I want to create a randomly generated 25*15 binary matrix knowing what the colSums and rowSums of this matrix should be. colSums(a) [1] 3 7 2 5 0 4 6 5 5 4 3 4 4 5... rowSums(a) [1] 8 6 6 6 6 6 5 5 5 5 4 4 4... . . Baptiste Coulmont

Re: [R] Conditional sampling

2011-02-10 Thread Duncan Murdoch
On 10/02/2011 11:02 AM, Hosack, Michael wrote: R experts, I need to sample two rows without replacement from the following data frame such that neither row contains the same 'DOW'. For example, I cannot select both a Monday morning and a Monday afternoon. I am using STRATA_NUM as an index to

Re: [R] modifynig some elements of a vector

2011-02-10 Thread William Dunlap
Try using tabulate() instead of table(). E.g., compare your original f0 - function (x, u) { tu - table(u) indices - as.numeric(names(tu)) x[indices] - x[indices] + tu x } to f1 - function (x, u) { x + tabulate(u, nbins = length(x)) } I tried it for a 20-long

Re: [R] Problem with xlsx package

2011-02-10 Thread Gabor Grothendieck
On Thu, Feb 10, 2011 at 10:49 AM, Nikhil Joshi nikhiljo...@gmail.com wrote: Gabor, thanks for the suggestion. I did as you have suggested- Started a clean session of R and set the java option.  Then I sourced the library and tried to read the xlsx file but got the same error.  I am assuming

Re: [R] randomly generated binary matrix (with conditions)

2011-02-10 Thread Ben Bolker
Baptiste Coulmont coulmont at yahoo.com writes: I want to create a randomly generated 25*15 binary matrix knowing what the colSums and rowSums of this matrix should be. colSums(a) [1] 3 7 2 5 0 4 6 5 5 4 3 4 4 5... rowSums(a) [1] 8 6 6 6 6 6 5 5 5 5 4 4 4... This is a fairly

[R] Modifying a package name / Build from sources (rpart)

2011-02-10 Thread Simon Knos
Dear List Members Upfront: I am not sure if this is the right place to ask this question even after reading through the FAQ, so apologies if I should have directed the question elsewhere. My problem as follows: I need a modified version of some existing R package. I am well able to make the

[R] Kernel and Machine Learning

2011-02-10 Thread Lorenzo Isella
Dear All, I am not that much into machine learning, but I know that R is wonderful at that. My problem is the following: consider a set of N individuals and an N by N symmetric matrix M. This matrix stands for an interaction between individuals, i.e. the element M[i,j]=M[j,i] is the

Re: [R] Loop to find dates whithin dates

2011-02-10 Thread Phil Spector
I can't see a good solution using a loop, but perhaps this will get you what you want: Dframe1$date = as.Date(Dframe1$sunrise) Dframe2$date = as.Date(Dframe2$Logtime) both = merge(Dframe1,Dframe2) both$when = ifelse(both$Logtime = both$sunrise +both$Logtime =

[R] Hmisc errbar color

2011-02-10 Thread Robert Baer
Is there an easy way to make the error bars the same color as the points and lines they are plotted with. My example # fake data x=sample(1:10, 100, replace =T) y = rnorm(100) + runif(100) df=data.frame(x,y) # summarize data m = aggregate(df,list(x),mean) se = aggregate(df,list(x),sd)/sqrt(10)

[R] comparing groups of proportions

2011-02-10 Thread array chip
Hi, I initially posted this to the general R mailing list, but Bert Gunter thought this may be a mixed model issue, so suggested me to post here. I have a dataset that has 2 groups of subjects. For each subject in each group, the response measured is the number of success (no.success) obatined

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-10 Thread Rick DeShon
Thanks for the response, Rex. This is an interesting approach. The Choleski decomposition approach that John suggested seems to be an obvious and direct approach to this problem. Your approach is less obvious to me but may be equal or superior to the Choleski decomposition. Are all possible

Re: [R] extracting characters from string

2011-02-10 Thread Soumendra
Hi Henrique, I believe your solution is wrong as it is fitted to find 12ab3, whereas Yan seems to be asking for the characters after the second underscore and before the third underscore. For example, gsub(.*_.*_(.*)_.*, \\1, abcd_efgh_X_12ab3_dfsfd) would still yield 12ab3 even though, as I

Re: [R] Simulation of Multivariate Fractional Gaussian Noise and Fractional Brownian Motion

2011-02-10 Thread Kjetil Halvorsen
What you can do to find out is to type into your R session RSiteSearch(multivariate fractional gaussian) That seems to give some usefull results. Kjetil On Tue, Feb 8, 2011 at 1:51 PM, Wonsang You y...@ifn-magdeburg.de wrote: Dear R Helpers, I have searched for any R package or code for

Re: [R] highest and second highest value in row for each combination

2011-02-10 Thread Phil Spector
Alain - Here's a reproducible data set: set.seed(19) area-c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) type-c(rep(1:10,5)) a-rnorm(50) b-rnorm(50) c-rnorm(50) d-rnorm(50) df-cbind(area,type,a,b,c,d) First I'll make a helper function to operate on one row of the data frame: get2

[R] Question about the covariate Z in rhierMnlRwMixture (bayesm)

2011-02-10 Thread Dimitri Liakhovitski
Hello! I am using rhierMnlRwMixture from bayesm package. I would like to use it with a categorical covariate (Z). I have 2 clariciation questions: 1. If the covariate is categorical, do I have to represent it as dummy variable(s)? (e.g., 2 dummy variables for a 3-level categorical variable)? 2.

Re: [R] comparing proportions

2011-02-10 Thread Robert A LaBudde
prop.test() is applicable to a binomial experiment in each of two classes. Your experiment is binomial only at the subject level. You then have multiple subjects in each of your groups. You have a random factor Subjects that must be accounted for. The best way to analyze is a generalized

Re: [R] Modifying a package name / Build from sources (rpart)

2011-02-10 Thread Ben Bolker
Simon Knos simon_mailing at quantentunnel.de writes: Upfront: I am not sure if this is the right place to ask this question even after reading through the FAQ, so apologies if I should have directed the question elsewhere. I appreciate your confusion. I think this might be slightly more

[R] hazard ratio between my groups

2011-02-10 Thread Angel Russo
HI, I am interested in calculating hazard ratio of the stratified groups defined by me. library(survcomp) binscores - cut(scores.train,c(-1000,-1,1,1000),c(low,intermediate,high)) dd - data.frame(surv.time=OS, surv.event= status, strat=binscores) km.coxph.plot(formula.s=Surv(surv.time,

Re: [R] Revolution Analytics reading SAS datasets

2011-02-10 Thread David Smith
The SAS import/export feature of Revolution R Enterprise 4.2 isn't open-source, so we can't release it in open-source Revolution R Community, or to CRAN as we do with the ParallelR packages (foreach, doMC, etc.). It is, though, available for download free of charge to members of the academic

Re: [R] extracting characters from string

2011-02-10 Thread Henrique Dallazuanna
So, a way could be: gsub((.*)_(.*)_(.*)_.*, \\3, abcd_efgh_X_12ab3_dfsfd) On Thu, Feb 10, 2011 at 3:47 PM, Soumendra soumen...@gmail.com wrote: Hi Henrique, I believe your solution is wrong as it is fitted to find 12ab3, whereas Yan seems to be asking for the characters after the

[R] about prediction with a factor

2011-02-10 Thread Zhao Jin
Hi, I don't know how to make prediction with a factor in the linear model. Say yd=c(1,2,3,4,5) sl=c(2,3,4,5,6) sex=c(male,male,female,female,male) sex=factor(sex) m=lm(sl~yd+sex+sex:yd) How to make a prediction with new data like yd=c(4,5,6,7,8) for male and female separately ?

Re: [R] Problem with xlsx package

2011-02-10 Thread Nikhil Joshi
Gabor, thanks for the suggestion. I did as you have suggested- Started a clean session of R and set the java option. Then I sourced the library and tried to read the xlsx file but got the same error. I am assuming that Java machine is loaded when the package xlsx is sourced and not when the

[R] Prediction accuracy from Bagging with continuous data

2011-02-10 Thread Simon Gillings
I am using bagging to perform Bagged Regression Trees on count data (bird abundance in Britain and Ireland, in relation to climate and land cover variables). Predictions from the final model are visually believable but I would really like a diagnostic equivalent to classification success that

Re: [R] Need help merging two dataframes

2011-02-10 Thread Nathaniel
Hi Dennis, Thanks for the solution, I really appreciate it! Best, Nathaniel -- View this message in context: http://r.789695.n4.nabble.com/Need-help-merging-two-dataframes-tp3297313p3299539.html Sent from the R help mailing list archive at Nabble.com.

[R] non-finite function value

2011-02-10 Thread Claudio Carneiro
Hi, all I'm trying to solve an optimization problem with two variables, in wich I use the following functions(they all are working perfectly): FxMixedALT=function(x){calc=(-0.88*exp((-1.53655/1000)*(x^5.3)))-(0.12*exp(-0.06415*(x^2.5)))+0.88+0.12return(calc)}

Re: [R] Generate multivariate normal data with a random correlation matrix

2011-02-10 Thread rex.dwyer
If you want a random correlation matrix, why not just generate random data and accept the correlation matrix that you get? The standard normal distribution in k dimensions is (hyper)spherically symmetric. If you generate k standard normal N(0,1) variates, you have a point in k-space with

[R] Comparison of glm.nb and negbin from the package aod

2011-02-10 Thread sabwo
I have fitted the faults.data to glm.nb and to the function negbin from the package aod. The output of both is the following: summary(glm.nb(n~ll, data=faults)) Call: glm.nb(formula = n ~ ll, data = faults, init.theta = 8.667407437, link = log) Deviance Residuals: Min 1Q

[R] Optimal choice of the threshold u in Peak Over Threshold (POT) Approach

2011-02-10 Thread FMH
Dear All, Could someone please suggest me the way to calculate the optimal threshold in POT method via any available  packages in R? Thanks, Fir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Use glm coefficients for other datasets

2011-02-10 Thread maxsilva
Thank you guys, I've solved my problem with your precious help -- View this message in context: http://r.789695.n4.nabble.com/Use-glm-coefficients-for-other-datasets-tp3276626p3299747.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Hmisc errbar color

2011-02-10 Thread Peter Ehlers
On 2011-02-09 17:27, Robert Baer wrote: Is there an easy way to make the error bars the same color as the points and lines they are plotted with. My example # fake data x=sample(1:10, 100, replace =T) y = rnorm(100) + runif(100) df=data.frame(x,y) # summarize data m =

Re: [R] Hmisc errbar color

2011-02-10 Thread David Winsemius
On Feb 9, 2011, at 8:27 PM, Robert Baer wrote: Is there an easy way to make the error bars the same color as the points and lines they are plotted with. My example # fake data x=sample(1:10, 100, replace =T) y = rnorm(100) + runif(100) df=data.frame(x,y) # summarize data m =

Re: [R] Modifying a package name / Build from sources (rpart)

2011-02-10 Thread Marc Schwartz
On Feb 10, 2011, at 12:13 PM, Ben Bolker wrote: Simon Knos simon_mailing at quantentunnel.de writes: Upfront: I am not sure if this is the right place to ask this question even after reading through the FAQ, so apologies if I should have directed the question elsewhere. I appreciate

Re: [R] Problem with xlsx package

2011-02-10 Thread Tobias Verbeke
On 02/10/2011 05:30 PM, Gabor Grothendieck wrote: On Thu, Feb 10, 2011 at 10:49 AM, Nikhil Joshinikhiljo...@gmail.com wrote: Gabor, thanks for the suggestion. I did as you have suggested- Started a clean session of R and set the java option. Then I sourced the library and tried to read the

Re: [R] Revolution Analytics reading SAS datasets

2011-02-10 Thread Matt Shotwell
On Thu, 2011-02-10 at 10:44 -0800, David Smith wrote: The SAS import/export feature of Revolution R Enterprise 4.2 isn't open-source, so we can't release it in open-source Revolution R Community, or to CRAN as we do with the ParallelR packages (foreach, doMC, etc.). Judging by the language of

[R] How to reset libPaths for root

2011-02-10 Thread Juergen Rose
High, on all of my computers the first entry in libPaths for root was /usr/lib64/R/library or /usr/lib/R/library. Now it change at one (lynx) anyway to root@lynx:/root(2)# R R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform:

Re: [R] Revolution Analytics reading SAS datasets

2011-02-10 Thread Jeremy Miles
On 10 February 2011 12:01, Matt Shotwell m...@biostatmatt.com wrote: On Thu, 2011-02-10 at 10:44 -0800, David Smith wrote: The SAS import/export feature of Revolution R Enterprise 4.2 isn't open-source, so we can't release it in open-source Revolution R Community, or to CRAN as we do with the

[R] Chi square test of proprotions in 2 groups of different sizes

2011-02-10 Thread Dimitri Liakhovitski
Hello! Very sorry for a probably very simple question - I looked but did not find an answer in the archives. I have a table counts (below) that shows counts by Option within each of my 2 groups. However, my groups have different sizes (N1=255 and N2=68). Table prop shows the resulting proportions

[R] Repeaded sampling

2011-02-10 Thread Hui Du
Hi all, I have a dataset. Each time I want to sample N(i) elements from it and I want to repeated sampling M times. N(i) is varied from time to time. For example, dataset = 1:50; a = list(); M = 1000; I want to

[R] accessing members from a data frame

2011-02-10 Thread Kushan Thakkar
I have a data frame with the following columns: Date Price Buy Sell The Buy and Sell variables are binary. They are either zero or 1. Additionally, they are mutually exclusive. Either Buy is 1, Sell is 1 or they are both 0. But they are never both 1 for a given observation. I want to see

[R] Multi-page plots (Trellis)

2011-02-10 Thread sherri heck
Dear All - I would like to make multi-page plots, but my plots are writing over one another - thus leaving just the last plot. Here is what I am doing: pollutionRose(temp, nox, type=hour) update(trellis.last.object(), layout =c(3,3,3) ) I would like 24 plots with 9 plots/page (the last page

[R] Rioja package, creating transfer function, WA, Error in FUN

2011-02-10 Thread mdc
Hi, I am a new R user and am trying to construct a palaeoenvironmental transfer function (weighted averaging method) using the package rioja. I've managed to insert the two matrices (the species abundance and the environmental data) and have assigned them to the y and x values respectively. When

Re: [R] accessing members from a data frame

2011-02-10 Thread Phil Spector
Try my.data.frame[my.data.frame$Buy==1 | my.data.frame$Sell ==1, ] or subset(my.data.frame,buy == 1 | sell == 1) Then take a look at the help page for || i.e., help(||) to see what you did wrong. - Phil Spector

[R] : package to draw

2011-02-10 Thread Mr rong chen
Do anyone know an R or bioconductor package to draw HGDP pie chart as in the link below? http://hgdp.uchicago.edu/cgi-bin/alfreqs.cgi?pos=118253964chr=chr8rs=rs12255372imp=false Many SNPs were missing from the link, so I would like to draw similar graphs in R. I have all the allele frequency

[R] Add different types of legend: line and points

2011-02-10 Thread Shiguo Jiang
Hello, I plot box plot, and add a point to the box indicating mean. I also add some range to the box width. I want to add legend for both the range (line) and mean (point). However, I cannot add line legend and point legend together. The code looks like the following. (1) First, I tried the

Re: [R] comparing proportions

2011-02-10 Thread Robert A LaBudde
1. If you use a random effects model, you should make Subject the random factor. I.e., a random intercepts model with 1|Subject. Group is a fixed effect: You have only 2 groups. Even if you had more than 2 groups, treating Group as random would return a standard deviation, not a P-value as you

Re: [R] Repeaded sampling

2011-02-10 Thread Eik Vettorazzi
Hi, try ds-1:50 M-10 n-sample(5:15,M,replace=T) #generate different n[i] lapply(1:M,FUN=function(i) sample(ds,n[i])) hth. Am 10.02.2011 19:50, schrieb Hui Du: Hi all, I have a dataset. Each time I want to sample N(i) elements from it and I want to repeated sampling M

[R] Calculating rowMeans from different columns in each row?

2011-02-10 Thread Marine Andersson
Hello! I have a dataset like this: X1 X2 X3 X4 X5X6X7X8 1 2 2 1 2 3 2 6 2 3 2 5 7 9 1 3 19 12 6 1 1 3 6 The columns X1-X6 contains ordinary numeric values. X7 contains the

Re: [R] : package to draw

2011-02-10 Thread Greg Snow
You could use the floating.pie function in the plotrix package, but even the author of that function/package has stated in the past that pie charts are not the best tool. Also look at the symbols function for some alternatives, I would use the thermometers (and if that does not give enough

[R] Calling symbols from dataframe for xyplot

2011-02-10 Thread John Poulsen
Hello, I am trying to make a xyplot plot with points that are different symbols. I want to call the symbol type (pch) from a column in my dataframe. Here is a simplified example. In my real example I also have groups, which I have not included here. This example doesn't change the symbols

[R] How to determine the quantile boundary from an ECDF?

2011-02-10 Thread Ivan Popivanov
Given a dataset x, the ecdf is ecdf(x). Then I can use ecdf(x)(y) to find the percentile of y. Given the ecdf is there a way to determine what is the value of y that is the boundary of let's say 95 percentile? In other words, is there a function I can call on the ecdf like: fomeFunc( ecdf( x ),

[R] Finding length of unique numbers in a vector

2011-02-10 Thread Nipesh Bajaj
Hello there, would you please look into my codes? Here I have following: set.seed(100) samp - sample(c(1,-1,0), 20, replace=T); samp [1] 1 1 -1 1 -1 -1 0 -1 -1 1 -1 0 1 -1 0 0 1 -1 -1 0 Here I want to calculate the length of each unique number for above vector. How can I do that?

Re: [R] Calculating rowMeans from different columns in each row?

2011-02-10 Thread Phil Spector
Marine - Assuming your data frame is named df, I think apply(df,1,function(x)mean(x[x[7]:x[8]])) will give you what you're looking for. - Phil Spector Statistical Computing Facility

Re: [R] How to reset libPaths for root

2011-02-10 Thread Prof Brian Ripley
See ?.libPaths : as so often, all that is needed is attentive reading of the documentation: The library search path is initialized at startup from the environment variable ‘R_LIBS’ (which should be a colon-separated list of directories at which R library trees are rooted)

Re: [R] comparing proportions

2011-02-10 Thread array chip
Robert, thank you! I tried all 3 models you suggested. Since each subject only has one line of data in my dataset, would including Subject as a factor in glm() or lm() lead to 0 df for resaiduals? Attached is my dataset and here is my version of the 3 models:

Re: [R] Finding length of unique numbers in a vector

2011-02-10 Thread Eik Vettorazzi
Hi, does table(samp) do what you want? Am 10.02.2011 22:54, schrieb Nipesh Bajaj: Hello there, would you please look into my codes? Here I have following: set.seed(100) samp - sample(c(1,-1,0), 20, replace=T); samp [1] 1 1 -1 1 -1 -1 0 -1 -1 1 -1 0 1 -1 0 0 1 -1 -1 0 Here

Re: [R] Add different types of legend: line and points

2011-02-10 Thread Duncan Murdoch
On 11-02-10 3:56 PM, Shiguo Jiang wrote: Hello, I plot box plot, and add a point to the box indicating mean. I also add some range to the box width. I want to add legend for both the range (line) and mean (point). However, I cannot add line legend and point legend together. The code looks like

Re: [R] about prediction with a factor

2011-02-10 Thread Dennis Murphy
Hi: There are a couple of things here. Firstly, if you intend to predict from a model in R, make sure your input to the model is a data frame. You can fit a model piecemeal with a set of vectors, but there's a distinct possibility you'll end up frustrated when trying to make predictions with new

Re: [R] Finding length of unique numbers in a vector

2011-02-10 Thread Clint Bowman
?rle -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600

  1   2   >