Re: [R] Declare BASH Array Using R System Function

2013-07-28 Thread Jeff Newmiller
You seem confused. You are programming in R, and asking questions about bash on an R mailing list. You seem to need to learn the difference between environment variables and bash variables and how processes acquire and transfer environment variables, which is really an operating system concept a

[R] R function

2013-07-28 Thread javad bayat
Dear R users; I am MSc student and I want to write my own function, but it cant be completed. please help me for solve it. here is my code: pah1$P = (pah1$Fluoranthene/pah1$Pyrene) T = function(x){ for (i in 1:length(pah1$P)) if (i >= 1) print("Combustion") if (i < 1) print("Petroleum") } T(pah1$P

[R] surface plot

2013-07-28 Thread javad bayat
Dear R users; I have a question about surface plot that show me spatial variability of parameter. I have a data frame with 6 variables and X and Y for coordinate system. X Y pH ..... ... so I want to create a surface plot for my data. please help me. many thanks.

[R] Declare BASH Array Using R System Function

2013-07-28 Thread Dario Strbenac
Hello, It is difficult searching for previous posts about this since the keywords are short and ambiguous, so I hope this is not a duplicate question. I can easily declare an array on the command line. $ names=(X Y) $ echo ${names[0]} X I am unable to do the same from within R. > system("name

[R] Help with prefmod

2013-07-28 Thread Qamar Schuyler
Hello, I'm using the prefmod package, with pattPC fit, and I'm having some trouble interpreting the results. I am giving two different species of animal a choice between two of three different patterns, V, H, and 45. I have run a number of paired tests with different combinations of the above,

[R] MCMClogit: Cannot calculate marginal likelihood with improper prior

2013-07-28 Thread ba0728
I'm an undergrad who is new to MCMCpack and I haven't been able to find an answer to my problem online yet: I'm attempting to run MCMClogit with a Cauchy proper prior but I'm getting the warning "Cannot calculate marginal likelihood with improper prior" (my purposes require the marginal likelihood

[R] Chinese characters in html source captured by download.file() are garbled code , how to convert it readable

2013-07-28 Thread Yong Wang
Dear list, I am working with R to download numerous html source code from which the data extracted will be further processed. The problem is the Chinese character in the html source code are all garbled and I can't really find a way to convert them to something readable. This problem persists on ub

Re: [R] ggplot position_dodge requires constant width

2013-07-28 Thread arun
Hi, This link may help: http://stackoverflow.com/questions/14476961/why-do-i-get-position-dodge-requires-constant-width-even-though-widths-are-con A.K. - Original Message - From: David Arnold To: r-help@r-project.org Cc: Sent: Sunday, July 28, 2013 5:41 PM Subject: [R] ggplot position

[R] ggplot position_dodge requires constant width

2013-07-28 Thread David Arnold
Hi, library(ggplot2,plyr) qplot(carat,depth,data=diamonds, geom="boxplot", group=round_any(carat,0.1,floor), xlim=c(0,3)) Typing: warnings() Gives me: Warning messages: 1: position_dodge requires constant width: output may be incorrect How should the above code be adjusted t

Re: [R] Extracting Current and Old Date

2013-07-28 Thread arun
Hi, ?max ?min max(mydates) #[1] "2007-06-22" min(mydates) #[1] "2004-02-13"  max(mydates)-min(mydates) Time difference of 1225 days  max(as.numeric(mydates))-min(as.numeric(mydates)) #[1] 1225 A.K. - Original Message - From: Peter Maclean To: "r-help@r-project.org" Cc: Sent: Sunday,

Re: [R] Extracting Current and Old Date

2013-07-28 Thread David Winsemius
On Jul 28, 2013, at 12:20 PM, Peter Maclean wrote: > #This my look trivial but has been killing my time > #I want to extract most current and old date from mydates #variable that has > more than 10,000 observation. > #Get days > # use as.Date( ) to convert strings to dates > mydates <- as.Date

Re: [R] Extracting Current and Old Date

2013-07-28 Thread John Kane
If I read this correctly: mydates <- as.Date(c("2007-06-22", "2007-05-21", "2004-04-13", "2004-03-11","2004-02-13")) xx <- min(mydates) yy <- max(mydates) yy-xx John Kane Kingston ON Canada > -Original Message- > From: pmaclean2...@yahoo.com > Sent: Sun, 28 Jul 2013 12:20:30 -0700 (

Re: [R] Extracting Current and Old Date

2013-07-28 Thread Peter Maclean
#This my look trivial but has been killing my time #I want to extract most current and old date from mydates #variable that has more than 10,000 observation.  #Get days # use as.Date( ) to convert strings to dates mydates <- as.Date(c("2007-06-22", "2007-05-21", "2004-04-13", "2004-03-11","2004-

Re: [R] variable bandwidths in R

2013-07-28 Thread Bert Gunter
Inline. On Sun, Jul 28, 2013 at 10:38 AM, Rui Barradas wrote: > Hello, > > You should Cc the list, the odds of getting more and better answers is > greater. > I don't believe what you want is statistically sound, why more than one > bandwidth? Anyway, if density() doesn't do what you need, you ca

Re: [R] variable bandwidths in R

2013-07-28 Thread Rui Barradas
Hello, You should Cc the list, the odds of getting more and better answers is greater. I don't believe what you want is statistically sound, why more than one bandwidth? Anyway, if density() doesn't do what you need, you can try to look for similar functions in other packages. Try the followin

[R] Replacing NA values solved

2013-07-28 Thread Neotropical bat risk assessments
Hi all, Tnx for all the replies: Mike Colvin provided a simple answer in one step. Bats.cast <- dcast(data = Bats.melt, formula = Species ~ Location, fill =0) tnx all for the reminder of potential issues of willy nilly replacing missing data with zeros. In this case the 0 [zero value] for NAs

[R] How to replace NA values

2013-07-28 Thread Bruce Miller
Hi all, I am using reshape2 to reformat a data frame and all is great using: Bats.melt <- melt(data = Bats) Bats.cast <- dcast(data = Bats.melt, formula = Species ~ Location) dput(Bats.cast,'C:/=Bat data working/Nica_new/Bats_niche.robj') write.csv(Bat.cast,'C:/=Bat data working/Nica_new/test_

Re: [R] How to replace NA values

2013-07-28 Thread Richard M. Heiberger
The mechanics of replacing missing values are very easy in R > tmp <- data.frame(a=1:4,b=c(5,6,NA,8)) > tmp a b 1 1 5 2 2 6 3 3 NA 4 4 8 > tmp[is.na(tmp)] <- 0 > tmp a b 1 1 5 2 2 6 3 3 0 4 4 8 > But pay attention to Bert's warning. This is most likely the wrong statistical way to respon

Re: [R] How to replace NA values

2013-07-28 Thread Bert Gunter
Inline. --Bert On Sun, Jul 28, 2013 at 6:19 AM, Neotropical bat risk assessments wrote: > Hi all, > > I am using reshape2 to reformat a data frame and all is great using: > > Bats.melt <- melt(data = Bats) > > Bats.cast <- dcast(data = Bats.melt, formula = Species ~ Location) > > dput(Bats.cast,

[R] How to replace NA values

2013-07-28 Thread Neotropical bat risk assessments
Hi all, I am using reshape2 to reformat a data frame and all is great using: Bats.melt <- melt(data = Bats) Bats.cast <- dcast(data = Bats.melt, formula = Species ~ Location) dput(Bats.cast,'C:/=Bat data working/Nica_new/Bats_niche.robj') write.csv(Bat.cast,'C:/=Bat data working/Nica_new/test_

Re: [R] repeated measures logistic regression

2013-07-28 Thread Stanislav Aggerwal
Thanks very much Ben for your extremely helpful response. I have loads of data so this worked fine. cheers, Stan On Saturday, July 27, 2013, Ben Bolker wrote: > Stanislav Aggerwal gmail.com> writes: > > > > > I have searched the r-help archive and saw only one > > unanswered post related > > to

Re: [R] variable bandwidths in R

2013-07-28 Thread Rui Barradas
Hello, Try function ?density, argument bw, in package stats. Hope this helps, Rui Barradas Em 28-07-2013 04:18, Ms khulood aljehani escreveu: HelloI want to know how can implement variable bandwidths for kernel density estimation in R. What the packages that I need to use? And what the

Re: [R] Boxcox transformation error

2013-07-28 Thread peter dalgaard
On Jul 27, 2013, at 00:00 , Miller Ruiz wrote: > Hello > > I'm trying to run the script below for making a boxcox transformation of > some variables contained on an excel file, but i can't get it. I ever have > the same message : > error : $ operator is invalid for atomic vectors > > One of th

[R] variable bandwidths in R

2013-07-28 Thread Ms khulood aljehani
HelloI want to know how can implement variable bandwidths for kernel density estimation in R. What the packages that I need to use? And what the command? Thank You Khulood H. [[alternative HTML version deleted]]

Re: [R] Duplicated function with conditional statement

2013-07-28 Thread vanessa van der vaart
Dear Arun,, Thank you. its perfect! wow! thank you very much..and David, thank you for you too.. its such a help. I am so sorry it must've been confusing at the beginning.. really, I dont know how to thank you.. well do you mind if I ask you how can you be so expert? what kind a book or training