Re: [R] return the name of source.

2013-08-27 Thread peter dalgaard
On Aug 27, 2013, at 07:12 , nevil amos wrote: Is there a fuction that will allow me to retrun the filename for a script from within that script. Not a standard one, but you should be able to get at it via a bit of breaking and entering: sys.status() and friends (sys.calls, sys.frames) give

Re: [R] return the name of source.

2013-08-27 Thread Henrik Bengtsson
See findSourceTraceback() of R.utils. /Henrik On Mon, Aug 26, 2013 at 10:58 PM, peter dalgaard pda...@gmail.com wrote: On Aug 27, 2013, at 07:12 , nevil amos wrote: Is there a fuction that will allow me to retrun the filename for a script from within that script. Not a standard one, but

Re: [R] Storing Big Matrix in R memory

2013-08-27 Thread Pascal Oettli
Hello, If you can, you probably should upgrade for R version 3.0.1. Regards, Pascal 2013/8/27 Peter Maclean pmaclean2...@yahoo.com I would like to store a big spatial weight matrix in R memory to do more calculation. I know there are memory issue for 32 bit computer and I have tried

[R] Mapping help

2013-08-27 Thread Rhona Govender
Dear all, I have to make a last minute map...my thesis is due in a few days and our GIS lady fell ill, so my supervisor asked me to try in R., but I am a beginner. I've searched online, but have not found something at the global scale. I have a global dataset of dependent values (eg. rate of

Re: [R] return the name of source.

2013-08-27 Thread nevil amos
Thanks this does it: script.name - basename(sys.frame(1)$ofile) On Tue, Aug 27, 2013 at 4:07 PM, Henrik Bengtsson h...@biostat.ucsf.eduwrote: See findSourceTraceback() of R.utils. /Henrik On Mon, Aug 26, 2013 at 10:58 PM, peter dalgaard pda...@gmail.com wrote: On Aug 27, 2013, at

Re: [R] SimpleR

2013-08-27 Thread ONKELINX, Thierry
I think you want the UsingR package ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85

Re: [R] Summation sign

2013-08-27 Thread Suzen, Mehmet
Hello Sebastian, I think you may need to use tensorA package. You can define different indices and use Einstein or Reimann summation convention. Grüße, Mehmet On 23 August 2013 15:14, Sebastian Hersberger sebastian.hersber...@unibas.ch wrote: Hi all I have a short question relating to the

[R] Scale of axis for two data sets

2013-08-27 Thread mohan . radhakrishnan
Hi, Kbytes RSS rNo 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1460168 1443084

Re: [R] transform variables

2013-08-27 Thread Xochitl CORMON
You have what is called a wide table and you want a tall table. In this case the function melt from reshape2 package is suitable. Be careful specifying properly the variables (columns) you want to use for the reshape using correct syntax. ?melt {reshape2} You can also use as already suggested

Re: [R] Naming columns

2013-08-27 Thread Xochitl CORMON
Assuming you attribute the name dataset to your data. A way to name a column using colnames and which. Code to change V1 column name: colnames(dataset)[which(colnames(dataset) == V1)] - Toto You are asking to R in the column's names of dataset which one is V1 (TRUE) and attributing to this

Re: [R] varpart

2013-08-27 Thread Sibylle Stöckli
Dear Jari Oksanen, Thanks a lot for the varpart R package help. I preferred Adj. R square as mentioned by Peres-Neto (2006), but there are two facts that let me struggling around with the adj. R square. a) I received an Adj. R. square 1 for an explanatory matrix (common and individual

Re: [R] Scale of axis for two data sets

2013-08-27 Thread Jim Lemon
On 08/27/2013 05:58 PM, mohan.radhakrish...@polarisft.com wrote: Hi, Kbytes RSS rNo 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876 1433788 2689632 1450876

Re: [R] predict.glm with constant non-zero response intercept

2013-08-27 Thread Michael Dewey
At 04:46 27/08/2013, Murat Tasan wrote: hi all -- i'm running into a strange problem that i can't seem to easily get around, but i'm probably just missing something obvious. I think you just subtract it from y. But perhaps I too am missing the obvious. i have a model to which some data is

Re: [R] just a small variable-naming question

2013-08-27 Thread Keith Jewell
In case the OP wanted to append columns, rather than rename existing columns: cbind(myData, var1=NA, var2=NA, var3=NA) col1 col2 col3 var1 var2 var3 1123 NA NA NA 2234 NA NA NA 3345 NA NA NA On 24/08/2013 17:22, arun wrote: Hi, You

Re: [R] Scale of axis for two data sets

2013-08-27 Thread John Kane
I am misreading something here I think. Why are you graphing against a constant? John Kane Kingston ON Canada -Original Message- From: mohan.radhakrish...@polarisft.com Sent: Tue, 27 Aug 2013 13:28:48 +0530 To: r-help@r-project.org Subject: [R] Scale of axis for two data sets

Re: [R] Scale of axis for two data sets

2013-08-27 Thread mohan . radhakrishnan
It is not a constant but changes very slowly. Actually it should be like this. KbytesRSS rNo 2687188 1287532 1 2687188 1287532 2 2687188 1287536 3 2687188 1287540 4 2687188 1287640 5 2687188 1287640 6 Thanks, Mohan From: John Kane jrkrid...@inbox.com

Re: [R] Scale of axis for two data sets

2013-08-27 Thread John Kane
Still looks like a constant to me :) I think I see what you mean though. It's just that representation of the numbers in the email don't show any difference. Personally I think I'd go with a two panel graph using par() rather than a double-axis graph if you can. Everything I have read about

Re: [R] Naming columns

2013-08-27 Thread John Kane
names(mydatat) - c(V1,V2,V3) For future reference https://github.com/hadley/devtools/wiki/Reproducibility and/or http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original Message- From: mban...@partners.org Sent:

Re: [R] Pasting excell spreedsheet into notepad for R

2013-08-27 Thread John Kane
If I understand you correctly just import the data into R as a data.frame and then use the unlist() command. John Kane Kingston ON Canada -Original Message- From: mban...@partners.org Sent: Mon, 26 Aug 2013 09:06:12 -0700 (PDT) To: r-help@r-project.org Subject: [R] Pasting excell

Re: [R] Naming columns

2013-08-27 Thread Gyanendra Pokharel
Import data: mydata - read.table(filename.txt) give following command for column name colnames(mydata) - c(V1,V2,V3,) Gyanendra Pokharel University of Guelph Guelph, ON On Mon, Aug 26, 2013 at 5:42 PM, Docbanks84 mban...@partners.org wrote: Hi , I just imported a large data

Re: [R] Scale of axis for two data sets

2013-08-27 Thread mohan . radhakrishnan
Hi, Can't one y-axis be used ? Both 'Kbytes' and 'RSS' use the same unit. Thanks, Mohan From: John Kane jrkrid...@inbox.com To: mohan.radhakrish...@polarisft.com Cc: r-help@r-project.org Date: 08/27/2013 05:13 PM Subject:RE: [R] Scale of axis for two data

Re: [R] Scale of axis for two data sets

2013-08-27 Thread Jim Lemon
On 08/27/2013 10:01 PM, mohan.radhakrish...@polarisft.com wrote: Hi, Can't one y-axis be used ? Both 'Kbytes' and 'RSS' use the same unit. Hi Mohan, Yes, you can use a single y axis. What you probably want is something like this: ylim-range(c(Kbytes,RSS))

Re: [R] matrix into vector with vertex names - shortestpath reshape2

2013-08-27 Thread Joseph J. Bakker
Ok, the problem seems simpler than I thought. It works well if omit two lines: y_s[,1] - V(y)$name[y_s[,1]] y_s[,2] - V(y)$name[y_s[,2]] It seems melt creates a data.frame (unlike what it did two years ago?) Joe On Tue, Aug 27, 2013 at 12:35 AM, Joseph J. Bakker joe.st...@gmail.comwrote: Two

Re: [R] Scale of axis for two data sets

2013-08-27 Thread John Kane
Well I have not spent a lot of time looking at the data , especially with what appeared to be a constant :) . It was not clear to me that they were the same units for one thing. From my point of view (essentially total ignorance) if you have a situation where you have data plotted with the

Re: [R] Scale of axis for two data sets

2013-08-27 Thread John Kane
Jim, With those ranges isn't Mohan going to lose discrimination? That's one reason I suggested a two-panel approach. John Kane Kingston ON Canada -Original Message- From: j...@bitwrit.com.au Sent: Tue, 27 Aug 2013 22:36:12 +1000 To: mohan.radhakrish...@polarisft.com Subject: Re:

Re: [R] Scale of axis for two data sets

2013-08-27 Thread mohan . radhakrishnan
Thanks. There is one more idea from Jim Lemon which can also help. In my case I am dealing with a sys. admin who thinks the JVM is using all the memory in the linux machine. I think it is http://www.linuxatemyram.com/ syndrome. So if the junior sys. admin loses perspective I will never be

Re: [R] Scale of axis for two data sets

2013-08-27 Thread John Kane
Way outside my area but I think, well guess that the two panel approach is better since it should give you more discrimination or easily visualized detail for each variable but clearly Jim's suggestion will work too. Otherwise, get a sleeping bag and order in some food. It could be a long

[R] PubChem Request Search Script

2013-08-27 Thread Zsurzsa Laszlo
Dear all, The question would be: I would love to get information and match names of different chemistry compounds. A compound looks like this. Link: http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=2 The task is the following: 1. You input a name via R to the link, then a

Re: [R] RCurl cookiejar

2013-08-27 Thread Duncan Temple Lang
Hi Earl The cookies will only be written to the file specified by the cookiejar option when the curl handle is garbage collected. If you use rm(ch) gc() the cookie.txt file should be created. This is the way libcurl behaves rather than something RCurl introduces. If you don't

Re: [R] Installing package from website

2013-08-27 Thread Henrik Bengtsson
On Sun, Aug 25, 2013 at 10:55 AM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Hello again, I need to install Rmpi package from this http://www.stats.uwo.ca/faculty/yu/Rmpi/download/windows/MPICH2 I was wondering if there is any direct way to install this in R. The trivial method

Re: [R] [plyr] Moving average filter with plyr

2013-08-27 Thread arun
Hi, May be this helps: lst1-dlply(data,.(FileNo,ChannelNo),transform,filtered=applyfilter(ChannelB))  data2-do.call(rbind,lapply(lst1,function(x){x$filtered- as.numeric(x$filtered);x}))  row.names(data2)- row.names(data) head(data,3) #    Time ChannelA  ChannelB FileNo ChannelNo #1161

Re: [R] [plyr] Moving average filter with plyr

2013-08-27 Thread arun
#or data2-ddply(data,.(FileNo,ChannelNo),transform,filtered=as.numeric(applyfilter(ChannelB))) A.K. - Original Message - From: arun smartpink...@yahoo.com To: Ingo Reinhold in...@kth.se Cc: R help r-help@r-project.org Sent: Tuesday, August 27, 2013 10:03 AM Subject: Re: [R] [plyr]

Re: [R] [plyr] Moving average filter with plyr

2013-08-27 Thread arun
If you look at: str(lst1) List of 10  $ 1.1 :'data.frame':    783 obs. of  6 variables:   ..$ Time : num [1:783] 1.83e-05 2.37e-05 2.90e-05 5.06e-04 5.11e-04 ...   ..$ ChannelA : num [1:783] 4.53 4.88 4.8 3.58 3.58 ...   ..$ ChannelB : num [1:783] 6.87 13.6 21.09 22.09 21.55 ...   ..$ FileNo  

Re: [R] labcurve - use of putKey function

2013-08-27 Thread Igor Ribeiro
Hi Pascal, Still... there is something wrong. I changed the two lines as you suggested, and now I'm using the keys parameter. But the output is not as expected. That's why I was controlling the points using points function, because that works well. Let me try to show you with the code: # Example

[R] lattice graph/ panel.superpose / groups

2013-08-27 Thread Karin
Hello,   I am struggling with a lattice graph. I want to plot points and condition on a variable called 'Method'. For each conditional plot I have two subgroups, say: 'first'and 'second'. I want to plot the points in a conditional graph with a different color or symbol for each subgroup.  

[R] find row name with specific value

2013-08-27 Thread catalin roibu
Hello all! I want to find the first year where is fixed value (eg 2). My data is like this: HUMstdHUMres samp.depth 1592 0.5687519NA 1 1593 1.5251896NA 1 1594 1.8168727NA 1 1595 1.1265923 0.8253599 1 1596 0.8725422 0.7423323

Re: [R] find row name with specific value

2013-08-27 Thread Rui Barradas
Hello, Try the following. dat - read.table(text = HUMstdHUMres samp.depth 1592 0.5687519NA 1 1593 1.5251896NA 1 1594 1.8168727NA 1 1595 1.1265923 0.8253599 1 1596 0.8725422 0.7423323 2 1597 0.6744835 0.5443933

Re: [R] find row name with specific value

2013-08-27 Thread John Kane
Well I don't see anything that looks like a year but go from this dat1[match(2, dat1$samp.depth),] and pick off what you want I guess John Kane Kingston ON Canada -Original Message- From: catalinro...@gmail.com Sent: Tue, 27 Aug 2013 20:46:27 +0300 To: jrkrid...@inbox.com Subject: Re:

[R] transform row name in first column variable

2013-08-27 Thread catalin roibu
hello all! I have a problem! I don't know how to convert row names in first column variables. Thank you very much for your help! CR -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone

Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
Hello, If your data.frame is named 'dat', try the following. cbind(year = rownames(dat), dat) Hope this helps, Rui Barradas Em 27-08-2013 20:34, catalin roibu escreveu: hello all! I have a problem! I don't know how to convert row names in first column variables. Thank you very much for

Re: [R] Mapping help

2013-08-27 Thread MacQueen, Don
I'd suggest that r-sig-geo is a better choice for quick help in this case. Depending on how your data is currently stored, and given your short time frame, you might do better using software such as Quantum GIS, if you can get it installed quickly enough. In R, if you can get your data into an

Re: [R] transform row name in first column variable

2013-08-27 Thread David Winsemius
If the goal is to change row names and the replacements are unique the it is as easy as: rownames(dfrm) - newnames Include example data for more complete answers. -- David Sent from my iPhone On Aug 27, 2013, at 2:41 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, If your

[R] problem with package doMC: ignoring SIGPIPE signal

2013-08-27 Thread Jannis
Dear R users, since I updated to R-3.0 I get some error messages while using a parallelized process with the packages foreach and doMC. The error message is: Error: Error in sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) (from doMC.R#170) : ignoring SIGPIPE signal The

Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
Hello, One more thing, if you do cbind(year = rownames(dat), dat), then the year variable defaults to a factor. Maybe it's better if you transform it into numeric: cbind(year = as.numeric(rownames(dat)), dat) Rui Barradas Em 27-08-2013 21:09, catalin roibu escreveu: Thank you very much!

[R] the inverse of assign()

2013-08-27 Thread Robert Lynch
I am looking for a way to extract the name of a variable that has been passed into a function for example foo -function(x){ write.csv(x, file = paste(NAME(x), csv, sep =.)) } is there a function NAME that would let the calls foo(bar) write the file bar.csv and foo(stuff) write the file

Re: [R] the inverse of assign()

2013-08-27 Thread Hadley Wickham
It's not really the inverse of assign (that's get), but I think you want substitute. See http://adv-r.had.co.nz/Computing-on-the-language.html for more details. Hadley On Tue, Aug 27, 2013 at 4:13 PM, Robert Lynch robert.b.ly...@gmail.com wrote: I am looking for a way to extract the name of a

Re: [R] the inverse of assign()

2013-08-27 Thread Rolf Turner
Actually what's needed is deparse(substitute(...)): file = paste(deparse(substitute(x)),csv,sep=.)) I have no idea what deparse and substitute really mean; I just treat the forgoing as a black box/magic incantation. It works. cheers, Rolf Turner On 28/08/13 09:19, Hadley

[R] error installing ggm package

2013-08-27 Thread Lianne Schroeder
I'm new to R and trying to use the ggm package and I get the following message: library(ggm, lib.loc=/Library/Frameworks/R.framework/Versions/3.0/Resources/library) Loading required package: graph Error: package ‘graph’ could not be loaded In addition: Warning message: In library(pkg,

[R] Iterate over rows and update values based on condition

2013-08-27 Thread srecko joksimovic
Hi, I have a data set with structure similar to this: iduseraction 1 12 login 2 12 view 3 12 view 4 12 view 5 12 login 6 12 view 7 12 view 8 12 login I want to create a list of sessions. That means to split

Re: [R] the inverse of assign()

2013-08-27 Thread Duncan Murdoch
On 27/08/2013 4:38 PM, Rolf Turner wrote: Actually what's needed is deparse(substitute(...)): file = paste(deparse(substitute(x)),csv,sep=.)) I have no idea what deparse and substitute really mean; I just treat the forgoing as a black box/magic incantation. It works. In case anyone

Re: [R] Iterate over rows and update values based on condition

2013-08-27 Thread arun
Hi, May be this helps: dat1- read.table(text= id    user    action 1  12  login 2  12  view 3  12  view 4  12  view 5  12  login 6  12  view 7  12  view 8  12  login ,sep=,header=TRUE,stringsAsFactors=FALSE)

Re: [R] Iterate over rows and update values based on condition

2013-08-27 Thread srecko joksimovic
This is great! Thank you so much. On Tue, Aug 27, 2013 at 3:06 PM, arun smartpink...@yahoo.com wrote: Hi, May be this helps: dat1- read.table(text= iduseraction 1 12 login 2 12 view 3 12 view 4 12 view 5 12 login 6 12

Re: [R] Questions before installation

2013-08-27 Thread Uwe Ligges
On 26.08.2013 12:05, Tyagi, Shalabh wrote: Hi, As we are in thinking of installing and using R as a data analysis software on our machines, we have few questions before going ahead with the installation. Please find below the questions: 1) Does R allow data to be sent out or processed

Re: [R] error installing ggm package

2013-08-27 Thread David Winsemius
Not an error in installation of ggm , just a failure to install pkg graph -- David Sent from my iPhone On Aug 27, 2013, at 3:33 PM, Lianne Schroeder lsch...@uic.edu wrote: I'm new to R and trying to use the ggm package and I get the following message: library(ggm,

Re: [R] R Language Newbie

2013-08-27 Thread arun
Hi, set.seed(29) myVector- rnorm(100)  seq(1,100,by=2) # [1]  1  3  5  7  9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 #[26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 myVector[seq(1,100,by=2)] rev(myVector)  sum(myVector0) #[1] 46 #or  

Re: [R] error installing ggm package

2013-08-27 Thread Lianne Schroeder
I have tried to find pkg graph and R reports back that it doesn't exist for R 3.0.1, so how do I get ggm to work with out that? Or is there something that has replaced graph and ggm needs to be updated to work with it? Thanks, Lianne On Tuesday, August 27, 2013, David Winsemius wrote: Not an

Re: [R] labcurve - use of putKey function

2013-08-27 Thread Pascal Oettli
Hello, The following works for me: library(Hmisc) timeseries-c(1950,2000,2050,2100) dataseries-seq(1:4) dataseries1-c(1,2,3,4) dataseries2-c(1.5,2.5,3.5,4) plot(timeseries,dataseries,type=n) lines(timeseries,dataseries1,col=red,type=l) lines(timeseries,dataseries2,col=blue,type=l) curves-list()

Re: [R] error installing ggm package

2013-08-27 Thread Pascal Oettli
Hello, graph is a Bioconductor package. Regards, Pascal 2013/8/28 Lianne Schroeder lsch...@uic.edu I have tried to find pkg graph and R reports back that it doesn't exist for R 3.0.1, so how do I get ggm to work with out that? Or is there something that has replaced graph and ggm needs to

[R] Making predictions from a linear model

2013-08-27 Thread Abraham Mathew
I'm trying to educate myself about predictive analytics and am using R to generate a linear model with the following data. age - c(23, 19, 25, 10,9, 12, 11,8) steroid - c(27.1, 22.1, 21.9, 10.7, 7.4, 18.8, 14.7, 5.7) gpa - c( 2.1, 2.9, 2.8, 3.5, 3.2, 3.9, 2.8, 2.6) sample

[R] mcapply not using more than 1 core

2013-08-27 Thread joe meiring
I can't seem to get mclapply to use more than a single core. I have a 64 core server running Linux. Fore example: library(parallel) test - lapply(1:100,function(x) rnorm(1)) system.time(x - lapply(test,function(x) loess.smooth(x,x))) system.time(x - mclapply(test,function(x)

Re: [R] Daily Time series setting

2013-08-27 Thread Sudheer Joseph
Hi Jim, This won't work as R so not allow frequency which is a fraction. It accept only whole number frequencies. Do you have any example where it allows to put fraction as freqency ts(ru, start = c(2003, 1, 1), end = c(2008, 1, 1), frequency = 365.33) Error in ts(ru, start =

Re: [R] Daily Time series setting

2013-08-27 Thread Sudheer Joseph
Also, if that was the case, in below specification it should take the timeseries properly which so not takesplace. 1825/365 [1] 5 ts(ru, start = c(2003, 1, 1), end = c(2007, 12, 30), frequency = 365) On Wed, Aug 28, 2013 at 4:57 AM, Sudheer Joseph sjo.in...@gmail.com wrote: Hi Jim,

Re: [R] Daily Time series setting

2013-08-27 Thread Pascal Oettli
Hello, Use zoo instead. Regards, Pascal 2013/8/28 Sudheer Joseph sjo.in...@gmail.com Also, if that was the case, in below specification it should take the timeseries properly which so not takesplace. 1825/365 [1] 5 ts(ru, start = c(2003, 1, 1), end = c(2007, 12, 30), frequency = 365)

Re: [R] Making predictions from a linear model

2013-08-27 Thread Jeff Newmiller
In spite of your claim to be familiar with explanatory modeling, you are not describing your questions about R in terms of theory you would like to apply and assumptions you are willing to make. This list is about R, so don't go fishing for statistical advice. Have you read the help file for

Re: [R] error installing ggm package

2013-08-27 Thread jwd
Lianne, graph can be found here: http://bioconductor.org/packages/2.12/bioc/ You will need to read the bioconductor instructions. If you visit the R Project CRAN site, you can find packages there. Each package will have an associated description and a list of depends which are other packages