Re: [R] Joining two datasets - recursive procedure?

2015-03-18 Thread Jeff Newmiller
I don't understand your description. The standard practice on this list is to provide a reproducible R example [1] of the kind of data you are working with (and any code you have tried) to go along with your description. In this case, that would be two dputs of your input data frames and a dput

Re: [R] Trouble Clearing Environment

2015-03-18 Thread Chad Danyluck
Thanks for pointing me in the right direction. Best, Chad On Wed, Mar 18, 2015 at 6:00 PM, Duncan Murdoch wrote: > You seem to be talking about something in the RStudio front end, not in > R, which means you're writing to the wrong place. They have their own > support forums. > > Duncan Murdo

Re: [R] Help with error: arguments imply differing number of rows

2015-03-18 Thread MacQueen, Don
If this error had happened to me, then immediately after receiving that error I would type traceback() at the R prompt. Hopefully, that will provide some information about what happened. Based on: Error in data.frame(PD = PDs, SR = SR) : arguments imply differing number of rows: 34, 35 It a

Re: [R] Trouble Clearing Environment

2015-03-18 Thread Duncan Murdoch
You seem to be talking about something in the RStudio front end, not in R, which means you're writing to the wrong place. They have their own support forums. Duncan Murdoch On 18/03/2015 4:59 PM, Chad Danyluck wrote: > I use R Studio (Version 0.98.994 on Mac) and R version 3.1.1 (2014-07-10). >

[R] Using lapply on term document matrix to calculate word frequency

2015-03-18 Thread Nikhil Goyal
Given three TermDocumentMatrix, text1, text2 and text3, I'd like to calculate word frequency for each of them into a data frame and rbind all the data frames. Three are sample - I have hundreds in reality so I need to functionalize this. It's easy to calculate word freq for one TDM: apply(x,

Re: [R] density plot not smooth

2015-03-18 Thread Fix Ace
Thank you very much! I do need to learn more about R!! On Tuesday, March 17, 2015 9:26 PM, William Dunlap wrote: Fix Ace wrote    What is the default "n"? 512:   > length(density(rnorm(10^6))$x)   [1] 512   > args(density.default)    function (x, bw = "nrd0", adjust = 1, kernel = c(

[R] Trouble Clearing Environment

2015-03-18 Thread Chad Danyluck
I use R Studio (Version 0.98.994 on Mac) and R version 3.1.1 (2014-07-10). I find that whenever I clear my environment the environment does not completely clear, even when I check "Include Hidden Objects (the environment appears cleared, but I can rerun a section of my syntax and, for example print

Re: [R] Help with error: arguments imply differing number of rows

2015-03-18 Thread Aman Gill
I did notice those differences, but I presumed they reflected different values in each of the two objects, rather than a difference in the structure of the objects, which I assume to be the cause of the error. For example, the "tip.label" structure for each object is the same [1:9] although each ha

Re: [R] summary.formula()

2015-03-18 Thread Tom Wright
First you need to make the data pbc available, perhaps by: data(pbc, package="survival") Then the line: sf2<-summary(... looks wrong, usually you would use the summary() function to look at the output from a function, seems to me you are missing the function here. I have no idea what this functi

Re: [R] reading multiple text files from web

2015-03-18 Thread Tom Wright
I think you need to use a loop to iterate through each of the items in getlinks for(link in getlinks) { url<-paste0('http://spec.org/jEnterprise2010/results/',link) output<-readfiles(url) } You're probably also going to need to add some error handling when your sea

Re: [R] r help

2015-03-18 Thread John Kane
I don't think there is any way we can help with a data set that appears to be sitting on your hard drive. On a wild guess, however, there probaby is a problem with the final line terminator. Open the file in a text editor, go to the last item in the file, place the cursor after it, hit return

Re: [R] r help

2015-03-18 Thread jim holtman
Works fine for me. The error message just means that the last line did not end with a 'new line' character: > x <- as.matrix(read.table("/temp/td.txt")) Warning message: In read.table("/temp/td.txt") : incomplete final line found by readTableHeader on '/temp/td.txt' > data<-list(N1=2000,N2=2

Re: [R] lqs function for S-estimator

2015-03-18 Thread Prof Brian Ripley
On 18/03/2015 15:38, peter dalgaard wrote: On 18 Mar 2015, at 15:11 , Annalisa Orenti wrote: Dear R-Users, I need to fit a regression by means of S-estimator, but I found an inconsistency in lqs function in MASS package. When recalling coefficient estimates two discordant answers are obtained

[R] r help

2015-03-18 Thread thanoon younis
Dear all members I have error with the following code #Input data set thd <- as.matrix(read.table("C:/Users/hp/Desktop/thd.txt")) #Input data set data<-list(N1=2000,N2=2000,P=9,R=Ro,z1=yo1,z2=yo2,thd) and the the matrix -200.000 -2.517 -1.245 -0.444 0.848 200.000 -200.000 -1.447

[R] Joining two datasets - recursive procedure?

2015-03-18 Thread Luca Meyer
Thanks for you input Michael, The continuous variable I have measures quantities (down to the 3rd decimal level) so unfortunately are not frequencies. Any more specific suggestions on how that could be tackled? Thanks & kind regards, Luca === Michael Friendly wrote: I'm not sure I understand

Re: [R] lqs function for S-estimator

2015-03-18 Thread peter dalgaard
On 18 Mar 2015, at 15:11 , Annalisa Orenti wrote: > Dear R-Users, > I need to fit a regression by means of S-estimator, but I found an > inconsistency in lqs function in MASS package. > When recalling coefficient estimates two discordant answers are obtained by > coef() function and by $coef o

[R] lqs function for S-estimator

2015-03-18 Thread Annalisa Orenti
Dear R-Users, I need to fit a regression by means of S-estimator, but I found an inconsistency in lqs function in MASS package. When recalling coefficient estimates two discordant answers are obtained by coef() function and by $coef object: As an example I report here the results of fitting regre

Re: [R] An easy question on package building/installation

2015-03-18 Thread Jeff Newmiller
You appear to be entering that command at the R prompt when it is intended to be entered at the operating system command line. There is a whole document "Writing R Extensions" that you really should be reading no matter what IDE you are using. Also, details of using RStudio are off topic here,

Re: [R] Segmented (piecewise linear) regression/cointegration

2015-03-18 Thread Vito M. R. Muggeo
dear jpm, segmented can't deal with I(1) regression.. However the segmented default method could be used on objects fitted by any function which fits I(1) *linear* regression, Please contact me off list for details, best, vito Il 18/03/2015 2.16, jpm miao ha scritto: Hi, If the relati

Re: [R] Joining two datasets - recursive procedure?

2015-03-18 Thread Michael Friendly
I'm not sure I understand completely what you want to do, but if the data were frequencies, it sounds like task for fitting a loglinear model with the model formula ~ V1*V2 + V3 On 3/18/2015 2:17 AM, Luca Meyer wrote: Hello, I am facing a quite challenging task (at least to me) and I was won

[R] Bayesian course + GLMM course

2015-03-18 Thread Highland Statistics Ltd
Apologies for cross-posting There are a few remaining seats on the following two (combined) courses: Course 1 (3 days): Introduction to Bayesian statistics and MCMC When: 8-10 April 2015 Where: University of Southampton, Southampton, UK Course flyer: http://www.highstat.com/Courses/Flyer2015_0

Re: [R] density plot not smooth

2015-03-18 Thread S Ellison
> I have a dataset with 6187 elements, ranged from 3 to 104028. When I tried to > examine only small range of data, I found that the plot was not smooth (as > shown below): > plot(density(test$V2), xlim=c(0,1000)) > > >  Is there away to make it smoother? For small ranges, use 'from' and 'to' i

Re: [R] ggplot2 recycle color palette

2015-03-18 Thread Jim Lemon
Hi Glenn, An easy way is to replicate the colors to the correct length yourself. If the number of variables is "nvar", then newPalette<-rep(cbbPalette,length.out=nvar) Jim On Wed, Mar 18, 2015 at 12:07 PM, Glenn Schultz wrote: > Hello All, > > I have a custom color palette as illustrated below

Re: [R] Using split.screen with a definition matrix of the screens seems to be a mess. I don't understand!

2015-03-18 Thread Jim Lemon
Hi Sergio, In order to get this configuration you will have to do multiple splits. Try this to see how you get what you want, and notice that screens 2 and 4 are now unusable as they have been split to make more screens. split.screen(figs=matrix(c(0,1,0.91,1,0,1,0,0.91),nrow=2,byrow=TRUE)) split.s

[R] Identification of QRS complex from ECG data

2015-03-18 Thread Abhinaba Roy
Hi R helpers, I was going through some documents, which explains a few algorithms (e.g., Pan Tomkins algo) for identification of QRS complex and how it is implemented in R. Also the logic used is not very clear. Could you please provide me with an R code to identify the QRS complex? Any help is

[R] An easy question on package building/installation

2015-03-18 Thread jpm miao
Hi, I try to build a package myself on RStudio. The command "package.skeleton" is successfully run, but the command "build" is not. In my case, the username and the package name are both "abcd". Error message: > R CMD build abcd Error: unexpected symbol in "R CMD" > Could someone he