[R] lattice: ticks at the joining sides of panels?

2013-02-26 Thread Martin Ivanov
Dear R users, I would like to produce a lattice graph that keeps the ticks at the joining sides of the panels. For example: library(lattice) library(datasets) xyplot(lat ~ long | cut(depth, 2), data = quakes, between=list(x=1)) You can see that ticks are plotted at the sides 1 (bottom), 2

Re: [R] Issue attaching a dataset

2013-02-26 Thread Milan Bouchet-Valat
Le lundi 25 février 2013 à 20:26 -0300, Pablo Menese a écrit : I use to work whit stata dataframe, so, when I use R I type read.dta Until today I do that without any problem, after type: mydata-read.dta(C:/dropbox/dataframe.dta) attach(mydata) Everything works great... but today, when I

Re: [R] Issue attaching a dataset

2013-02-26 Thread Prof Brian Ripley
On 26/02/2013 09:55, Milan Bouchet-Valat wrote: Le lundi 25 février 2013 à 20:26 -0300, Pablo Menese a écrit : I use to work whit stata dataframe, so, when I use R I type read.dta Until today I do that without any problem, after type: mydata-read.dta(C:/dropbox/dataframe.dta) attach(mydata)

[R] Help with graphs in A4 size

2013-02-26 Thread Eva Prieto Castro
Hi, I need to generate complex graphics which have to be shown in the plot window but also in pdf file, and they must have A4 size. This is the reason why I use width=8.27 and heigth=11.69. The problem is that I don't make it runs when I put something (text, lines, and so on) outside the

Re: [R] Help with graphs in A4 size

2013-02-26 Thread Duncan Mackay
Hi Eva Apparently no problem for me with Win 7 as far as I can see. Perhaps returning to the command window may be a problem? R version 2.15.2 (2012-10-26) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252

[R] parallel execution in R

2013-02-26 Thread Alaios
Dear all, I have a piece of code that  I want to run in parallel (I am working in system of 16 cores) foreach (i=(seq(-93,-73,length.out=21))) %dopar%  {   threshold-i   print(i) do_analysis1(i,path) do_analysis2(i,path)           

Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Niklas Fischer
Hi again, Thanks for Anthony about the links on reproducible codes. Thanks for Rui about ordering when rows are intact. One more question Here is your code. x - cbind( sample( LETTERS[1:6] , 100 , replace = TRUE ) , sample( LETTERS[1:6] , 100 , replace = TRUE )

Re: [R] lattice: ticks at the joining sides of panels?

2013-02-26 Thread Bert Gunter
Have you tried using an at list in the x and y components of the scales list argument to xyplot? The docs say that that list should be as long as the number of panels, indicating that you get tic marks drawn for all panels. And I assume you can specify no tics drawn for some. Presumably this

Re: [R] Light Libraries

2013-02-26 Thread Uwe Ligges
Perhaps you want to tell people where the advantage is comparing it with the very well established R package system. Best, Uwe Ligges On 26.02.2013 02:43, ivo welch wrote: Dear R-Help group: I have been tinkering with how I want my personal standard library functions to look like. They

Re: [R] parallel execution in R

2013-02-26 Thread Uwe Ligges
On 26.02.2013 14:00, Alaios wrote: Dear all, I have a piece of code that I want to run in parallel (I am working in system of 16 cores) foreach (i=(seq(-93,-73,length.out=21))) %dopar% { threshold-i print(i) do_analysis1(i,path)

[R] What happened to financial package?

2013-02-26 Thread Keith Weintraub
Folks, I have been using the cf function from the financial package for a few years now. Upon updating my version of R to ... I found that the package no longer exists in the main collection of R packages. Has this package been renamed or merged with another package? If the functionality is

Re: [R] What happened to financial package?

2013-02-26 Thread Prof Brian Ripley
On 26/02/2013 14:45, Keith Weintraub wrote: Folks, I have been using the cf function from the financial package for a few years now. I believe it was never converted for 2.14.0 (it was last touched in 2006, and did not have a NAMESPACE file until CRAN auto-generated one), and the

Re: [R] Light Libraries

2013-02-26 Thread ivo welch
there may be no advantage at all. I don't even know a full set of the choices here. if someone does know all the choices, it would be good to point out to readers why my design choices are worse and/or what the alternatives are. some of it is, of course, simply taste. I like the simplicity and

[R] combining 2 dataframes into a 3rd df, with 1 row for each row in df1 df2

2013-02-26 Thread Anika Masters
# 'I need help combining 2 dataframes (df1 df2) into a 3rd (mydf). I want the 3rd dataframe to contain 1 row for each row in df1 df2, and all the columns in both df1 df2. # Advice is appreciated. Thank you. df1 - data.frame(matrix(data=c(7, 99, 12) , nrow=1 , dimnames = list( NULL , c('a' ,

Re: [R] combining 2 dataframes into a 3rd df, with 1 row for each row in df1 df2

2013-02-26 Thread Anika Masters
df1 - data.frame(matrix(data=c(7, 99, 12) , nrow=1 , dimnames = list( NULL , c('a' , 'b' , 'd') ) ) ) df2 - data.frame(matrix(data=c(88, 34, 12, 44, 56) , nrow=1 ,dimnames = list( NULL , c('d' , 'b' , 'x' , 'y', 'c') ) ) ) I figured it out. mydf - merge(df2,df1,all.y=T, all.x=T) mydf2 -

Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Rui Barradas
Hello, I'm not sure I understand, do you want to treat BCC, CBC and CCB as the same? If so try w2 - apply( y , 1 , function(x) paste0(sort(x) , collapse = )) table(w2) Hope this helps, Rui Barradas Em 26-02-2013 13:58, Niklas Fischer escreveu: Hi again, Thanks for Anthony about the

[R] cut a vector in equal parts

2013-02-26 Thread Martin Batholdy
Hi, I would like to cut a vector of values in parts. Each part should have an equal number of elements. for example: x - (rnorm(500)^2) now I want 5 vectors each with 100 elements. The first vector should include the 100 lowest values of x and so on (so that the fifth vector contains the 100

[R] Merging value labels into indicator variable.

2013-02-26 Thread Tasnuva Tabassum
I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to make an indicator variable that will take value 1 if NAM=7 or NAM=8 or NAM=9. How can I do that? I usually do: Var001- ifelse(NAM==7,1,0) for the simplest case. [[alternative HTML version deleted]]

Re: [R] ggplot2 Increase font size

2013-02-26 Thread Alaios
Hi, I am not quite sure what you meanΙ. I give again reproducible code: require(ggplot2) require(reshape) DataToPlot-matrix(data=rnorm(9),nrow=3,dimnames=list(seq(1,3),seq(4,6))) tdm-melt(DataToPlot) p- ggplot(tdm, aes(x = X2, y = X1, fill = factor(value))) +                  

Re: [R] Merging value labels into indicator variable.

2013-02-26 Thread Pete Brecknock
tasnuvat wrote I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to make an indicator variable that will take value 1 if NAM=7 or NAM=8 or NAM=9. How can I do that? I usually do: Var001- ifelse(NAM==7,1,0) for the simplest case. [[alternative HTML version deleted]]

Re: [R] Merging value labels into indicator variable.

2013-02-26 Thread Berend Hasselman
On 26-02-2013, at 18:45, Tasnuva Tabassum t.tasn...@gmail.com wrote: I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to make an indicator variable that will take value 1 if NAM=7 or NAM=8 or NAM=9. How can I do that? I usually do: Var001- ifelse(NAM==7,1,0) for the

Re: [R] cut a vector in equal parts

2013-02-26 Thread jim holtman
?sort ?cut On Tue, Feb 26, 2013 at 12:39 PM, Martin Batholdy batho...@googlemail.com wrote: Hi, I would like to cut a vector of values in parts. Each part should have an equal number of elements. for example: x - (rnorm(500)^2) now I want 5 vectors each with 100 elements. The first

Re: [R] Merging value labels into indicator variable.

2013-02-26 Thread Tasnuva Tabassum
Thanx all, I found my answer. I prefer Peter's second solution. On Tue, Feb 26, 2013 at 11:59 PM, Berend Hasselman b...@xs4all.nl wrote: On 26-02-2013, at 18:45, Tasnuva Tabassum t.tasn...@gmail.com wrote: I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9. I want to make an

Re: [R] legend issues.

2013-02-26 Thread Greg Snow
Nicole, Since you seem more interested in accusing David of being rude than recognizing your own rudeness and taking steps to overcome that and increase your chance of getting useful responses I will quote a few lines from the posting guide for you (the entire posting guide is available from the

Re: [R] ggplot2 Increase font size

2013-02-26 Thread Ista Zahn
Are you sure you didn't get you threads mixed up? Your original question was about changing font size and background colors... See inline for answers to this new question. On Tue, Feb 26, 2013 at 12:45 PM, Alaios ala...@yahoo.com wrote: Hi, I am not quite sure what you meanΙ. I give again

[R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Anika Masters
#I want to merge or join 2 dataframes (df1 df2) into a 3rd (mydf). I want the 3rd dataframe to contain 1 row for each row in df1 df2, and all the columns in both df1 df2. The solution should work even if the 2 dataframes are identical, and even if the 2 dataframes do not have the same column

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread arun
Hi, You could also try: library(gtools) smartbind(df2,df1) #  a  b  d #1 7 99 12 #2 7 99 12 When df1!=df2 smartbind(df1,df2) #   a  b  d  x  y  c #1  7 99 12 NA NA NA #2 NA 34 88 12 44 56 A.K. - Original Message - From: Anika Masters anika.mast...@gmail.com To: r-help@r-project.org

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Anika Masters Sent: Tuesday, February 26, 2013 10:56 AM To: r-help@r-project.org Subject: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.? #I want to merge or

Re: [R] cut a vector in equal parts

2013-02-26 Thread Rui Barradas
Hello, Try the following. x - rnorm(500)^2 split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2 Hope this helps, Rui Barradas Em 26-02-2013 17:39, Martin Batholdy escreveu: Hi, I would like to cut a vector of values in parts. Each part should have an equal number of elements. for

[R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread Debs Majumdar
Hi All, I have a data set of around 17,000 gene names and their lengths. E.g.   gene  kblength     A3GALT2   14.333    AADACL3   12.609    AADACL4   22.532         ABCA4 128.312        ABCB10  42.114      ABCD3    100.287 . and

[R] Help on a code

2013-02-26 Thread Andras Farkas
Dear List,   I have the following code:   x -c(0, 13.8, 38.16667, 62.16667, 85.91667, 108.9167) y -c(1.77, 2.39, 3, 2.65, 2.62, 1.8) Interpolated - approx(x, y,xout=0:tail(x, n=1),method=linear) plot(Interpolated)   in this code x is time in hours

Re: [R] cut a vector in equal parts

2013-02-26 Thread David L Carlson
Insert include.lowest=TRUE or the lowest value will get dropped (assigned NA): split(x, cut(x, quantile(x, probs = seq(0, 1, by = 0.2)), include.lowest=TRUE)) -- David L Carlson Associate Professor of Anthropology Texas AM University College Station,

Re: [R] Help on a code

2013-02-26 Thread Ista Zahn
Hi Andras, This may be too simplistic, but how about with(Interpolated, x[y==2][1]) ? On Tue, Feb 26, 2013 at 4:21 PM, Andras Farkas motyoc...@yahoo.com wrote: Dear List, I have the following code: x -c(0, 13.8, 38.16667, 62.16667, 85.91667,

Re: [R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread Greg Snow
What have you tried so far? The points function will add points to an existing graph (base) and the text function will add text to an existing graph. If those don't do what you need then give us some more details. On Tue, Feb 26, 2013 at 2:04 PM, Debs Majumdar debs_st...@yahoo.com wrote: Hi

[R] problem with nested loops

2013-02-26 Thread Richard Saba
Each of the data sets contains monthly observations on price indices for 7 countries. I use the fitted values from reg1 in the reg2 model. The interior loop executes without error as long as I explicitly specify the data set, i.e. data=dat70. However the code fails to execute if I specify the

Re: [R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread David Winsemius
On Feb 26, 2013, at 1:04 PM, Debs Majumdar wrote: Hi All, I have a data set of around 17,000 gene names and their lengths. E.g. gene kblength A3GALT2 14.333 AADACL3 12.609 AADACL4 22.532 ABCA4 128.312 ABCB10

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread David L Carlson
Clumsy but it doesn't require any packages: merge2 - function(x, y) { if(all(union(names(x), names(y)) == intersect(names(x), names(y{ rbind(x, y) } else merge(x, y, all=TRUE) } merge2(df1, df2) df3 - df1 merge2(df1, df3) -- David L Carlson

Re: [R] Help on a code

2013-02-26 Thread William Dunlap
f - function(x, y, criticalY) { # return x value of first upcrossing of y past criticalY stopifnot(length(x) == length(y), length(x)1, length(criticalY)==1) i - seq_along(x)[-1] w - which(y[i] = criticalY y[i-1] = criticalY)[1] # pos of first upcrossing if (is.na(w)) { # no

Re: [R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread Jim Lemon
On 02/27/2013 08:04 AM, Debs Majumdar wrote: Hi All, I have a data set of around 17,000 gene names and their lengths. E.g. gene kblength A3GALT2 14.333 AADACL3 12.609 AADACL4 22.532 ABCA4 128.312 ABCB10 42.114 ABCD3100.287

Re: [R] problem with nested loops

2013-02-26 Thread David Winsemius
On Feb 26, 2013, at 1:53 PM, Richard Saba wrote: Each of the data sets contains monthly observations on price indices for 7 countries. I use the fitted values from reg1 in the reg2 model. The interior loop executes without error as long as I explicitly specify the data set, i.e.

Re: [R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread Debs Majumdar
Hi David, Thanks for your suggestions. I am not sure how to plot the points by using gene names, but I will give it a try. Thanks, Debs From: David Winsemius dwinsem...@comcast.net Cc: r-help@r-project.org r-help@r-project.org Sent: Tuesday, February

Re: [R] Adding markers and text for some data points after drawing a plot

2013-02-26 Thread David Winsemius
On Feb 26, 2013, at 2:28 PM, Debs Majumdar wrote: Hi David, Thanks for your suggestions. I am not sure how to plot the points by using gene names, but I will give it a try. The x and y arguments would be the same as were used in the text() call. (You are _still_ sending formatted

[R] Could R help with locating coordinates in a serial manner?

2013-02-26 Thread Onur Uncu
Dear R community, My question is not a quick fix one but it would be helpful if you have any advice for me. I have a large data set of many locations in the US and all of these locations are expressed in coordinates (longitudes and latitudes). I need a tool which returns the state that each

Re: [R] Could R help with locating coordinates in a serial manner?

2013-02-26 Thread Ista Zahn
Hi, See http://stackoverflow.com/questions/8751497/latitude-longitude-coordinates-to-state-code-in-r Best, Ista On Tue, Feb 26, 2013 at 5:35 PM, Onur Uncu onuru...@gmail.com wrote: Dear R community, My question is not a quick fix one but it would be helpful if you have any advice for me.

[R] understanding cex (R plots)

2013-02-26 Thread Martin Batholdy
Hi, I try to make multiple plots look as similar as possible. I create each plot with pdf(), using the same height but different width in inch. For some plots I use the layout() function to draw multiple subplots side by side in one pdf. For each plot I use the same cex values for the

[R] Where is JGR's Java source code?

2013-02-26 Thread mlell08
Hello List, I'm trying to get behind the secrets of rJava, especially how to run an R session within a java Programm **and especially how wo inspect objects of an R workspace from within a java program** But as I can't find any documentation on the Java side of rJava, I tried to learn somethin

[R] Multistate occupancy models using Jags

2013-02-26 Thread Francisco Carvalho Diniz
Hi everyone, I am trying to run the example of multistate occupancy model from the book Bayesian Population Analysis using WinBUGS (Marc Kéry and Michael Schaub): This example is available on http://www.vogelwarte.ch/code-for-running-bpa-using-jags.html When I try to run the first line of this

[R] R documentation, how to set a character in bold font within math mode, within eqn or deqn?

2013-02-26 Thread Ehsan Masoudi
Hello all,  I want to set (x_1, x_2, \dots, x_n) in a bold font within R documentation. I wrote \deqn(\bold{x}_1, \bold{x}_2, \ldots, \bold{x}_n), but when Rstudio shows HTML preview of the documentation, x is not bold and \bold{x} is illustrated instead. The other latex math bold producer

[R] sys.frame() and variables from parent frame

2013-02-26 Thread José Miguel Delgado
Dear R-help, I wrote the following lines in order to use a variable from a parent frame in my callM() function. I would like to solve this by only editing the callM(function). When I run this code I obtain a empty list, meaning that eval(ls(),sys.frame(-1)) could not access the variables in

[R] R documentation, how to force Rcmd Rd2pdf to automatically break an overfull line in examples R-like section?

2013-02-26 Thread Ehsan Masoudi
Hi all, My package passed Rcmd check successfully. but in constructed PDF format of R documentation, within the examples section, half of the line (R code) is out of the paper. I also found another CRAN submitted package, ftsa , that suffer from overfulling in a line too, see ftsa Reference

[R] cutreeDynamic error

2013-02-26 Thread Joanna Papakonstantinou
I am having difficulty getting the dynamic tree cut package to work. Given the data table myddtable LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H Blue23 I created a similarity matrix using DAISY and Gower metric and specified Place and Color columns as characters

[R] upgrading r-base

2013-02-26 Thread Dave Mitchell
I'm trying to install R 2.15 on an Ubuntu server. I'm getting the depends but it's not going to be installed error messages I've seen people write about, but never solve. I've attached a screen shot, if that helps. Has anyone seen (and solved) these updating issues? I find it hard to

Re: [R] legend issues.

2013-02-26 Thread Nicole Ford
I thought my reply went to the group last night. i had already resolved it. in short, before his first reply it was resolved... which is why i didn't offer additional information. i was honestly taken aback by his response to me. i don't respond well to vitriol wrapped in attempts to help.

[R] cutreeDynamic error

2013-02-26 Thread Joanna Papakonstantinou
So I realized I had to convert my dd.daisy to a matrix and used: ddmatrix.daisy-as.matrix(dd.daisy) and then I passed that in as the distM: cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize = 2, method = hybrid, distM = ddmatrix.daisy,deepSplit = (ifelse(method==hybrid, 1,

[R] Count function calls

2013-02-26 Thread Simon Zehnder
Dear R-users, I have the following problem: I am running the function 'pvcm' from the 'plm' Panel Data package. Inside this function 'solve' is called and gives for a certain individual data series an exception because of singularity. I would like to know which individual data series causes

[R] Getting the correct factor level as Dunnett control in glht()

2013-02-26 Thread Andrew Koeser
Hello all, I would like to do a Dunnett test in glht(). However, the factor level I want to use as the control is not the first. dunn1-glht(model3, linfct = mcp(Container = Dunnett), alternative = less) The factor container has 8 levels, so it would be nice not to manually enter in all of

Re: [R] cumulative sum by group and under some criteria

2013-02-26 Thread Zjoanna
Hi Arun I noticed that the values of Fmm, Fnn, and other corresponding variables are not correct, for example, for the 4th obs after you run this code, the Fmm is 0.40, but if you use the x, m, y, n in the 4th row to calculate them, the results are not consistent, same for the 5th obs. #check

Re: [R] understanding cex (R plots)

2013-02-26 Thread Greg Snow
Have you queried the value of 'cex' and related parameters at the different time points? The help page for par says that when you set mfcol or mfrow that cex is changed, but I don't know if the layout function also changes those or not. I would start by peppering your code with calls to

Re: [R] understanding cex (R plots)

2013-02-26 Thread Martin Batholdy
thank you! It seems like the problem was the layout-function automatically changing the cex parameter for the subplots. adding par(cex =1) after the layout() call solved it. Now, character expansion levels seem equal across plots. On Feb 27, 2013, at 00:57 , Greg Snow 538...@gmail.com wrote:

Re: [R] R documentation, how to force Rcmd Rd2pdf to automatically break an overfull line in examples R-like section?

2013-02-26 Thread Duncan Murdoch
On 13-02-26 3:32 AM, Ehsan Masoudi wrote: Hi all, My package passed Rcmd check successfully. but in constructed PDF format of R documentation, within the examples section, half of the line (R code) is out of the paper. I also found another CRAN submitted package, ftsa , that suffer from

Re: [R] sys.frame() and variables from parent frame

2013-02-26 Thread David Winsemius
On Feb 26, 2013, at 2:40 AM, José Miguel Delgado wrote: Dear R-help, I wrote the following lines in order to use a variable from a parent frame in my callM() function. I would like to solve this by only editing the callM(function). When I run this code I obtain a empty list, meaning that

[R] temp seems ineffective in SANN (optim)

2013-02-26 Thread Ross Boylan
I am trying to control the behavior of the SANN method in optim (R 2.14.1) via control$temp. In my toy tests it works; in my real use, it doesn't. As far as I can tell my code with different temp values is loaded; I even traced into the function that calls optim and verified temp had the value I

Re: [R] Count function calls

2013-02-26 Thread William Dunlap
This is where - is helpful: N - 0 ; trace(solve, quote(N - N + 1), print=FALSE) Tracing function solve in package base [1] solve lapply(3:0, function(i)solve(diag(i,3), 1:3)) Error in solve.default(diag(i, 3), 1:3) : Lapack routine dgesv: system is exactly singular: U[1,1] =

Re: [R] upgrading r-base

2013-02-26 Thread Rolf Turner
Have you looked at the instructions at the URL which Sarah Goslee drew to the attention of the list on 19 July 2012? There's a special README for Ubuntu to help you get the current version. http://cran.r-project.org/bin/linux/ubuntu/README You probably need to modify your

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Anika Masters
Thanks Arun and David. Another issue I am running into are memory issues when one of the data frames I'm trying to rbind to or merge with are very large. (This is a repetitive problem, as I am trying to merge/rbind thousands of small dataframes into a single very large dataframe.) I'm

[R] Parallelizing Other Apply Functions, e.g. by, the Easy (Wrong?) Way

2013-02-26 Thread ivo welch
Dear R Users---this is more curiosity than a real problem. I am wondering how to add mc* functions for all of R's *apply functions. stackoverflow 3505701 has a nice overview of these functions. roughly, apply ( function to rows and columns of matrix ) lapply ( function to each element of

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread Jeff Newmiller
merge and rbind have very different memory usage profiles. There are some optimizations you can take advantage of if you store all of your small data frames in a list first, and then feed it through sapply (base) or ldply (plyr) to form the large data frame all at once, which can avoid the

Re: [R] cumulative sum by group and under some criteria

2013-02-26 Thread arun
HI, # Pm2-rbeta(1000, 0.2+1, 0.8+3) #obs4  length(Pm2) #[1] 1000 Pn2-rbeta(1000, 0.2, 0.8+4)  length(Pn2) #[1] 1000 Here, you are creating Pm2 or Pn2 from a single observation. In the code, it is creating 1000 values in total from the combination of values from x, m,  Pm2-rbeta(1000,

Re: [R] merging or joining 2 dataframes: merge, rbind.fill, etc.?

2013-02-26 Thread David Kulp
On Feb 26, 2013, at 9:33 PM, Anika Masters anika.mast...@gmail.com wrote: Thanks Arun and David. Another issue I am running into are memory issues when one of the data frames I'm trying to rbind to or merge with are very large. (This is a repetitive problem, as I am trying to merge/rbind

Re: [R] cumulative sum by group and under some criteria

2013-02-26 Thread Zjoanna
HI, # Pm2-rbeta(1000, 0.2+1, 0.8+3) #obs4 length(Pm2) #[1] 1000 Pn2-rbeta(1000, 0.2, 0.8+4) length(Pn2) #[1] 1000 Here, you are creating Pm2 or Pn2 from a single observation. In the code, it is creating 1000 values in total from the combination of values from x, m,

Re: [R] cumulative sum by group and under some criteria

2013-02-26 Thread arun
The values of 'x' an 'm' from res2.  For more information, you can check ?rbeta. I also don't get what you are up to. If you want to create 1000 random samples for each combinations of x, m   lapply(lapply(unique(apply(cbind(res2$x,res2$m),1,paste,collapse=)),function(i)

[R] Bigalgebra and irlba error

2013-02-26 Thread Gavan McGrath
When running irlba on a big.matrix as in the example from the vignette (on Windows R 2.15.2 64 bit) it returns with an error (see below). irlba works fine on a regular R matrix library(bigalgebra) library(irlba) Loading required package: Matrix Loading required package: lattice matmul -

Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Niklas Fischer
Thanks Rui, It is very useful indeed. Bests, Niklas 2013/2/26 Rui Barradas ruipbarra...@sapo.pt Hello, I'm not sure I understand, do you want to treat BCC, CBC and CCB as the same? If so try w2 - apply( y , 1 , function(x) paste0(sort(x) , collapse = )) table(w2) Hope this helps,

Re: [R] Merging value labels into indicator variable.

2013-02-26 Thread PIKAL Petr
Hi can not resist Var001 - (NAM=7 NAM=9)*1 Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Tasnuva Tabassum Sent: Tuesday, February 26, 2013 7:03 PM To: Berend Hasselman Cc: R help Subject: Re: [R] Merging

Re: [R] cutreeDynamic error

2013-02-26 Thread Peter Langfelder
On Tue, Feb 26, 2013 at 8:34 AM, Joanna Papakonstantinou joanna.p...@gmail.com wrote: So I realized I had to convert my dd.daisy to a matrix and used: ddmatrix.daisy-as.matrix(dd.daisy) and then I passed that in as the distM: cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize

[R] metafor - interpretion of QM in mixed-effects model with factor moderator

2013-02-26 Thread Rachel Slatyer
Hi, I'm using metafor to perform a mixed-effects meta-analysis. I'd like to test whether the effect is different for animals and plants/whether group (animal/plant) influences the effect size, but am having trouble interpreting the results I get. I've read previous posts about QM in metafor, but

Re: [R] cumulative sum by group and under some criteria

2013-02-26 Thread arun
res2- join(res1,d3,by=c(m1,n1),type=inner) p0L-0.05 p0H-0.05 p1L-0.20 p1H-0.20   res2- within(res2,{p1- x/m; p2- y/n;term2_p0-dbinom(x1,m1, p0L, log=FALSE)* dbinom(y1,n1,p0H, log=FALSE)*dbinom(x-x1,m-m1, p0L, log=FALSE)* dbinom(y-y1,n-n1,p0H, log=FALSE);term2_p1- dbinom(x1,m1, p1L,