Re: [R] 1st script

2015-03-22 Thread PIKAL Petr
Hi use list and numeric indexing. As you did not provide reproducibe example here is possible way. dat <- data.frame(w=abs(rnorm(10)), LC09=round(runif(10)*10), LC10=round(runif(10)*10)) lll <- vector("list", 2) k=0 for(i in 2:3) { k=k+1 lll[[k]] <- rep(dat$w, dat[,i]) } names(lll)<-names(dat[,

Re: [R] average wind direction calculation

2015-03-22 Thread David Winsemius
> On Mar 22, 2015, at 9:18 PM, Alemu Tadesse wrote: > > Dear All, > > I am wondering if you have an R script or know an R package for an average > wind direction > pkg:circular > Best, > > Alemu > > [[alternative HTML version deleted]] R is a plain text mailing list. — David Winse

[R] average wind direction calculation

2015-03-22 Thread Alemu Tadesse
Dear All, I am wondering if you have an R script or know an R package for an average wind direction Best, Alemu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mai

[R] R Freezes (Mac) using file.choose()

2015-03-22 Thread Vindoggy !
I'm using a mac with OSX Yosemite (10.10.2), running the latest version of R (3.1.3). But I've been having this same issue since Mavericks came out, using all of the different versions of R that have come out since Mavericks. Often (approximately 15% of the time I would say), whenever I use a f

[R] 1st script

2015-03-22 Thread memilanuk
So... wrote my first script, rather than just using the interactive console. I think I got everything working more or less the way I want, but I'm sure there's a ton of room for improvement. Specifically in the way of automation - but thats where I kind of ran out of steam. Any suggestions w

Re: [R] ordering a boxplot

2015-03-22 Thread Antonio Silva
Dear Boris, Thanks very much, have a great week. Best regards Antônio Olinto Fisheries Institute São Paulo, Brasil 2015-03-21 21:09 GMT-03:00 Boris Steipe : > ... just for completeness - the more concise way: (no need to go through > names()). > > boxplot(mydata[,order(apply(mydata,2,median)

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

2015-03-22 Thread David Winsemius
On Mar 22, 2015, at 1:12 PM, Luca Meyer wrote: > Hi Bert, > > Maybe I did not explain myself clearly enough. But let me show you with a > manual example that indeed what I would like to do is feasible. > > The following is also available for download from > https://www.dropbox.com/s/qhmpkkrejjk

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

2015-03-22 Thread Luca Meyer
Hi Bert, Maybe I did not explain myself clearly enough. But let me show you with a manual example that indeed what I would like to do is feasible. The following is also available for download from https://www.dropbox.com/s/qhmpkkrejjkpbkx/sample_code.txt?dl=0 rm(list=ls()) This is usual (an ext

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

2015-03-22 Thread Bert Gunter
Nonsense. You are not telling us something or I have failed to understand something. Consider: v1 = c("a","b") v2 = "c("a","a") It is not possible to change the value of a sum of values corresponding to v2="a" without also changing that for v1, which is not supposed to change according to my und

Re: [R] Why can't I access this type?

2015-03-22 Thread John Kane
Well, first off, you have no variable called "Name". You have lost the state names as they are rownames in the matrix state.x77 and not a variable. Try this. It's ugly and I have no idea why I had to do a cbind() but it seems to work. Personally I find subset easier to read than the indexing ap

Re: [R] My R stopped working

2015-03-22 Thread Jeff Newmiller
You could use a search engine to find other people's solutions to this problem. Or you could just try again. Unfortunately, if you want help here, your explanation is simply too brief. The normal expectation here is that you provide a reproducible example. Since R works by accepting text comman

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

2015-03-22 Thread Luca Meyer
Sorry forgot to keep the rest of the group in the loop - Luca -- Forwarded message -- From: Luca Meyer Date: 2015-03-22 16:27 GMT+01:00 Subject: Re: [R] Joining two datasets - recursive procedure? To: Bert Gunter Hi Bert, That is exactly what I am trying to achieve. Please noti

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

2015-03-22 Thread Luca Meyer
Hi Bert, Thanks again for your assistance. Unfortunately when I apply the additional code you suggest I get B=40.23326 & C=-8.66603 and not B=29 & C=2.56723. Any idea why that might be happening? Please see below or on https://www.dropbox.com/s/qhmpkkrejjkpbkx/sample_code.txt?dl=0 the code I am

Re: [R] My R stopped working

2015-03-22 Thread Bert Gunter
restart R. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Sun, Mar 22, 2015 at 2:11 AM, adeela uaf wrote: > Hi, > I was downloading some shape files in R

Re: [R] Why can't I access this type?

2015-03-22 Thread Bert Gunter
Your data frame contains no column named "Name" . Maybe what you want is rownames(all.states)[all.state$Frost>150] However, what you clearly need to do is stop posting until you have done your homework by spending some time with one of the many good R tutorials that are out there (possibly Intro

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

2015-03-22 Thread Bert Gunter
Oh, wait a minute ... You still want the marginals for the other columns to be as originally? If so, then this is impossible in general as the sum of all the values must be what they were originally and you cannot therefore choose your values for V3 arbitrarily. Or at least, that seems to be wha

[R] Package build help - thanks

2015-03-22 Thread Glenn Schultz
Hello All, I have finally addressed all the cmd issues with my package build "bondlab."  I would like to thank everyone that took the time to answer my questions.  I have the following question:  Currently the package has a non-standard directory/folder structure.  The non-standard folders are

[R] My R stopped working

2015-03-22 Thread adeela uaf
Hi, I was downloading some shape files in R then I use the package lsmeans in R but I received the message "R for winfows GUI front end has stopped working " . What I have to do to overcome this problem [[alternative HTML version deleted]] __ R-

[R] Why can't I access this type?

2015-03-22 Thread Yves S. Garret
Hi, I'm just learning my way around R. I got a bunch of states and would like to access to get all of the ones where it's cold. But when I do the following, I will get the following error: > all.states <- as.data.frame(state.x77) > cold.states <- all.states[all.states$Frost > 150, c("Name", "Fro

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

2015-03-22 Thread Bert Gunter
I would have thought that this is straightforward given my previous email... Just set z to what you want -- e,g, all B values to 29/number of B's, and all C values to 2.567/number of C's (etc. for more categories). A slick but sort of cheat way to do this programmatically -- in the sense that it

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

2015-03-22 Thread Luca Meyer
Hi Bert, hello R-experts, I am close to a solution but I still need one hint w.r.t. the following procedure (available also from https://www.dropbox.com/s/qhmpkkrejjkpbkx/sample_code.txt?dl=0) rm(list=ls()) # this is (an extract of) the INPUT file I have: f1 <- structure(list(v1 = c("A", "A", "A