Re: [R] replacing rows data.frame

2012-10-22 Thread evelyne
thanks a lot. I also found that using "stringsAsFactors=FALSE" helps -- View this message in context: http://r.789695.n4.nabble.com/replacing-rows-data-frame-tp4646731p4646963.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

[R] help stored permanently

2012-10-22 Thread Christian Hoffmann
Hi, Each > help.start() generates a new tree of the R help system, somewhere in 127.0.0.1:xxx, each xxx being difeerent. This tree disappears when exiting R. How can the current help tree copied to a permanent place for reference outside a running R? This would be practical for not having to

Re: [R] append for .Rdata?

2012-10-22 Thread Jessica Streicher
Two issues, one was that i just wanted to do some calculation and then save it without having to load the rest again beforehand and have to delete variables in my working environment so they don't get saved as well. The second was the issue that i'd like to have most of the data in one big file,

[R] Matlab code to R code

2012-10-22 Thread Roslina Zakaria
Dear r-users, I would like to convert my Matlab code to R-code, however it dies not work as expected.  Hope somebody can help me to match Matlab and r codes. R code: rr <- function(r,cxn) { tol <- 1E-4; for(i in 1:n) { t1 <- (1+(i-1)*r)*log((1+(i-1)*r)) t2 <- (i-1)*(1-r)*log(1-r) rri <- ((t1+t

Re: [R] to.yearly()

2012-10-22 Thread R. Michael Weylandt
Please do your work to form a well-posed (context including!) question, like I've asked before. On Monday, October 22, 2012, sheenmaria wrote: > Sir, > This code give the answer but i have a doubt, > i need to retrieve the data of more than one tickers so i used the code > like this > > v=c(

Re: [R] [newbie] failure to plot a RasterLayer with raster::plot or fields::image.plot

2012-10-22 Thread Michael Sumner
With NetCDF I would recommend working on understanding your data in a more native way. Both rgdal and raster put their own take (via ncdf and GDAL respectively) on how the data are to be interpreted. Both are limited in the GIS way of requiring regular grids and a set of 2D layers, rather than mor

Re: [R] Memory issue with svm modeling in R

2012-10-22 Thread Jessica Streicher
Hello Vignesh, we did not get any attachments, maybe you could upload them somewhere? On 19.10.2012, at 09:46, Vignesh Prajapati wrote: > As I found the memory problem with local machine/micro instance(amazon) for > building SVM model in R on large dataset(2,01,478 rows with 11 variables), > the

Re: [R] Assigning values to several consecutives rows in a sequence while leaving some empty

2012-10-22 Thread R. Michael Weylandt
On Monday, October 22, 2012, nymphita wrote: > Hello all, > I'm trying to group several consecutives rows (and assigning them the same > value) while leaving some of the rows empty (when a certain condition is > not > fulfilled). > > My data are locations (xy coordinates), the date/time at which t

Re: [R] help stored permanently

2012-10-22 Thread R. Michael Weylandt
On Monday, October 22, 2012, Christian Hoffmann wrote: > Hi, > > Each > help.start() generates a new tree of the R help system, somewhere > in 127.0.0.1:xxx, each xxx being difeerent. This tree disappears when > exiting R. How can the current help tree copied to a permanent place for > reference o

Re: [R] Setting all rows of a certain level to NA in a factor

2012-10-22 Thread Pancho Mulongeni
Perfect, thanks -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Wednesday, October 17, 2012 9:49 PM To: Pancho Mulongeni Cc: r-help@r-project.org Subject: Re: [R] Setting all rows of a certain level to NA in a factor Hello, Try the following. b <- factor(ife

Re: [R] Assessing overdispersion and using quasi model with lmer, possible?

2012-10-22 Thread swertie
thank you very much -- View this message in context: http://r.789695.n4.nabble.com/Assessing-overdispersion-and-using-quasi-model-with-lmer-possible-tp4646626p4646967.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.o

Re: [R] Matlab code to R code

2012-10-22 Thread Berend Hasselman
On 22-10-2012, at 09:49, Roslina Zakaria wrote: > Dear r-users, > > I would like to convert my Matlab code to R-code, however it dies not work as > expected. Hope somebody can help me to match Matlab and r codes. > > R code: > > rr <- function(r,cxn) > { > tol <- 1E-4; > > for(i in 1:n) > {

Re: [R] Assigning values to several consecutives rows in a sequence while leaving some empty

2012-10-22 Thread Berend Hasselman
On 22-10-2012, at 06:39, nymphita wrote: > Hello all, > I'm trying to group several consecutives rows (and assigning them the same > value) while leaving some of the rows empty (when a certain condition is not > fulfilled). > > My data are locations (xy coordinates), the date/time at which they

Re: [R] Margin annotation

2012-10-22 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Arnold > Sent: Monday, October 22, 2012 4:26 AM > To: r-help@r-project.org > Subject: [R] Margin annotation > > I have this code: > > x=seq(80-3*15,80+3*15,length=200)

Re: [R] Counting duplicates in a dataframe

2012-10-22 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of asafwe > Sent: Monday, October 22, 2012 4:02 AM > To: r-help@r-project.org > Subject: [R] Counting duplicates in a dataframe > > Hello, > > I am looking at a two-way ANOVA d

Re: [R] How to use tapply with more than one variables grouped

2012-10-22 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of noobmin > Sent: Monday, October 22, 2012 2:28 AM > To: r-help@r-project.org > Subject: [R] How to use tapply with more than one variables grouped > > I'm studying alone the R

Re: [R] dynamic panel data estimation

2012-10-22 Thread Jose Iparraguirre
You can run dynamic panel data models with plm -see the package's vignette "Panel Data Econometrics in R: The plm Package" by Yves Croissant and Giovanni Millo (section 5.4) Check Giovanni Petris, Sonia Petrone, Patrizia Campagnoli's monograph "Dynamic Linear Models with R" as well. Hope this he

Re: [R] help stored permanently

2012-10-22 Thread Jim Lemon
On 10/22/2012 06:24 PM, Christian Hoffmann wrote: Hi, Each > help.start() generates a new tree of the R help system, somewhere in 127.0.0.1:xxx, each xxx being difeerent. This tree disappears when exiting R. How can the current help tree copied to a permanent place for reference outside a runnin

[R] 4253H twice implementation

2012-10-22 Thread julio cesar oliveira
Dear All, Anybody know if *4253H twice filter* is implemented in R? *Description of filter:* Applies a series of running medians of varying window size and a weighted average filter, with re-roughing, to the NDVI time series *Reference*: Velleman, P. (1980). Definition and comparison of robust no

Re: [R] 4253H twice implementation

2012-10-22 Thread ONKELINX, Thierry
Have a look at library(sos) findFn("twice filter") ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61

[R] Testing the equality of two variances

2012-10-22 Thread Tammy Ma
Dear R-User, I met the problem to test equality of variance. Two sample units: conjps<-c(9.41,10.45,10.78,10.73,11.11,11.12,11.59,11.04,11.63) ms<-c(4.11,5.10,5.70,6.46,6.04,6.16, 6.24,6.32,7.33) Then I use the F test to test: •Test Equality of Two Variances F test to compare two variance

[R] Represent point size according to frequency

2012-10-22 Thread swertie
Hello! I would like to make a scatterplot of my data, but the problem is that several points have the same x and y values and are represented as only one point. I wonder if there is a way to represent the data points, but with point size representing the frequency of the depicted x-y value? Thank

[R] Package "Design"

2012-10-22 Thread Joost Kremers
Hi all, I'm planning to work through the book "Analyzing Linguistic Data" by R.H. Baayen, which is an introduction to R used for, well, what the title says. ;-) On the first page of the book, Baayen says that in order to work with the book, R needs to download and install a number of packages from

[R] Integrating R into a web application

2012-10-22 Thread benoitg
Hello everyone, I am developing a web application and I would like to perform two kind of statistical/modeling operations. (1) Batch analysis from data stored in the backend of my app (HBase cluster). Typically, this operation needs to be performed on regular basis, say every night. The size of

[R] Egarch (1,1) with Student t distribution using rugarch

2012-10-22 Thread Dheeraj Pandey
Hi I was trying to implement Egarch (1,1) with Student t distribution using rugarch. But I was not getting any value. Following were the commands that I was using: library(rugarch) spec=ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1)), mean.model=list(armaOrder=c(1,1), arfima=FA

[R] Unicode Support

2012-10-22 Thread Sedat Emre Dülger
Hi, I have a problem about the Latin letters in R. I try to get data from facebook to oracle and while R is reading the data, it cannot write some letters like "ü,ş,ğ" etc and just mark as "?". I know these are the Latin letters and R cannot read it but is there any tool or function to convert t

Re: [R] How to use tapply with more than one variables grouped

2012-10-22 Thread noobmin
interTable <-data.frame (Tapply ($ contb_receipt_amt date, list ($ cand_nm date, $ contbr_st date), sum)) I got create a table with the sum total contribution (contb_receipt_amt) of each presidential candidate (cand_nm) in each state (contbr_st). How could from interTable create a table of states

[R] Problem installing ndf library

2012-10-22 Thread claire1234
Hello, I am a new user of R and Linux (debian squeeze), and I am trying to install the ncdf library. First I don't know wich is the best to use (ncdf or ncdf4), But not matter the one I tried to install, it always failled. I try to find a solution to this common problem on the web, but I never fin

[R] Unicode JSON Support

2012-10-22 Thread Sedat Emre Dülger
Hi, Is there any Unicode Support for JSON that helps to read Latin letters? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] conditional value assignment

2012-10-22 Thread penguins
Thanks, that has worked like a dream! -- View this message in context: http://r.789695.n4.nabble.com/conditional-value-assignment-tp4646945p4646988.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list htt

Re: [R] RColorBrewer

2012-10-22 Thread John Kane
This is perilously close to a straightforward homework question which is not usually answwered here but you get brownie points for saying you are a student. Also you did not follow the posting guidelines so we have no idea what are doing, what package(s) you may be using etc. Have a look at

[R] Remove records from a large dataframe

2012-10-22 Thread penguins
Hi, I am trying to remove a series of records from a large dataframe. The script I have written works fine but takes a long time to run. Can anyone suggest a quicker way to do this? Here is an example of the code I've written. The end result of this bit of code would be a dataframe with any record

Re: [R] help stored permanently

2012-10-22 Thread Duncan Murdoch
On 12-10-22 3:24 AM, Christian Hoffmann wrote: Hi, Each > help.start() generates a new tree of the R help system, somewhere in 127.0.0.1:xxx, each xxx being difeerent. This tree disappears when exiting R. How can the current help tree copied to a permanent place for reference outside a running R

[R] Fwd: Navigating a grid.

2012-10-22 Thread Michael Muratet
Sent from my iPhone Begin forwarded message: > From: Michael Muratet > Date: October 21, 2012 12:08:55 PM CDT > To: r-help@r-project.org > Subject: Navigating a grid. > > Greetings > > I am trying to make a multiple panel plot from a tool (genoPlotR) that is > layered on grid. My code and s

Re: [R] Remove records from a large dataframe

2012-10-22 Thread Rui Barradas
Hello, If I understand it well, idx <- !dat$id %in% bad$id dat[idx, ] Also, to create bad you are complicating, this would do: bad <- data.frame(id = c(1,4)) Hope this helps, Rui Barradas Em 22-10-2012 12:04, penguins escreveu: Hi, I am trying to remove a series of records from a large dat

Re: [R] Axis Breaks with ggplot2

2012-10-22 Thread John Kane
Not in ggplot2 as far as I know. As Jim Lemon says the plotrix package should handle this. An alternative that probably gives better data interpretation might be to use facet.grid() or perhaps facet_wrap() in ggplot2. Crude example library(ggplot2) xx <- data.frame(aa = c(10, 12, 15, 55,

Re: [R] Expected number of events, Andersen-Gill model fit via coxph in package survival

2012-10-22 Thread Terry Therneau
Therneau doesn't know the answer either. The predictions are positively correlated since they all depend on the same beta-hat from the original model. The same will be true for any model: logistic, poisson, linear, ... Terry T On 10/20/2012 06:06 PM, Omar De la Cruz C. wrote: I have a follow

Re: [R] Problem installing ndf library

2012-10-22 Thread Prof Brian Ripley
You need to install netcdf, including its development files. The notes you quote are pretty specific about that. Googling for that leads to http://packages.debian.org/source/squeeze/netcdf and it seems you need libnetcdf-dev and libnetcdf6 installed. On 22/10/2012 11:39, claire1234 wrote: H

Re: [R] Package "Design"

2012-10-22 Thread R. Michael Weylandt
Design has been superceeded by rms -- give that a shot. Cheers, Michael On Mon, Oct 22, 2012 at 10:51 AM, Joost Kremers wrote: > Hi all, > > I'm planning to work through the book "Analyzing Linguistic Data" by > R.H. Baayen, which is an introduction to R used for, well, what the > title says. ;-

Re: [R] Testing the equality of two variances

2012-10-22 Thread R. Michael Weylandt
Hi Tammy, I'm afraid this is pretty obviously homework, so we can't really do much to help you. It's not a personal thing: just the considered opinion of this list to believe that giving you answers (or even hefty hints) may undermine whatever intent your teacher has in assigning the problem. Ther

Re: [R] Represent point size according to frequency

2012-10-22 Thread R. Michael Weylandt
I think it's more generally encouraged to "jitter" the points in this circumstance. RMW On Mon, Oct 22, 2012 at 9:34 AM, swertie wrote: > Hello! I would like to make a scatterplot of my data, but the problem is that > several points have the same x and y values and are represented as only one >

Re: [R] Represent point size according to frequency

2012-10-22 Thread Jose Iparraguirre
Shortly ago I did something similar to what you intend to. The data frame was called 'fore'. There were eight different variables and I wanted to plot each one by column, and depict the frequencies in terms of the size of the dots. The problem I ran into is that the plots got extremely big for

[R] What is behind class coercion of a factor into a character

2012-10-22 Thread Tal Galili
Hello all, Please review the following simple code: # make a factor: x <- factor(c("one", "two")) # what should be the output to the following expression? c(x, "3")# <=== # I expected it to be as the output of: c(as.character(x), "3") # But in fact, the output is wh

Re: [R] How to use tapply with more than one variables grouped

2012-10-22 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of noobmin > Sent: Monday, October 22, 2012 12:31 PM > To: r-help@r-project.org > Subject: Re: [R] How to use tapply with more than one variables grouped > > interTable <-data.

Re: [R] What is behind class coercion of a factor into a character

2012-10-22 Thread Bert Gunter
Tal: There was a recent discussion on this list about this (Sam Steingold was the OP IIRC). The issue is ?c . In particular: "c is sometimes used for its side effect of removing attributes except names, for example to turn an array into a vector." Hence, the factor attribute is removed and you

Re: [R] How to use tapply with more than one variables grouped

2012-10-22 Thread Bert Gunter
Inline. On Mon, Oct 22, 2012 at 6:55 AM, PIKAL Petr wrote: > Hi > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of noobmin >> Sent: Monday, October 22, 2012 12:31 PM >> To: r-help@r-project.org >> Subject: Re: [R] How to

Re: [R] How to use tapply with more than one variables grouped

2012-10-22 Thread PIKAL Petr
Hi > -Original Message- > From: Bert Gunter [mailto:gunter.ber...@gene.com] > Sent: Monday, October 22, 2012 4:00 PM > To: PIKAL Petr > Cc: noobmin; r-help@r-project.org > Subject: Re: [R] How to use tapply with more than one variables grouped > > Inline. > > On Mon, Oct 22, 2012 at 6:55

[R] quartz.save of the FAQ (Mac)

2012-10-22 Thread Christian Hoffmann
Hi, In the FAQ for Mac http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html there is 7.2 Saving the image You can can (???) the content of the quartz device window into a PDF file. This is not explained! This is a very simple way to export high quality graphics from R into other applications

[R] creating a function using for if

2012-10-22 Thread Balqis
Hi all, I'm trying to create a function where it can process a vector and also give a vector output accordingly #input: a,b anc c are constants, data is the vector #set the function fun<-function(a,b,c,data) { N=as.vector() for (i in min(data):max(data)){ if(i>c){ N<-(a*(i-c)^0.5)+(b*(i-c))} else

Re: [R] creating a function using for if

2012-10-22 Thread Sarah Goslee
N=as.vector() This doesn't mean anything in R: you can read the help using ?as.vector to see what the required arguments are. Do you want to loop over the elements of data? That's not what your loop is doing. Instead it is looping over each element of the sequence from the min to the max *value*

[R] Help with a R script using grid

2012-10-22 Thread Michael Muratet
Dear Dr. Murrell Sorry to bother you at home, so to speak, but my emails to r-help@r-project.org are falling into the void. I am trying to make a multiple panel plot with 26 rows and 2 columns with plots from a tool (genoPlotR) that is layered on grid. My code and session info are below.

Re: [R] Problem installing ndf library

2012-10-22 Thread claire1234
Thank you very much for your answer; my Gooogleing was not good engouh. Claire -- View this message in context: http://r.789695.n4.nabble.com/Problem-installing-ncdf-library-tp4646986p4647013.html Sent from the R help mailing list archive at Nabble.com. ___

[R] how to group smooth line by two groups?

2012-10-22 Thread autumn
Hello, I have the following sample dataset. sex <- as.factor(c(rep(0,12),rep(1,12))) char <- c("x","x","x","x","y","y","y","y","z","z","z","z","x","x","x","x","y","y","y","y","z","z","z","z") a <- runif(24,0,2) b <- runif(24,4,10) data <- data.frame(cbind(sex,char,a,b)) I would like to generate a

Re: [R] Trouble returning 2D array into R from Fortran

2012-10-22 Thread paulfjbrowne
I haven't determined the root cause of the numerical accuracy bug yet (I haven't determined a way to compare the values used when the code is run from R as opposed to from a Fortran test), but I did have another issue with retrieving the matrix from the Fortran code that I hoped you might be able t

[R] Friedman with post Hoc

2012-10-22 Thread pedro amarante
Hello everyone, I have been trying to perform a Friedman test for a while with no success. I have tried the command: > friedman.test (y~A|B, data = mydata), but it doesn't work . I searched youtube for help, but still could not find much. Can anyone help me with that! Thank you very much, Pedro

Re: [R] vectors comparison

2012-10-22 Thread Francesco Nutini
Dear Simon & R-Users.I have applied your solution also for larger buffer window,and it's working well. But I'm getting the problem harder.I have two vectors: x<- c(0,0,0,0,1,0,0,0,0,1,0,0,0) y<- c(0,-10,0,-10,0,0,0,0,-10,0,0,0,0) And I want to know where the value -1 in x have at least 2 values

Re: [R] Package "Design"

2012-10-22 Thread Joost Kremers
On Mon, Oct 22 2012, R. Michael Weylandt wrote: > Design has been superceeded by rms -- give that a shot. I know, but it doesn't look like it's a dorp-in replacement for Design, so I suspect the code in the book won't work with it... Joost > On Mon, Oct 22, 2012 at 10:51 AM, Joost Kremers >

[R] Any good R server-with connection examples

2012-10-22 Thread sagarnikam123
I want to connect R with HTML/PHP pages to take input from user,do some statistical processing on it & show results to HTML page again. I search on net,i got Rserve package,but examples are mainly for java langaure & not for PHP i am wondering how to connect it to PHP-Apache-MySQL Is there any g

Re: [R] Remove records from a large dataframe

2012-10-22 Thread arun
Hi, You can also use ?merge() dat$ind_dat<-TRUE bad$ind_bad<-TRUE res<-merge(dat,bad,all=TRUE)  res1<-res[is.na(res$ind_bad),][,1:3]  res1 #   id year   age #5   2    2 Adult #6   2    2  #7   2    3  #8   2    2  #9   2    2 Adult #10  3    2  #11  3    3 Adult #12  3    4  A.K. - Ori

Re: [R] Counting duplicates in a dataframe

2012-10-22 Thread arun
Hi, try this: dat1<-read.table(text=" Observation Gender Dosage Alertness 1    1  m  a    8 2    2  m  a    12 3    3  m  a    13 4    4  m  a    12 5    5  m  b    6 6    6  m  b

Re: [R] Represent point size according to frequency

2012-10-22 Thread swertie
Thank you very much. I managed to do it with a similar approach and it looks like what I expected. -- View this message in context: http://r.789695.n4.nabble.com/Represent-point-size-according-to-frequency-tp4646976p4647022.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Represent point size according to frequency

2012-10-22 Thread swertie
Thank you for your comment. I would be very interested, but I did not know about jitter. Would you have a small example? -- View this message in context: http://r.789695.n4.nabble.com/Represent-point-size-according-to-frequency-tp4646976p4647023.html Sent from the R help mailing list archive a

Re: [R] Help with programming a tricky algorithm

2012-10-22 Thread Andrew Crane-Droesch
Rui, Thanks a lot for your help. Unfortunately this doesn't work though: 1> is.border <- function(idx, DF){ 1+ i1 <- DF$ix %in% (DF$ix[idx] + c(-1, 1)) & DF$iy == DF$iy[idx] 1+ i2 <- DF$iy %in% (DF$iy[idx] + c(-1, 1)) & DF$ix == DF$ix[idx] 1+ any(DF$country[idx] != DF$country[i1 | i

Re: [R] quartz.save of the FAQ (Mac)

2012-10-22 Thread Prof Brian Ripley
Please stop posting Mac-specific questions on R-help. You have been asked not to do so before There _is_ a quartz.save() function in R.app, whose FAQ you are reading. The RMacOSX-FAQ is not part of R: it is part of the separate Mac-GUI project. You really do need to contact the authors

[R] "Vars" package: impulse response function

2012-10-22 Thread Maria Grigoryeva
Hello, I'm using VAR models in R in order to obtain impulse responses of stock market shock on US economy. I have series of quarterly changes in real gdp, S&P 500 and quarterly level of unemployment for 1985 - 2012 period. My series are stationary. So I did all the steps below. However I don't und

Re: [R] creating a function using for if

2012-10-22 Thread Balqis
thank you. yes I want to loop over the elements of the data. I want the output to be corresponded to the input by unchanging index. at the same time, the data that is more than c value should follow the function (a*(data-c)^0.5)+(b*(data-c), and the rest (same or less than c) should return a zero.

Re: [R] Help with programming a tricky algorithm

2012-10-22 Thread Rui Barradas
Hello, In your original post, there was a column named 'country', it now seems to be 'name', therefore my function shouldn't work. To see the output of head(9 is helpfull but the better way is dput(). Try the following: exmpl <- sub[, c("name", "idxy", "ix", iy")] dput( head(exmpl, 30) ) # p

[R] Navigating a grid: update

2012-10-22 Thread Michael Muratet
Greetings I went back over the examples in the R Graphics book on the grid webpage and saw an example which I have adapted and seems to work: pushViewport(viewport(layout=grid.layout(nrow=26,ncol=2))) pushViewport(viewport(layout.pos.col=1,layout.pos.row=1)) plot_gene_map(dna_segs=list(segs[

[R] bitwise XOR of Matrix

2012-10-22 Thread shahab
Hi, I would like to xor (bitwise) two matrices filled with binary values (0,1). The result of such XOR is expected to be 0,1. But apparently neither of xor nor bitXor is working in this case. I got ": binary operation on non-conformable arrays" error message when I used xor (M1,M2) . The proble

Re: [R] how to group smooth line by two groups?

2012-10-22 Thread Rui Barradas
Hello, I'm not the greatest expert in ggplto2 but you're overcomplicating (if the word exists). 1. In a black&white plot don't use argument color nor scale_color_manual(). 2. your second plot object, p0, is completely unnecessary. 3. if you want it to look like the graph in the link, it's geom

Re: [R] Help with programming a tricky algorithm

2012-10-22 Thread Andrew Crane-Droesch
Hi Rui, Thanks for the quick reply! It was my mistake not to notice $country in thr fourth line of your code. I went back and changed it to $name, and got the following output when I mapped the borders: http://i.imgur.com/DQ3IB.png Here is the output of your function: 1> exmpl <- sub[, c(

Re: [R] bitwise XOR of Matrix

2012-10-22 Thread Rui Barradas
Hello, Your error message means that the arrays have different dim attributes. check with dim(M1) == dim(M2) They must be the same. If they are, the result is not 0/1 but FALSE/TRUE, which you can treat as or coerce to integer. Hope this helps, Rui Barradas Em 22-10-2012 16:44, shahab esc

Re: [R] Represent point size according to frequency

2012-10-22 Thread R. Michael Weylandt
example(jitter) library('ggplot2') example(geom_jitter) RMW On Monday, October 22, 2012, swertie wrote: > Thank you for your comment. I would be very interested, but I did not know > about jitter. Would you have a small example? > > > > > -- > View this message in context: > http://r.789695.n4.n

Re: [R] creating a function using for if

2012-10-22 Thread jim holtman
Try this -- this uses the vectorization which you need to read up on in the Intro to R: > #set the function > fun<-function(a,b,c,data) + { + N <- numeric(length(data)) # initialize to zero + indx <- data > c # determine which data is greater than c + N[indx] <- (a * (data[indx] - c) ^ 0.5) + (b

Re: [R] creating a function using for if

2012-10-22 Thread Sarah Goslee
Then what about: fun<-function(a,b,c,data) { ifelse(data > c, (a*(data-c)^0.5)+(b*(data-c)), 0) } y=c(100,210,320,130,170,120,220,90,55,45) fun(1,0.2,150,data=y) > fun(1,0.2,150,data=y) [1] 0.00 77471.67 130418.05 0.00 44725.36 0.00 83680.00 [8] 0.00 0

Re: [R] Trouble returning 2D array into R from Fortran

2012-10-22 Thread Berend Hasselman
Your attachments did not make it through to the official R-help mailing list. Nabble R is not R-help. I downloaded the files from the links to Nabble. See further down for my comments. On 22-10-2012, at 14:24, paulfjbrowne wrote: > I haven't determined the root cause of the numerical accuracy bu

Re: [R] Package "Design"

2012-10-22 Thread Frank Harrell
Incorrect. The code is 90% compatible. Look at http://biostat.mc.vanderbilt.edu/Rrms for differences. Frank Joost Kremers wrote > On Mon, Oct 22 2012, R. Michael Weylandt < > michael.weylandt@ > > wrote: >> Design has been superceeded by rms -- give that a shot. > > I know, but it doesn't l

Re: [R] Any good R server-with connection examples

2012-10-22 Thread Gergely Daróczi
On Mon, Oct 22, 2012 at 3:35 PM, sagarnikam123 wrote: > I want to connect R with HTML/PHP pages to take input from user,do some > statistical processing on it & show results to HTML page again. > I search on net,i got Rserve package,but examples are mainly for java > langaure & not for PHP > i

Re: [R] Friedman with post Hoc

2012-10-22 Thread arun
HI, Have u tried the example in the link (http://stat.ethz.ch/R-manual/R-patched/library/stats/html/friedman.test.html). It is working for me. wb <- aggregate(warpbreaks$breaks, by = list(w = warpbreaks$wool, t = warpbreaks$tension), FUN = mean) friedman.test(x ~ w | t, data = wb) # Fried

Re: [R] What is behind class coercion of a factor into a character

2012-10-22 Thread Rolf Turner
WARNING: Use with caution! There is a way to effect the catenation of factors: The data.frame method for rbind() does this. E.g. set.seed(42) f1 <- factor(sample(letters[1:3],42,TRUE)) f2 <- factor(sample(letters[1:4],66,TRUE)) d1 <- data.frame(f=f1) d2 <- data.frame(f=f2) dd <- rbind(d1,d2)

Re: [R] grid(Base): How to avoid "Figure region too small and/or viewport too large" by specifying 'relative' units?

2012-10-22 Thread Paul Murrell
Hi Apologies for the slow response. This part of the problem is I think just a bit of a misunderstanding. The diagram drawn by grid.show.viewport() is drawn within a *subset* of the current page (or viewport), to allow room for labelling, which is why your subsequent "real" viewports do not a

Re: [R] Remove records from a large dataframe

2012-10-22 Thread penguins
Thanks Rui, your solution works great and is so fast! -- View this message in context: http://r.789695.n4.nabble.com/Remove-records-from-a-large-dataframe-tp4646990p4647029.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pro

Re: [R] Counting duplicates in a dataframe

2012-10-22 Thread arun
HI, Another way: dat1<-read.table(text=" Observation Gender Dosage Alertness 1    1  m  a    8 2    2  m  a    12 3    3  m  a    13 4    4  m  a    12 5    5  m  b    6 6    6  m  b 

[R] exporting plm results to latex with texreg

2012-10-22 Thread Ignacio de castro
Hi there, I am exporting plm results (from the plm package) to Latex using the texreg function (from the texreg package). How can I force the exported results to appear in scientific format? __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] Help with applying a function to all possible 2x2 submatrices

2012-10-22 Thread CMB123
Hi all, I'm working with a large data set (on the order of 300X300) and trying to apply a function which compares the elements of all possible 2x2 submatrices. There are rc(r-1)(c-1) such submatrices, so obviously the naive method of looping through the rows and columns is computationally unfeasib

Re: [R] Friedman with post Hoc

2012-10-22 Thread Rui Barradas
Hello, Another usefull link is http://www.r-statistics.com/2010/02/post-hoc-analysis-for-friedmans-test-r-code/ Hope this helps, Rui Barradas Em 22-10-2012 20:18, arun escreveu: HI, Have u tried the example in the link (http://stat.ethz.ch/R-manual/R-patched/library/stats/html/friedman.test.

Re: [R] Represent point size according to frequency

2012-10-22 Thread swertie
thank you, that looks good -- View this message in context: http://r.789695.n4.nabble.com/Represent-point-size-according-to-frequency-tp4646976p4647049.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Help me please to code....

2012-10-22 Thread Rlotus
thank you so much for helping! Now i got how to do it ;) -- View this message in context: http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932p4647050.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

[R] Help plz to fix it

2012-10-22 Thread Rlotus
I have an array of probabilitiesit is p. So if user types x=1 then probability is p1=1/10. If user types x=2 it means that p2= p1+p2 if user types x=3 it means that p3=p1+p2+p3and so on. So i created a code. but it doesnt work properly. Help me plz to fix it) Thank u in advance. psidp

Re: [R] Egarch (1,1) with Student t distribution using rugarch

2012-10-22 Thread Patrick Burns
Dheeraj, You need to give us some more hints of what you get and what you don't get. My guess is that what has happened is that the optimization algorithm didn't converge. The R-sig-finance mailing list would be a more appropriate place for this discussion (you have to subscribe before you can

Re: [R] Help with applying a function to all possible 2x2 submatrices

2012-10-22 Thread Sarah Goslee
300x300 isn't terribly large; looping should work just fine. But I'm confused about a 2x2 submatrix: I would have thought that a submatrix would be adjacent elements, like x[1:2, 1:2] or x[13:14, 296:297] but your loop compares all possible sets of four elements, so the matrix position doesn't matt

Re: [R] Help plz to fix it

2012-10-22 Thread Sarah Goslee
This looks like homework to me. Here's a hint, though: p<-(1/10 2/5 2/5 2/5 2/5 1/10 1/10 1/10 1/10 1/10) This is not how you create a vector in R. for (i in 1 to x) This is not how you create a for loop in R. Sarah On Mon, Oct 22, 2012 at 2:41 PM, Rlotus wrote: > I have an array of probabil

Re: [R] Help with applying a function to all possible 2x2 submatrices

2012-10-22 Thread Rui Barradas
Hello, If your matrix is in the order of 300x300, the problem of extracting all possible submatrices and applying a function will allways be a large one, but the use of ?combn may reduce it a bit if the order of rows/columns in the submatrices doesn't matter. It can reduce it from 300^4 = 8.1

Re: [R] Help plz to fix it

2012-10-22 Thread Rui Barradas
Hello, Try ?cumsum. cumsum(p) Hope this helps, Rui Barradas Em 22-10-2012 19:41, Rlotus escreveu: I have an array of probabilitiesit is p. So if user types x=1 then probability is p1=1/10. If user types x=2 it means that p2= p1+p2 if user types x=3 it means that p3=p1+p2+p3and so on.

Re: [R] plot.new() and grid functions in multipage pdfs

2012-10-22 Thread ilai
On Fri, Oct 19, 2012 at 6:28 PM, Ali Tofigh wrote: > On Wed, Oct 17, 2012 at 4:08 PM, ilai wrote: > > On Wed, Oct 17, 2012 at 11:10 AM, Ali Tofigh > wrote: > > ## this works as intended with a mix of plot.new() and grid.newpage > pdf("test3.pdf") > plot.new(); my.plot(); grid.newpage(); my.plot

Re: [R] Margin annotation

2012-10-22 Thread David Winsemius
On Oct 22, 2012, at 1:51 AM, PIKAL Petr wrote: > Hi > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of David Arnold >> Sent: Monday, October 22, 2012 4:26 AM >> To: r-help@r-project.org >> Subject: [R] Margin annotation >>

Re: [R] Counting duplicates in a dataframe

2012-10-22 Thread David Winsemius
On Oct 22, 2012, at 7:48 AM, arun wrote: > HI, > Another way: > dat1<-read.table(text=" > Observation Gender Dosage Alertness > 11 m a8 > 22 m a12 > 33 m a13 > 44 m a12 > 5

Re: [R] grid(Base): How to avoid "Figure region too small and/or viewport too large" by specifying 'relative' units?

2012-10-22 Thread Marius Hofert
Dear Paul, Thank you very much for helping, works perfectly fine. I now see the scaling when looking at grid.show.layout(), but I would have never come up with looking there in the first place :-) Cheers, Marius Paul Murrell writes: > Hi > > Apologies for the slow response. > > This part o

Re: [R] Help plz to fix it

2012-10-22 Thread djbanana
I think this is what you want. p <- c(1/10, 2/5, 2/5, 2/5, 2/5, 1/10, 1/10, 1/10, 1/10, 1/10) psidp <- function(x){ if (x>0&&x<=10) { return(sum(p[1:x])) } else{ return("Input integer between 1 and 10") }} -- View this message in context: http://r.789695.n4.nabble.com/Help-plz-to-fix-it-tp4647

[R] BiodiversityR GUI error message

2012-10-22 Thread Vinicius Campos
Dear Gabor You got solution for your problem? "I have just got a laptop with win 7 64 bit installed on it. I installed R and quite a few packages I use. When I try to start BiodiversityR the library loads without any problems but when starting the GUI it gives me the following error message: So

  1   2   >