Re: [R] R 2.11 on Mac OS X

2013-06-23 Thread Jeff Newmiller
RStudio questions belong on the RStudio support website. It is fine software, but it is off-topic here. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Liv

Re: [R] Wilcox paired test error message

2013-06-23 Thread peter dalgaard
On Jun 23, 2013, at 22:30 , Sarah Goslee wrote: > Hi, > > If you're doing exactly as described below, then you need to add the > data argument to wilcox.test so R knows where to find beforesmall and > aftersmall. But if so, that's a rather uninformative error message. > > Saraj Not really, if

Re: [R] R 2.11 on Mac OS X

2013-06-23 Thread David Winsemius
On Jun 23, 2013, at 7:24 PM, Norman Jessup wrote: > David, > > Thank you. You are correct - I was inadvertently accessing an old version. > Deleting the old and re-installing means I can fire up R V3.0.1 which runs > fine. > > However, I still can't get R Studio to start up, receivng the

Re: [R] R 2.11 on Mac OS X

2013-06-23 Thread Norman Jessup
David, Thank you. You are correct - I was inadvertently accessing an old version. Deleting the old and re-installing means I can fire up R V3.0.1 which runs fine. However, I still can't get R Studio to start up, receivng the following message: ERROR r error 4 (R code execution error) [

Re: [R] Function in R saving in xls

2013-06-23 Thread David Winsemius
On Jun 23, 2013, at 1:54 PM, Sérgio Henrique almeida da silva ju wrote: > I created a program that breaks a database in several other banks. But in > this program I save this several banks in txt so now I'd like save in xls, > but I don't know how. > > I tried for (nm in Nms) write.table(Res[[nm

Re: [R] Function in R saving in xls

2013-06-23 Thread Rui Barradas
Hello, To work with xls files, check out package XLConnect. The vignette explains how to use it rather well. Also, don't use attach() It can be confusing and a source for errors. Hope this helps, Rui Barradas Em 23-06-2013 21:54, Sérgio Henrique almeida da silva ju escreveu: I created a pr

Re: [R] environment of lm

2013-06-23 Thread Dave Mitchell
Argh!! I use those all the time! I can't believe I overlooked something so obvious! Unfortunately, the pastebin was an abstraction of another problem I was having that WAS, in fact, creating a formula in another environment and passing it into the function the where data object was created and m

Re: [R] Fault geology xyz to raster

2013-06-23 Thread Shane Carey
What I mean is, I have a data set consisting of 3 columns x, y, z. X, Y represent the location and Z represents depth. X, Y stay the same at some locations but z changes. Because X, Y don't change at some locations, I cannot convert to raster. I need to create a .grd file so that the fault can be

[R] statda package issue

2013-06-23 Thread matteo
I all, I'm new on this list, so sorry if I do something wrong. Anyway, I have a problem with the installation of the package StatDA. Typing install.package("StatDA") I receive the error: ERROR: configuration failed for package ‘MBA’ * removing ‘/home/matteo/R/i686-pc-linux-gnu-library/3.0/MBA’

[R] Problem with svm.tune

2013-06-23 Thread Anne Dwyer
I am trying to learn to tune a svm model in R. I'm using the sonar data set used by David Mease in his Google Tech Talk video. I downloaded the data from his site. There are 130 observations in the training set. I am able to run a svm model. But when I try to run this command: tune_svm <-tune.sv

Re: [R] Fault geology xyz to raster

2013-06-23 Thread David Winsemius
On Jun 23, 2013, at 1:50 PM, Shane Carey wrote: > Hi, > > I have a 3-d geology problem. I have an xyz fault data set. I am able to > view the data set in R using plot3-d That cannot be a function name, since it is invalid syntax. > but cannot create a raster from it. I > need to create a raste

Re: [R] Scaling Statistical

2013-06-23 Thread Rui Barradas
Hello, Sorry, I forgot to Cc the list. Rui Barradas Em 23-06-2013 21:44, Rui Barradas escreveu: Hello, See if the following does what you want. lapply(seq_len(obsv), function(i) adf.test(df[df$ID == i, 3])) Hope this helps, Rui Barradas Em 23-06-2013 19:12, Olga Musayev escreveu: Short

Re: [R] Wilcox paired test error message

2013-06-23 Thread David Winsemius
On Jun 23, 2013, at 11:34 AM, ruth parker wrote: > Hi, > I've been trying to run a wilcox paired test on some data > beforesmall aftersmall > [1,]63.5 512.0 > [2,]54.5 237.5 > [3,]52.5 161.5 > [4,]78.0 153.5 > [5,]53.5 68.0 > [6,]

[R] Fault geology xyz to raster

2013-06-23 Thread Shane Carey
Hi, I have a 3-d geology problem. I have an xyz fault data set. I am able to view the data set in R using plot3-d but cannot create a raster from it. I need to create a raster and export so that it can be read in arcscene. Can anybody help? Thanks -- Shane [[alternative HTML version d

Re: [R] environment of lm

2013-06-23 Thread William Dunlap
By the way, you could use lm(x ~ y + z, data=someData, weights=weight) instead of lm(x ~ y + z, data=someData, weights=someData$weight) as 'weight' will be looked for in someData before any environment. (You still don't want to get into the habit of passing formula strings to lm.) Bill Dunl

Re: [R] Wilcox paired test error message

2013-06-23 Thread arun
HI, May be this helps: dat1<- read.table(text=" beforesmall aftersmall 63.5  512.0 54.5  237.5 52.5  161.5 78.0  153.5 53.5   68.0 50.5   65.5 69.0   52.0 76.0   59.0 68.0   66.5 75.5   66.5 67.0   45.5 81.0   54.5 49.0   44.0 51.0   42.5 53.0

Re: [R] Wilcox paired test error message

2013-06-23 Thread Sarah Goslee
Hi, If you're doing exactly as described below, then you need to add the data argument to wilcox.test so R knows where to find beforesmall and aftersmall. But if so, that's a rather uninformative error message. Saraj On Sun, Jun 23, 2013 at 2:34 PM, ruth parker wrote: > Hi, > I've been trying t

Re: [R] environment of lm

2013-06-23 Thread William Dunlap
Your web site had WeightsBreaks <- function(){ someData <- data.frame(x = rnorm(20, 5, 1),y = 1:20 + runif(20),z = 70:51, weight = 0.05) print( ls()) ModObject <- lm('x~y + z', data = someData, weights = someData$weight) } and I got the result > print(WeightsBreaks()) [1] "s

Re: [R] Apply acf to data frame containing 'NA'

2013-06-23 Thread Bert Gunter
1. acf already has a na.action argument which should be used instead of the acf(na.omit(x)) construction. 2. But more to the point, acf(x,na=na.omit) may very well be complete nonsense (see ?acf for hints at this). How to handle estimate covariances with missingness and, more particularly, how to

[R] Wilcox paired test error message

2013-06-23 Thread ruth parker
Hi, I've been trying to run a wilcox paired test on some data beforesmall aftersmall [1,]63.5 512.0 [2,]54.5 237.5 [3,]52.5 161.5 [4,]78.0 153.5 [5,]53.5 68.0 [6,]50.5 65.5 [7,]69.0 52.0 [8,]

Re: [R] Apply acf to data frame containing 'NA'

2013-06-23 Thread Hannah Barron
Hi, The acf function requires that you specify how to deal with NAs in your data. By default, it uses na.fail ("Error in *na.fail.default*(as.ts(x)) : missing values in object). Try using na.action=na.pass as an argument. While this will pass over your NAs, make sure that you understand how that w

[R] environment of lm

2013-06-23 Thread Dave Mitchell
Hello, I'm running into what I believe is a scoping issue having to do with the environment in which the weights argument is evaluated in lm. From the lm documentation "All of weights, subset and offset are evaluated in the same way as variables in formula, that is first in data and then in the en

[R] Scaling Statistical

2013-06-23 Thread Olga Musayev
Short question: Is it possible to use statistical tests, like the Augmented Dickey-Fuller test, in functions with for-loops? If not, are there any alternative ways to scale measures? Detailed explanation: I am working with time-series, and I want to flag curves that are not stationary and which di

Re: [R] Apply acf to data frame containing 'NA'

2013-06-23 Thread arun
HI, dat1<- read.csv("AMS3.csv",sep="\t",row.names=1) pdf("AMS3_acf.pdf")  lapply(dat1,function(x)acf(na.omit(x))) dev.off() A.K. From: Zilefac Elvis To: arun Cc: R help Sent: Sunday, June 23, 2013 1:51 PM Subject: Re: [R] Apply acf  to data frame contain

Re: [R] 2SLS / TSLS / SEM non-linear

2013-06-23 Thread Achim Zeileis
On Sun, 23 Jun 2013, hck wrote: Dear all, I try to conduct a SEM / two stage least squares regression with the following equations: See ivreg() in package "AER" or tsls() in "sem". hth, Z First: X ~ IV1 + IV2 * Y Second: Y ~ a + b X therein, IV1 and IV2 are the two instruments I would like

Re: [R] Apply acf to data frame containing 'NA'

2013-06-23 Thread Zilefac Elvis
Hi, Thanks so much for the quick reply. It worked on your data but failed on mine. Attached is my data.  I received this error: "Error in acf(na.omit(x)) : 'lag.max' must be at least 0 In addition: Warning message: In split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) :   data length is n

Re: [R] Apply acf to data frame containing 'NA'

2013-06-23 Thread arun
Hi, May be this helps: set.seed(24) A <- matrix(sample(c(NA,rnorm(1500)),1500,replace=FALSE),nrow=500) par(mfrow=c(ncol(A),1))  lapply(split(A,col(A)),function(x) acf(na.omit(x))) A.K. - Original Message - From: Zilefac Elvis To: "r-help@r-project.org" Cc: Sent: Sunday, June 23, 2013

[R] Apply acf to data frame containing 'NA'

2013-06-23 Thread Zilefac Elvis
Hi, I have a data frame with each column representing a separate site. Following this code, I can apply acf to all columns in A. 'A' contains randomly generated data. A <- matrix(rnorm(1500),nrow=500) par(mfrow=c(ncol(A),1)) lapply(split(A,col(A)), acf) #OR lapply(split(A,col(A)), function(snow

Re: [R] need an assistance

2013-06-23 Thread Iut Tri Utami
Hi, i am tryng to run Bagging SVM but I have a problem. I do Bagging SVM based on algoritm bagging Trees by Breiman. I get the following error and I think I am wrong in calculating err.mean and err.vote. I also have difficulty in making the plot. > library(e1071) > gendata <- function(N=30,p=5,r=.

[R] 2SLS / TSLS / SEM non-linear

2013-06-23 Thread hck
Dear all, I try to conduct a SEM / two stage least squares regression with the following equations: First: X ~ IV1 + IV2 * Y Second: Y ~ a + b X therein, IV1 and IV2 are the two instruments I would like to use. the structure I would like to maintain as the model is derived from economic theory.

[R] Problem with lubridate and decimal seconds

2013-06-23 Thread Agustin Lobo
I get lubridate objects with the same decimal seconds while they are different in the input char: require(lubridate) options("digits.secs"=3) options("digits.secs") $digits.secs [1] 3 dias <- c("140613","140613") moment <- c("100545.5", "100545.6") paste(dias,moment) [1] "140613 100545.5" "140613

Re: [R] Built-in function for extracting mantissa and exponent of a numeric

2013-06-23 Thread Rui Barradas
Hello, Sorry I forgot to Cc the list. And I had forgotten the case where x == 0. extract <- function(x){ e <- ifelse(x == 0, 0, floor(log10(x))) m <- x/10^e list(mantissa = m, exponent = e) } extract(c(0, 1.234e12, 12345678901234, 123e123)) Hope this helps, Rui Barra

Re: [R] Legal issue help

2013-06-23 Thread Prof Brian Ripley
On 23/06/2013 12:59, Uwe Ligges wrote: On 23.06.2013 01:50, Dr. T. Imam wrote: Hi, I am new to this forum, and hopefully am sending the post to the right avenue (and in the appropriate format). I am planning to prepare a (to be commercially sold) book in near future, in which I expect to use

Re: [R] Legal issue help

2013-06-23 Thread Uwe Ligges
On 23.06.2013 01:50, Dr. T. Imam wrote: Hi, I am new to this forum, and hopefully am sending the post to the right avenue (and in the appropriate format). I am planning to prepare a (to be commercially sold) book in near future, in which I expect to use some screenshots from R (running on Win

Re: [R] Built-in function for extracting mantissa and exponent of a numeric

2013-06-23 Thread Duncan Murdoch
On 13-06-23 5:54 AM, Søren Højsgaard wrote: Dear all, Given a number x<-1.234e12 is there a built-in function for extracting 1.234 and 12 ? I don't think so, but it is not hard to build them from log10: mantissa <- function(x) { if (x == 0) 0 else { log <- log10(abs(x)) 10^(log

Re: [R] Built-in function for extracting mantissa and exponent of a numeric

2013-06-23 Thread Prof Brian Ripley
On 23/06/2013 10:54, Søren Højsgaard wrote: Dear all, Given a number x<-1.234e12 is there a built-in function for extracting 1.234 and 12 ? No, because that is not how the number is stored (and in fact the value stored is a binary fraction with a slightly different value). The following

[R] Built-in function for extracting mantissa and exponent of a numeric

2013-06-23 Thread Søren Højsgaard
Dear all, Given a number x<-1.234e12 is there a built-in function for extracting 1.234 and 12 ? The following "hack" seems clumpsy: > a<-strsplit(format(x, scientific=T),"e")[[1]] > a [1] "1.234" "+12" > as.numeric(a[1]) [1] 1.234 > as.integer(a[2]) [1] 12 Regards Søren ___

[R] Fwd: metaMDS Error, Nan similar or negative values

2013-06-23 Thread Suparna Mitra
Hello R experts and Vegan users, I am re-posting my msg as I didn't get any reply. I am not sure if it was not sent properly. Please help. Sorry for repeated post. I want to do ordination plots using vegan metaMDS. I have a where many cells have zero values. Data structure: X[1:10,1:14] H