Re: [R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task

2014-11-18 Thread Aditya Singh
Eva and Professor Peng, I spent many hours on Programming Assignment 1, however I was unable to get it right. I found it most useful and think others should work at it too! Please do send me your work now that the deadline is over. Or you could tell me your Github account so that I could fork i

Re: [R] Rose Diagrams for Geology

2014-11-18 Thread David Doyle
Thank you to David and David for their help. The code below generated what I needed. library(circular) mydata <- read.table("http://doylesdartden.com/R/Joints.csv";, header=TRUE, sep=",",) x <- circular(mydata$JointsRad) rose.diag(x, #Set point character to use pch = 20,

[R] reading data using XTS package

2014-11-18 Thread Upananda Pani
Dear All, I want to read the my time series data using XTS package and then to calculate return using PeformanceAnalytics Package but i am getting the following error. Please help me to solve the problem. The error follows: # Required Libraries > library(xts) > library(PerformanceAnalytics) > >

Re: [R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task

2014-11-18 Thread David Winsemius
This is not the help forum for Coursera classes. -- David. On Nov 18, 2014, at 1:33 PM, Евгения-Лиза Шелюхина wrote: > Dear R experts, > > I've submited correctly "pollutionmean" and "complete" tasks, but "corr" > returns error, despite the beginning of the result is the same as example > ou

[R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task

2014-11-18 Thread Евгения-Лиза Шелюхина
Dear R experts, I've submited correctly "pollutionmean" and "complete" tasks, but "corr" returns error, despite the beginning of the result is the same as example output. (screenshot attached) May be I understood the task wrongly; file of my function is attached, and it does following: 1) sets d

Re: [R] Rose Diagrams for Geology

2014-11-18 Thread David Winsemius
On Nov 18, 2014, at 1:42 PM, David Doyle wrote: > Hello everyone, > > In geology we often do rose diagrams showing the number of features along a > certain compass direction within a given range (bin) of angle (0-180 > degrees). I was wondering if anybody has had experience with this in R and >

Re: [R] Rose Diagrams for Geology

2014-11-18 Thread David L Carlson
Look at circular more carefully. It accepts both degrees and radians, but you have to create a circular object with circular() to specify what kind of circular data you have. Then you can plot and get circular statistics on your data. - David L Carlson Depart

[R] Rose Diagrams for Geology

2014-11-18 Thread David Doyle
Hello everyone, In geology we often do rose diagrams showing the number of features along a certain compass direction within a given range (bin) of angle (0-180 degrees). I was wondering if anybody has had experience with this in R and if they could recommend a package. I looked at the circular

Re: [R] duplicated function

2014-11-18 Thread Martin Maechler
> Duncan Murdoch > on Tue, 18 Nov 2014 10:40:16 -0500 writes: > On 18/11/2014 10:23 AM, Dennis Fisher wrote: >> R 3.1.1 >> OS X >> >> Colleagues >> >> When I use the duplicated function, I often need to find both the duplicates and the original element t

[R] HELP OUT

2014-11-18 Thread Eshema Imaledo
Dear Sir/Ma, I am a young forest biometrician that adopted the method that consider how correlation within plot and between stand can be handled. Actually i am working on modelling height-diameter relationship under different canopy layer using mixed model approach. METHODOLOGY: > Height and dia

[R] Random Forest - Strata and sampsize and replace

2014-11-18 Thread Lopez, Dan
Hello R Experts, I want to make sure I understand how the strata, sampsize and replace parameters work so I can confidently perform downsampling on a dataset I'm working with. My main question is when the documentation talks about how each of these parameters (strata, sampsize, replace) works

[R] FW: Random Forest - Strata and sampsize and replace

2014-11-18 Thread Lopez, Dan
Hello R Experts, I want to make sure I understand how the strata, sampsize and replace parameters work so I can confidently perform downsampling on a dataset I'm working with. My main question is when the documentation talks about how each of these parameters (strata, sampsize, replace) works

Re: [R] duplicated function

2014-11-18 Thread Duncan Murdoch
On 18/11/2014 11:22 AM, John Laing wrote: That seems straightforward enough: > x <- c(7, 7, 7, 2, 3, 2) > match(x, x) [1] 1 1 1 4 5 4 > ifelse(duplicated(x), match(x, x), 0) [1] 0 1 1 0 0 4 Nice solution! Thanks. Duncan Murdoch On Tue, Nov 18, 2014 at 10:40 AM, Duncan Murdoch wrote: > On 1

Re: [R] duplicated function

2014-11-18 Thread John Laing
That seems straightforward enough: > x <- c(7, 7, 7, 2, 3, 2) > match(x, x) [1] 1 1 1 4 5 4 > ifelse(duplicated(x), match(x, x), 0) [1] 0 1 1 0 0 4 On Tue, Nov 18, 2014 at 10:40 AM, Duncan Murdoch wrote: > On 18/11/2014 10:23 AM, Dennis Fisher wrote: >> >> R 3.1.1 >> OS X >> >> Colleagues >> >> W

[R] LAT/LON to UTM in R

2014-11-18 Thread Zilefac Elvis
Hi, I am trying to convert lat/lon to UTM but my results are extremely flawed. Is it because of wrong UTM zone or my lon points are negative? I read a shapefile from ESRI using: library(rgdal) stations <- readOGR(".","stations") print(proj4string(stations)) ## +proj=longlat +ellps=WGS84 +datum=WG

Re: [R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
[Picture of a hand slapping forehead] I suspected it to be something either dumb or obvious, and managed both. This library plugs into the tail of a long developement project for a web API, which had prior documentation, which I stuck in "doc". And then added to .Rbuildignore. Thanks Hadley

Re: [R] duplicated function

2014-11-18 Thread Duncan Murdoch
On 18/11/2014 10:23 AM, Dennis Fisher wrote: R 3.1.1 OS X Colleagues When I use the duplicated function, I often need to find both the duplicates and the original element that was duplicated. This can be accomplished with: duplicated(OBJECT) | duplicated(OBJECT, fromLast=TRUE) From

Re: [R] Implements XPath 2.0 in R

2014-11-18 Thread Hadley Wickham
Why do you need from xpath 2.0? It will almost certainly be easier to implement similar functionality using a little R code than adding xpath 2.0 support. Hadley On Mon, Nov 17, 2014 at 6:03 AM, Rees Morrison wrote: > Many users of R would like the enhanced extraction capabilities of XPath > 2.

[R] duplicated function

2014-11-18 Thread Dennis Fisher
R 3.1.1 OS X Colleagues When I use the duplicated function, I often need to find both the duplicates and the original element that was duplicated. This can be accomplished with: duplicated(OBJECT) | duplicated(OBJECT, fromLast=TRUE) >From my perspective, an improvement in the duplicate

Re: [R] CMD check error

2014-11-18 Thread Hadley Wickham
Do you have a .Rbuildignore? If so, what's in it? Hadley On Tue, Nov 18, 2014 at 7:07 AM, Therneau, Terry M., Ph.D. wrote: > I have a new package (local use only). R CMD check fails with a messge I > haven't seen before, and I haven't been able to guess the cause. > There are two vignettes, bot

Re: [R] Help for x axis

2014-11-18 Thread David L Carlson
This should get you started: > aggData <- aggregate(age~smoke+gender, sampleData, mean) > aggData smoke gender age 1 0 0 39.47231 2 1 0 40.09020 3 0 1 39.59814 4 1 1 42.04092 > plotInfo <- barplot(aggData$age) > axis(1, c(0, plotInfo), c("Gender", "-", "-

Re: [R] Help for x axis

2014-11-18 Thread David L Carlson
Try these: aggData <- aggregate(age~smoke+gender, sampleData, function(x) c(mean=mean(x), stderr=sd(x)/sqrt(length(x aggData plotInfo <- barplot(aggData$age[,1], ylim=c(0, max(rowSums(aggData$age axis(1, c(0, plotInfo), c("Gender", "-", "-", "+", "+"), line=.75, lwd=0, ce

Re: [R] Overlay two shapefiles in same map axes rgdal/maptools

2014-11-18 Thread Roger Bivand
Zilefac Elvis yahoo.com> writes: > > Hello, > > I have two spatial map objects (reproducible example further down) > which I would like to overlay in R. The > ESRI shapefiles were read using: > The reproduction of the data didn't work with dput(). > library(rgdal) > Prairie.Boundaries <- r

[R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
I have a new package (local use only). R CMD check fails with a messge I haven't seen before, and I haven't been able to guess the cause. There are two vignettes, both of which have %\VignetteIndexEntry lines. Same failure both under R-3.1.1 and R-devel, so it's me and not R. Linux OS. Hints a

Re: [R] number of weights in multinom ?

2014-11-18 Thread Franck Vermet
I have the book by W. Venables and B. Ripley, but I didn't find the answer. Here is an explicit example : library(nnet) data(fgl) ir.glm <- multinom(type ~., data=fgl) # weights: 66 (50 variable) initial value 383.436526 iter 10 value 259.867465 iter 20 value 184.185706 iter 30 value 146.

Re: [R] number of weights in multinom ?

2014-11-18 Thread Prof Brian Ripley
On 18/11/2014 11:35, Franck Vermet wrote: Hello, In the function multinom (package nnet), I get the following message after training for a model with 9 inputs and 6 classes (output) : # weights: 66 (50 variable) I understand that there are 50 variables in the model, but I don't understand th

[R] number of weights in multinom ?

2014-11-18 Thread Franck Vermet
Hello, In the function multinom (package nnet), I get the following message after training for a model with 9 inputs and 6 classes (output) : # weights: 66 (50 variable) I understand that there are 50 variables in the model, but I don't understand the number 66. How can we interpret this numb

Re: [R] problems with mail message

2014-11-18 Thread PIKAL Petr
Hi Martin No problem. I hope OP obtained my responses and so I do not see need for resending them to r-help. You are doing great job and such minor problems do not change my opinon about it. Regards Petr > -Original Message- > From: Martin Maechler [mailto:maech...@stat.math.ethz.ch]

Re: [R] problems with mail message

2014-11-18 Thread Martin Maechler
> PIKAL Petr > on Tue, 18 Nov 2014 10:48:28 + writes: > Dear maintainers Hi Petr, You sent this to the mailing list, not just the maintainers.. > I experienced problems with undeliverable messages to R-help Yes, and many others probably did too. > Here is header, w

[R] problems with mail message

2014-11-18 Thread PIKAL Petr
Dear maintainers I experienced problems with undeliverable messages to R-help Here is header, which basically says that mail to r-help@r-project.org was undelivered and that phil2.ethz.ch refused to accept it. * Doručení těmto příjemcům nebo skupinám se nezda