Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Philippe Grosjean
Hi JCFaria, You package is supposed to be used only under Windows, right? Then, use: OS_type=windows in the DESCRIPTION file… and, of course, use R CMD check/R CMD build/ R CMD INSTALL under Windows only. Best, Philippe On 23 Sep 2013, at 20:55, Jose Claudio Faria wrote: > I have been deve

Re: [R] Installing R, R packages

2013-09-23 Thread Jeff Newmiller
I have stopped using the Berkeley mirror, and just automatically use UCLA due to missing packages. However, I feel no compulsion to extrapolate and say that there is "some sort of corruption going on at CRAN mirrors" because it is only one data point.

[R] Installing R, R packages

2013-09-23 Thread David Arnold
All, Consider this attempt: > install.packages("car") trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/contrib/3.0/car_2.0-19.tgz' Content type 'application/x-gzip' length 1326903 bytes (1.3 Mb) opened URL == downloaded 1.1 Mb car/data/Rdata.rdb: Truncat

Re: [R] raster package: OpenStreetMap broken on Ubuntu, works on Mac

2013-09-23 Thread Tal Galili
Jos had e-mailed me that he found a fix to this problem (after he had originally asked me, and I sent him to R-help/ the package maintainer), so I thought of keeping this thread updated with his reply: After Jos communicated with the maintainers about this, the fix is to install the raster package

Re: [R] adjust scale of x-axis to unequal intervals

2013-09-23 Thread Jim Lemon
On 09/24/2013 10:05 AM, Sagan Friant wrote: Dear R community, Please help. I am new(ish) to R and have spent too many hours trying to achieve what I believe should be a relatively simple task. I have searched help forums, but have not been able to successfully apply responses to loosely relate

Re: [R] Problem with plotting against time(hh:mm)

2013-09-23 Thread arun
Hi, testing<- read.table(text="0:00,0.88 0:05, 0:20,0.6 0:25,0.14 0:30,0.25 0:35,0.5 0:40,0.25 0:45,0.13",sep=",",header=FALSE,stringsAsFactors=TRUE) # After reading the file using ?read.csv(), try:   plot(as.numeric(testing$V1),testing$V2,xaxt="n",xlab="TimeStamp",ylab="IntSollrr") axis(1,as.num

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I think I found the main problem! I am developing the package under Linux and after R CMD build, manually compressing the folder TinnRcom inside of the folder TinnRcom.RCheck and installing in Windows. As the APPDATA environment variable does not exist in Linux, the function Sys.getenv ("APPDATA"

[R] adjust scale of x-axis to unequal intervals

2013-09-23 Thread Sagan Friant
Dear R community, Please help. I am new(ish) to R and have spent too many hours trying to achieve what I believe should be a relatively simple task. I have searched help forums, but have not been able to successfully apply responses to loosely related questions to my own. I am running some prel

Re: [R] capturing warnings within loops, so I know the iterations where warnings occurred?

2013-09-23 Thread Richard Kwock
Hi, Check out: https://stat.ethz.ch/pipermail/r-help/2010-December/262626.html > demo(error.catching) > tryCatch.W.E mylist <- list(NULL) mylist_warns <- list(NULL) old.warn <- options(warn=1) x <- c(1:5) for (i in 1:2) { assign("last.warning", NULL, envir = baseenv()) temp <- tryCatch.W.E

[R] capturing warnings within loops, so I know the iterations where warnings occurred?

2013-09-23 Thread Anika Masters
I am running a loop. Warnings sometimes occur, and the lop continues until the end. For each iteration of the loop, I wish to capture and "save" any warnings issued, so that I can tell on which iteration the warnings were issued. I tried this, but it does not work. mylist <- list(NULL) mylist_war

Re: [R] two questions about xyplot

2013-09-23 Thread William Shadish
Richard, This worked perfectly (adding # before "update"). Thank you so much for your help. I've bought a couple of books on R Graphics so I can learn this stuff better. Will On 9/23/2013 1:08 PM, Richard Kwock wrote: Hi, Getting text to show on the panel plots is a bit trickier, but doabl

Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread carlisle thacker
Thanks. This seems to return the correct offset. For example, it knows about the time zone not following the meridian in this part of the Pacific: > GNtimezone(14,-172) rawOffset dstOffset gmtOffset lng lat 1 -11 0 -11 -172 14 Warning message: In readLines(u) : incomple

Re: [R] Correlate rows of 2 matrices

2013-09-23 Thread arun
Hi Ira, I tried the ?lapply().  Looks like it edges the ?for() loop. For e.g.   set.seed(435) m1 <- matrix(rnorm(2000*30), ncol=30) m2 <-  matrix(rnorm(2000*30), ncol= 30)  corsP<-vector()    system.time({for(i in 1:2000) corsP[i] =  cor(m1[i,], m2[i,])})  # user  system elapsed  # 0.124   0.00

Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread MacQueen, Don
The very first response, from Jeff Newmiller, included a link http://efele.net/maps/tz/world/ which says it has offers a shapefile of timezones of the world. An outline of a solution, then it to download the shapefile load it into R input your lat/long data into R use the over() functi

Re: [R] pulling out coefficients

2013-09-23 Thread Rui Barradas
Hello, Maybe something like the following. cf <- vector("list", 500) for (i in 1:500){ s <- paste0("Chain",i) cf[[i]] <- mi.txt.i@imp[[s]]$cont.y.obs@model$coefficients } Hope this helps, Rui Barradas Em 23-09-2013 14:17, Andrea Lamont escreveu: Hello: I am running a simul

[R] labcurve - size of symbol

2013-09-23 Thread Igor Ribeiro
Dear all, I'm using labcurve function (hmisc package) to draw symbols over the lines. I'd like to increase symbol's size. I have a few thicker lines but symbols are so small that they almost don't appear. I tried to use cex in labcurve function but symbols stay the same and legend box gets bigger.

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jinsong Zhao
On 2013/9/23 12:52, David Winsemius wrote: On Sep 22, 2013, at 10:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) ?par plot (rnorm(1:10), type = "b") legend("top", "test", lty = "69",

Re: [R] two questions about xyplot

2013-09-23 Thread Richard Kwock
Hi, Getting text to show on the panel plots is a bit trickier, but doable. # append to the dataset the mean for each group and line d66df_mns <- cbind(d66df, "Means" = c(rep(c(mn1, mn2, mn3), each = 6))) # set the y_lim to extend a bit further above the graph to allow for the means to be display

Re: [R] Creating rectangular plots with x and y coordinates and treatments from a matrix for a randomized block design

2013-09-23 Thread Laz
Thanks. Sweave/Latex is done the job for me ! Regards, Laz On 9/22/2013 8:26 PM, jim holtman wrote: CHeck out the 'tables' package if you want to create pretty outputs of your tables. Exactly where do you plan to use them? You can also use Sweave/Latex to create such tables. Jim Holtman Data

Re: [R] 答复: the values of predict( , type = "terms", )

2013-09-23 Thread Greg Snow
You are using the `scale` function which subtracts the mean and divides by the standard deviation, but the `glm` function does not do the same thing by default, so that is the likely reason that you are seeing a difference. Try doing it without the call to `scale` and see if that gives you what yo

Re: [R] two questions about xyplot

2013-09-23 Thread William Shadish
Dear Richard, your solution to the second question worked like a charm. Thanks! So much to learn about this stuff, but at least it is fun. On the first question, yes, I want a text to display the mean in each of the 12 panels. Will On 9/23/2013 11:23 AM, Richard Kwock wrote: Hi, To answer

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I appreciate your attention Gabor. However, the result was the same. :( Both only work when the trPath object is sent to a R session already running. When inside the package the result was the same. > remove.packages('TinnRcom') > Install.packages('TinnRcom_1.0-09.zip', repos=NULL) # New versio

[R] Turning a string into a real vector

2013-09-23 Thread t...@shatalmic.com
I have the following string input: input <- "ACC,1.1,2.2,3.3,4.4\nACC,2.2,3,4,5\nADN,3.3,4,5\nACC,4.4,5.5,6.6,7.7\nADN,5.5,6,7\n" Note that \n is a real line feed in the data and the numbers are all made up and might be other values. The key is that the first number is a float, the ACC packets ar

Re: [R] Turning a string into a real vector

2013-09-23 Thread arun
Hi If I use your code: grep ("ACC", input, FALSE, FALSE, TRUE) #[1] "ACC,1.1,2.2,3.3,4.4\nACC,2.2,3,4,5\nADN,3.3,4,5\nACC,4.4,5.5,6.6,7.7\nADN,5.5,6,7\n" Seems like you forgot one line of code: with ?strsplit() vec1<- grep("ACC",strsplit(input,"\n")[[1]],FALSE,FALSE,TRUE) vec1 #[1] "ACC,1.1,2.2,

[R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I have been developing a new package (TinnRcom) to avoid the necessity of any script (as below) in the Rprofile.site file related to the use of Tinn-R Editor and R: #=== # Tinn-R: necessary packages and functions # Tinn-R: >= 2.4.1.1 with

Re: [R] Turning a string into a real vector

2013-09-23 Thread t...@shatalmic.com
Thank you. I was doing a strsplit and forgot to include it in my post. What was confusing me is that the result doesn't look like a vector. I guess it actually is. I will try writing it out and see if I get what I want from it. Thanks! -- View this message in context: http://r.789695.n4.nabble

[R] two questions about xyplot

2013-09-23 Thread William Shadish
Dear R helpers, I am generating three artificial short interrupted time series datasets (single-case designs; call them Case 1, Case 2, Case 3) and then plotting them in xyplot. I will put the entire code below so you can reproduce. I have been unable to figure out how to do two things. 1. Each

Re: [R] Permutation Test on Interactions {coin}

2013-09-23 Thread Torsten Hothorn
Axel, you need a model for such type of analyses and coin is completely model-free. Torsten On Mon, 23 Sep 2013, Axel Urbiz wrote: Dear List, I'm interested in performing a permutation test on the interaction between a binary treatment indicator and a covariate (either continuous or categ

[R] Date Comparing *Problem*

2013-09-23 Thread Rhymes
I have a problem with comparing dates. i tried it like "datesub = subset(data, 2012-11-19 < data$date)", but this doesn't work and i don't know why. Hope you can help me. here are my files: http://uploaded.net/file/n9sxdm0v -- View this message in context:

Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread carlisle thacker
Gabor, Thanks for your tip about zone.tab. It provides country codes and lat/lon of the zone's principal location, which while useful is not exactly what I need. I would like to know the coordinates of time zone boundaries. Better still would be a function, which returns the name of the time zon

[R] pulling out coefficients

2013-09-23 Thread Andrea Lamont
Hello: I am running a simulation in which need to pull out the coefficients of a multiply imputed object for each simulation. The coefficientscould be called using the following command: mi.txt.i@imp$Chain1$cont.y.obs@model$coefficients THis gives me the coefficients for the first imputation (Ch

Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread David Winsemius
On Sep 23, 2013, at 9:05 AM, carlisle thacker wrote: > Gabor, > > Thanks for your tip about zone.tab. It provides country codes and > lat/lon of the zone's principal location, which while useful is not > exactly what I need. I would like to know the coordinates of time > zone boundaries.

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Gabor Grothendieck
On Mon, Sep 23, 2013 at 2:55 PM, Jose Claudio Faria wrote: > trPaths <- paste(paste(Sys.getenv('APPDATA'), >'\\Tinn-R\\tmp\\', >sep=''), > c('', >'search.txt', >'objects.txt', >

Re: [R] two questions about xyplot

2013-09-23 Thread Richard Kwock
Hi, To answer your second question you can do something like this: p<-xyplot(dvy ~ sessidx | case, group = numph, data=d66df, col = c(1:4), layout=c(1, 3), xlab= "Sessions", ylab = "Number of Seconds", type="l") update(p, panel=function(...){ panel.xyplot(...) panel.a

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jinsong Zhao
On 2013/9/23 17:11, Jim Lemon wrote: On 09/23/2013 01:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) The result is something wired for the line crosses the point in the legend while the

Re: [R] Date Comparing *Problem*

2013-09-23 Thread arun
Hi, Try: set.seed(634) dat<- data.frame(date=seq(as.Date("2012-11-15"),length.out=10,by="1 day"), value=rnorm(10)) subset(dat,"2012-11-19" < date)  # date  value #6  2012-11-20 -0.3290021 #7  2012-11-21  0.3106802 #8  2012-11-22 -1.0782814 #9  2012-11-23 -0.1333426 #10 2012-11-24  0.

[R] Recycling other internal package functions

2013-09-23 Thread Charles Determan Jr
Greetings, I am not sure if this question should be posted on the development mailing list but perhaps it is general enough for this mailing list. I am currently developing an R package and there are other packages that use some internal functions that I would also like to utilize (e.g. reformat

Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread Olivier Eterradossi
carlisle thacker gmail.com> writes: > > I have data that provide longitude, latitude, and local date and time but > no information about the corresponding time zone. How to identify the time > zone so they can be converted to a common date/time? > > Thanks, > > Carlisle > >

Re: [R] Conditioning plots (wth coplot function) with logistic regression curves

2013-09-23 Thread Michael Friendly
On 9/22/2013 8:48 PM, Kiyoshi Sasaki wrote: > Could you please show me how to plot raw data points in those ggplots? > read ?geom_point dat$Ivy3 <- factor(cut(dat$Ivy,3)) ggplot(dat, aes(Overstory, Presence), color=Ivy3 ) + stat_smooth(method="glm", family=binomial, formula= y~x, alpha=0.3, ae

[R] Bug in Survival - predict.coxph with collapse? (related to question "censor=FALSE and id options in survfit.coxph")

2013-09-23 Thread julian.bothe
Hello everyone, Hello Terry, Trying to find workarounds for the bug described in http://r.789695.n4.nabble.com/censor-FALSE-and-id-options-in-survfit-coxph -td4670320.html, I found another issue which might or might not be related and which I think is a bug - unless I got the usage of the col

Re: [R] PLS1 NIPALS question: error with chemometrics package?

2013-09-23 Thread Andrews, Chris
I think you need to divide by sqrt(sum(th^2)) rather than sum(th^2) ch <- as.numeric(t(yh) %*% th)/sqrt(sum(th^2)) # modified: / sqrt(SS) #ch <- as.numeric(t(yh) %*% th)/sum(th^2) # modified: / SS # ch <- ch/as.vector(sqrt

[R] Permutation Test on Interactions {coin}

2013-09-23 Thread Axel Urbiz
Dear List, I'm interested in performing a permutation test on the interaction between a binary treatment indicator and a covariate (either continuous or categorical). I'm interested in the p-value of the interaction effect from a permutation test, and I'm using the coin package for that purpose.

Re: [R] legend for the plot with type = "b"

2013-09-23 Thread Jim Lemon
On 09/23/2013 01:54 PM, Jinsong Zhao wrote: Hi there, I plot a simple plot with the following code: plot (rnorm(1:10), type = "b") legend("top", "test", lty = 1, pch = 21) The result is something wired for the line crosses the point in the legend while the line does not cross the point in the

Re: [R] Comparing two GAMs using anova (mgcv)

2013-09-23 Thread Simon Wood
It's ok to use an approximate F test here, provided you are careful with the interpretation. e.g. do look at the differences in EDF and not just the p-value (negative or very small EDF differences will render the p-value essentially meaningless). however... Where-ever possible it is usually be

Re: [R] xlim with barplot

2013-09-23 Thread peter dalgaard
On Sep 23, 2013, at 05:43 , Jim Lemon wrote: > > barplot(tabulate(x,nbins=85)[35:85]) > barplot(tabulate(y,nbins=85)[35:85]) > > This is an underhanded trick to line up the bars as I think you want them. Not all that underhanded! table() with numeric vectors _will_ skip values not present in d