Re: [R] Creating ODS RTF-style output in R XXXX

2011-08-30 Thread Dieter Menne
Dan Abner wrote: I have been using the sink() function as follows: x-rnorm(100) sink(C:\\Users\\dan\\Desktop\\Current Events\\myhw.txt, append=TRUE,split=TRUE) m1-c(Mean=mean(x),SD=sd(x),Min=min(x),Max=max(x)) m1 sink() === Is it possible to create tabular style output very much

Re: [R] How do I get a weighted frequency table?

2011-08-30 Thread Luca Meyer
Thank you, that's works just fine. Luca Il giorno 29/ago/2011, alle ore 23.48, H. T. Reynolds ha scritto: Hi, I use xtabs with the weight variable on the left hand side of the formula as in xtabs(weight ~ opinion + gender + ...) __

Re: [R] Saving a graph

2011-08-30 Thread Prof Brian Ripley
On Mon, 29 Aug 2011, Dieter Menne wrote: Gang Chen-4 wrote: However, my problem is that the file generated from a graph of fixed size is too large (in the order of 10MB) because of many data points in multiple scatterplots. Any suggestions? Generate pdf, open and save it in Adobe Acrobat

Re: [R] Ordinal logistic regression p-values

2011-08-30 Thread Rune Haubo
There is also clm() (for cumulative link models) from package ordinal that has much the same interface that polr() has, but it does give you p-values for the regression parameters. A simple example from examples(clm): library(ordinal) data(wine) fm1 - clm(rating ~ contact + temp, data=wine) (summ

Re: [R] Differences in SAS and R defaults

2011-08-30 Thread Nikhil Abhyankar
Yes, something similar would be helpful but not among SAS proc but between SAS and R. Thanks Nikhil On Mon, Aug 29, 2011 at 11:08 PM, Jeremy Miles jeremy.mi...@gmail.comwrote: Do you mean things like treatment of categorical variables in regression procedures (which have different defaults

Re: [R] Conditional plots in the soiltexture package

2011-08-30 Thread Julien Moeys
Dear Alessandro I am not sure what you mean by conditional plot But if it is about having a different symbol, for different soil parent materials, you can use the pch argument in TT.plot() ### require( soiltexture ) # :: 1st create a dummy texture dataset my.text - data.frame( CLAY

[R] R-Studio Question

2011-08-30 Thread Eran Eidinger
Hello, I've switched to R studio from the StatET Eclipse plug-in. I have a question regarding navigating between plots. When I use x11() or windows() new devices are created and I know how to switch back and forth between them. However, when I plot on the device that stands for R-Studio's

[R] Showing zero frequencies with xtabs

2011-08-30 Thread Luca Meyer
Hi, Does anyone know how to show zero frequencies variable levels with the xtabs command? They show with the table(x,y) command but I need to apply weight to frequency tables and I also need to cbind several tables together, which implies that they all need to show the same number of rows.

Re: [R] Showing zero frequencies with xtabs

2011-08-30 Thread peter dalgaard
On Aug 30, 2011, at 10:04 , Luca Meyer wrote: Hi, Does anyone know how to show zero frequencies variable levels with the xtabs command? They show with the table(x,y) command but I need to apply weight to frequency tables and I also need to cbind several tables together, which implies

Re: [R] Showing zero frequencies with xtabs

2011-08-30 Thread Petr PIKAL
Hi Hi, Does anyone know how to show zero frequencies variable levels with the xtabs command? They show with the table(x,y) command but I need to apply weight to frequency tables and I also need to cbind several tables together, which implies that they all need to show the same number

Re: [R] Configuring Proxy: Proxy Authentication Required with --internet2

2011-08-30 Thread behave
That was my first guess as well, but unfortunately this doesn't solve the problem. I is remarkably that IE requires authentification for every new instance I open (even if another instance is already open)... Any other hints? -- View this message in context:

[R] ARMA show different result between eview and R

2011-08-30 Thread Young Gyu Park
When I do ARMA(2,2) using one lag of LCPIH data This is eview result *Dependent Variable: DLCPIH **Method: Least Squares **Date: 08/12/11 Time: 12:44 **Sample (adjusted): 1970Q2 2010Q2 **Included observations: 161 after adjustments **Convergence achieved after 14 iterations **MA

Re: [R] Plotting multiple vectors in one window?

2011-08-30 Thread Joshua Wiley
Hi Caitlin, I would probably convert the data to a long format so bsa, unknown1, unknown2 are all in one variable and ditto for abs. Then control the plotting symbol using the variable indicator. abline() will just keep adding to the existing plot, so you could add all three lines of best fit

Re: [R] R-Studio Question

2011-08-30 Thread Iain Gallagher
Above the graph on the left there are back and forward arrows. You can use those (like a browser). This might have been better asked on the R-Studio forums. They're very friendly. best iain --- On Tue, 30/8/11, Eran Eidinger e...@taykey.com wrote: From: Eran Eidinger e...@taykey.com

Re: [R] Asking Favor For Remove element with Particular Value In Vector

2011-08-30 Thread Jim Lemon
On 08/30/2011 12:06 AM, Bert Gunter wrote: Jim et. al: This is the second time I've seen this advice recently. Use logical indexing: which(), though not wrong, is superfluous: x[ !x %in% c(0,255)] will do, rather than: By golly, you're right, and it works even if x is a logical vector. I

Re: [R] execute R commands from Matlab

2011-08-30 Thread Daniel Malter
They seem to have a workaround. I don't know whether anything better is available by now. http://www.mathworks.com/matlabcentral/newsreader/view_thread/163726 HTH, Daniel sarak wrote: Is it possible for anyone to upload a youtube video showing how to execute R commands in Matlab , it's so

Re: [R] execute R commands from Matlab

2011-08-30 Thread Daniel Malter
This seems to work, as well: http://www.mathworks.com/matlabcentral/fx_files/5051/1/content/Rdemo.html -- View this message in context: http://r.789695.n4.nabble.com/execute-R-commands-from-Matlab-tp3778263p3778282.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] ARMA show different result between eview and R

2011-08-30 Thread Daniel Malter
In your first line, you write ARMA(2,2). However, what you fit in R is ARIMA(2,1,2). What you fit in eview, I can't tell. Could that explain the difference? HTH, Daniel Young Gyu Park wrote: When I do ARMA(2,2) using one lag of LCPIH data This is eview result *Dependent Variable:

Re: [R] R-Studio Question

2011-08-30 Thread Eran Eidinger
I meant navigating through the command line, using R commands (like dev.set() for regular plots). Thank you for the reference, I will ask There. Eran. On Tue, Aug 30, 2011 at 11:37 AM, Iain Gallagher iaingallag...@btopenworld.com wrote: Above the graph on the left there are back and forward

Re: [R] weird apply() behavior

2011-08-30 Thread Daniel Malter
#Do apply(y,1,print) #Note the space that is inserted before the 1. If you insert this space in your function apply(y,1,function(x){x-unlist(x); if (!is.na(x[2]) x[2]=='2k' !is.na(x[1]) x[1]==' 1') 1 else 0} ) #you get the result you expect. #Also, note that your !is.na conditions are

Re: [R] Asking Favor For Remove element with Particular Value In Vector

2011-08-30 Thread jim holtman
But that is a good reason to always use parentheses: x[ !(x %in% c(0,255))] since some of the 'precendences' vary between languages. On Tue, Aug 30, 2011 at 4:47 AM, Jim Lemon j...@bitwrit.com.au wrote: On 08/30/2011 12:06 AM, Bert Gunter wrote: Jim et. al: This is the second time I've

Re: [R] Plotting multiple vectors in one window?

2011-08-30 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org On Behalf Of Caitlin Subject: [R] Plotting multiple vectors in one window? ...I have constructed three individual plots. Is there a convenient way to plot three vectors (not from a file) into one window? ?points and then

Re: [R] Simulating distribution of max of two die

2011-08-30 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jaap van Wyk Sent: 30 August 2011 04:57 To: r-help@r-project.org Subject: [R] Simulating distribution of max of two die how to find the distribution of the maximum of

[R] Why does loading saved/cached objects add significantly to RAM consumption?

2011-08-30 Thread Janko Thyson
Dear list, I make use of cached objects extensively for time consuming computations and yesterday I happened to notice some very strange behavior in that respect: When I execute a given computation whose result I'd like to cache (tried both saving it as '.Rdata' and via package 'R.cache'

Re: [R] ddply from plyr package - any alternatives?

2011-08-30 Thread Matthew Dowle
Adam, because I did not have time to entirely test Do you (or does your company) have an automated test suite in place? R 2.10.0 is nearly two years old, and R 2.12.0 is nearly one. Matthew AdamMarczak adam.marc...@gmail.com wrote in message news:1314385041626-3771731.p...@n4.nabble.com...

Re: [R] Choropleth in R

2011-08-30 Thread Oscar Perpiñan Lamigueiro
You can use spplot from sp. Some examples: http://blog.revolutionanalytics.com/2009/10/geographic-maps-in-r.html http://ryouready.wordpress.com/2009/11/16/infomaps-using-r-visualizing-german-unemployment-rates-by-color-on-a-map/ http://news.mrdwab.com/2010/05/16/choropleth-party-with-r/ Best,

[R] Help with the 'reshape' package

2011-08-30 Thread Filipe Leme Botelho
Hi all, I am reading previous posts and guidance on the 'reshape' package in order to solve the simple problem below. Thinking that this might be very trivial for most of you, I thought there could be a fast solution coming from you guys, and I´d be very thankful for that. I have a matrix

Re: [R] R versions and PostScript files

2011-08-30 Thread Prof Brian Ripley
On Fri, 22 Jul 2011, James Cloos wrote: Please do note the posting guide: the context you omitted (when explicitly asked not to) is in the thread starting: https://stat.ethz.ch/pipermail/r-help/2011-July/284352.html I suspect that a few s/def/bind def/ on that prologue might improve things

[R] url prep function (backslash issue)

2011-08-30 Thread Tyler Rinker
Greeting R Community, I am a windows user so this problem may be specific to windows. I often want to source files from within R such as: C:\Users\Rinker\Desktop\Research Law\Data\School Data 09-10. To source this file I need to go through the path and replace all the backslashes (\)

Re: [R] Help with the 'reshape' package

2011-08-30 Thread Petr PIKAL
Hi Hi all, I am reading previous posts and guidance on the 'reshape' package in order to solve the simple problem below. Thinking that this might be very trivial for most of you, I thought there could be a fast solution coming from you guys, and I´d be very thankful for that. I have

[R] Error in f(x, ...) : could not find function f2

2011-08-30 Thread . .
Hi all, I am getting the erro showed in the subject. I was strange the this becomes to happen after a computer restar. I think after the restart another function f2 was in memory and it scape from me. func - Vectorize(FUN= function(y, frac, rate, sad, samp=Poisson, trunc=0, ...){

Re: [R] url prep function (backslash issue)

2011-08-30 Thread Prof Brian Ripley
You seem to be looking for chartr(\\, /, path) (and FAQ Q7.8) What does any of this have to do with 'url prep': URLs are never written with backslashes? On Tue, 30 Aug 2011, Tyler Rinker wrote: Greeting R Community, I am a windows user so this problem may be specific to windows. I often

Re: [R] Saving a graph

2011-08-30 Thread Jannis
Chang Cheng, this question has been asked on this list for several times. I would suggest you search the list archive (http://r.789695.n4.nabble.com/R-help-f789696.html or www.rseek.com) prior to posting in the future. graph size many points pdf would give you at least 10 threads with

Re: [R] Conditional plots in the soiltexture package

2011-08-30 Thread samuel-rosa
Dear Julien It is exactly what I need. Thanks a lot. - Bc.Sc.Agri. Alessandro Samuel-Rosa Postgraduate Program in Soil Science Federal University of Santa Maria Av. Roraima, nº 1000, Bairro Camobi, CEP 97105-970 Santa Maria, Rio Grande do Sul, Brazil -- View this message in context:

Re: [R] ATSP to TSP reformulation

2011-08-30 Thread Michael Hahsler
Hi Ian, Your example runs for me without problems. It seems that you are using an older version of TSP. Please upgrade to the latest version TSP (update to TSP_1.0-3). I am using: sessionInfo() R version 2.13.1 (2011-07-08) Platform: i686-pc-linux-gnu (32-bit) locale: [1]

Re: [R] url prep function (backslash issue)

2011-08-30 Thread Tyler Rinker
Thank you Brian. When I wrote the email I typed url into the subject line by accident. I mean path. Thank you,Tyler Date: Tue, 30 Aug 2011 14:00:22 +0100 From: rip...@stats.ox.ac.uk To: tyler_rin...@hotmail.com CC: r-help@r-project.org Subject: Re: [R] url prep function (backslash

Re: [R] Configuring Proxy: Proxy Authentication Required with --internet2

2011-08-30 Thread Duncan Murdoch
On 30/08/2011 3:48 AM, behave wrote: That was my first guess as well, but unfortunately this doesn't solve the problem. I is remarkably that IE requires authentification for every new instance I open (even if another instance is already open)... Any other hints? You can read about how

Re: [R] url prep function (backslash issue)

2011-08-30 Thread Duncan Murdoch
Brian Ripley told you how to do the translation, but there's another problem: On 30/08/2011 8:14 AM, Tyler Rinker wrote: [ much deleted ] When I try the function the backslash gets me again: readyPath(C:\Users\Rinker\Desktop\Research Law\Data\School Data 09-10) The problem is that you

Re: [R] Showing zero frequencies with xtabs

2011-08-30 Thread Luca Meyer
Thanks Peter Petr, It was indeed an issue of having some character variables in there. Now it works just fine. Cheers, Luca Il giorno 30/ago/2011, alle ore 10.15, peter dalgaard ha scritto: On Aug 30, 2011, at 10:04 , Luca Meyer wrote: Hi, Does anyone know how to show zero

[R] RES: Help with the 'reshape' package

2011-08-30 Thread Filipe Leme Botelho
Petr, many thanks. It´s very straightforward to to deal with the package, I had different sources of revenues for same company, same month, like below, and just by adding sum at the end of the function it collapsed values from all sources. Very useful! Cheers cast(dta, Data~Company,

Re: [R] ATSP to TSP reformulation

2011-08-30 Thread Ian Deters
Dr. Hahsler, Thank you so much for looking at my code. I made sure that I had TSP_1.0-3 install and ran the code again (this time with - instead of = for my assignments). I received the same response. I checked my sessionInfo and did not see anything out of the ordinary. Does anything look

[R] R cmd build error -- running 'zip' failed

2011-08-30 Thread Pitt, Joel
Hi All, My attempts to build an R package on my Windows 7 computer using R V13.0 ir R V13.1 using R CMD build --binary filename have been failing at the penultimate step with the error message running 'zip' failed coming after the procedure has completed the MD5 sums step.The same

Re: [R] Exception while using NeweyWest function with doMC

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 11:29 AM, Simon Zehnder wrote: Hi David, thank you very much for your advice! I updated R and all my packages. Regrettably it doesn't work yet. But, I think, that the parallel processing (using 32bit) does improve time, especially when it comes to higher dimensions:

Re: [R] url prep function (backslash issue)

2011-08-30 Thread Tyler Rinker
Duncan, Thanks. Combined with what Brian Ripley wrote it all works. For future thread searchers this worked: oldstring - readline() C:\Users\Rinker\Desktop\Research Law\Data\School Data 09-10 chartr(\\, /,oldstring) Thank you both,Tyler # Date:

[R] multi-response regression with random forest

2011-08-30 Thread Cédric Mondy
Dear list, I performed a multivariate analysis on freshwater invertebrates data. So I obtained coordinates of my samples on the axes defining the first factorial plane (F1 and F2). I would like to see if the positions on my factorial plan could be linked to levels of impairment ('low' vs

Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
Hello, I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message body variable I am using. Here is what I mean: x [1] a b c d paste(x,collapse='\n')

[R] Negative length vector error in simple merge

2011-08-30 Thread DimmestLemming
Hi, I'm trying to take a vector (length almost 2,000,000) and merge it with a data frame of the same length. I'm trying to do it solely based on index, and not any other factors. The vector is called offense, and the data frame is just called data. I went with the simplest option:

[R] test message

2011-08-30 Thread Gabor Grothendieck
Please ignore this message. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Help with the 'reshape' package

2011-08-30 Thread Gabor Grothendieck
On Tue, Aug 30, 2011 at 7:42 AM, Filipe Leme Botelho filipe.bote...@vpar.com.br wrote: Hi all, I am reading previous posts and guidance on the 'reshape' package in order to solve the simple problem below. Thinking that this might be very trivial for most of you, I thought there could be a

[R] GMM with panel data

2011-08-30 Thread Cecilia Carmo
Hi everyone, I´m starting with GMM estimator for panel data in R. In fact I’m starting with GMM estimation with panel data, my research area is accounting and finance, so I’ve been reading many «econometric» books but I have some difficulties in applying GMM estimation. I’ve also read the

Re: [R] Exception while using NeweyWest function with doMC

2011-08-30 Thread Simon Zehnder
Hi Jay, first: thank u very much for your comments! U made some very important points clear. I tried immediately to write directly the sample function from trade-as.big.matrix(matrix(sample(c(1,-1), (N+1)*K, replace=TRUE),ncol=K), backingpath=backingpath,

[R] R crash

2011-08-30 Thread Ivan Calandra
Dear users, By running the script below, R crashes systematically at the last command, namely dev.off(), on Windows 7, but not on Windows XP. I therefore don't provide a reproducible example and do not really extract the relevant parts of the script because it has most likely nothing to do

Re: [R] Negative length vector error in simple merge

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 11:08 AM, DimmestLemming wrote: Hi, I'm trying to take a vector (length almost 2,000,000) and merge it with a data frame of the same length. I'm trying to do it solely based on index, and not any other factors. The vector is called offense, and the data frame is just

[R] algorithm to merge same entries in a matrix

2011-08-30 Thread Martin Batholdy
Hi, I have the following, rather unorthodox problem: I have a matrix that looks like this: m1 - matrix(c('a','b','d',NA,'c','c'), 2,3, byrow=TRUE) [,1] [,2] [,3] [1,] a b d [2,] NA c c now I would like to transform this matrix into this matrix: [,1] [,2] [,3] [,4]

Re: [R] R cmd build error -- running 'zip' failed

2011-08-30 Thread Duncan Murdoch
On 30/08/2011 11:05 AM, Pitt, Joel wrote: Hi All, My attempts to build an R package on my Windows 7 computer using R V13.0 ir R V13.1 using R CMD build --binaryfilename have been failing at the penultimate step with the error message running 'zip' failed coming after the procedure has

Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
Hello, (Sorry if this is a dup post...) I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message body variable I am using. Here is what I mean: x

Re: [R] Negative length vector error in simple merge

2011-08-30 Thread DimmestLemming
Thanks! I'd just never heard of cbind or rbind... bit new. -- View this message in context: http://r.789695.n4.nabble.com/Negative-length-vector-error-in-simple-merge-tp3778980p3779267.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] character vector to text with returns

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 1:09 PM, Ben qant wrote: Hello, (Sorry if this is a dup post...) I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message

[R] having trouble extracting week from chron object

2011-08-30 Thread Christopher W Ryan
Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) dts dts.chron - as.chron(dts) dts.chron class(dts.chron) # all of these component extractions work: months(dts.chron)

Re: [R] Negative length vector error in simple merge

2011-08-30 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of DimmestLemming Sent: Tuesday, August 30, 2011 10:20 AM To: r-help@r-project.org Subject: Re: [R] Negative length vector error in simple merge Thanks! I'd just never heard of

[R] column names with rbind loop

2011-08-30 Thread Vining, Kelly
Hello R users. This is a fairly basic question: I am concatenating data from sets of files in a directory using a loop. The column names in all files are exactly the same. My understanding is that rbind takes column names from the first file it reads. However, my output is showing that the

Re: [R] Gradient function in OPTIMX

2011-08-30 Thread Ravi Varadhan
Hi Kathie, The gradient check in optimx checks if the user specified gradient (at starting parameters) is within roughly 1.e-05 * (1 + fval) of the numerically computed gradient. It is likely that you have correctly coded up the gradient, but still there can be significant differences b/w

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread Jannis
Well, there is no function called weeks in chron. Funny that the help mentions it. You can, however, use normal POSIXct objects and extract the week with: dts - dates(c(02/27/92, 02/27/92)) dts.posx - as.POSIXct(dts) result - as.integer(format(dts.posx,format=%W)) HTH Jannis ---

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 1:36 PM, Christopher W Ryan wrote: Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) dts dts.chron - as.chron(dts) dts.chron class(dts.chron) # all of

[R] RPostgreSQL Loading Issues

2011-08-30 Thread Rich Shepard
I'm starting to seriously use R and have tried to solve this issue using my reference books but I'm missing something simple. Running R-2.13.1 on Slackware-13.1. Trying to invoke RPostgreSQL so I can copy data from a postgres table to an R data-frame. I installed RPostgreSQL and the

[R] lubridate and intervals

2011-08-30 Thread Justin Haynes
Hiya, maybe there is a native R function for this and if so please let me know! I have 2 data.frames with start and end dates, they read in as strings and I am converting to POSIXct. How can I check for overlap? The end result ideally will be a single data.frame containing all the columns of

Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
David, Yes, I understand that cat() won't do what I want, but that is the only way I can illustrate what I am after. Note the phrasing in my question: '...cat() like...' Regarding assigning the paste to a variable: it produces the same error. I've already tried that. Thanks for your

Re: [R] ATSP to TSP reformulation

2011-08-30 Thread Michael Hahsler
Hi Ian, I checked your example again and found the problem in tsp. fix(x) seems to create column names but not row names which exposes a bug in as.ATSP in tsp. This code replicates your error message: library(TSP) x - rbind(c(1,2,3,4), c(1,0,11,5), c(2,4,0,6), c(3,5,6,0)) colnames(x) - 1:4

Re: [R] rpart: apply tree to new data to get counts

2011-08-30 Thread Stephen Milborrow
Jay josip.2...@gmail.com het geskryf When I have made a decision tree with rpart, is it possible to apply this tree to a new set of data in order to find out the distribution of observations? Ideally I would like to plot my original tree, with the counts (at each node) of the new data. Sadly,

[R] locate the needed columns

2011-08-30 Thread Hui Du
Hi All, I have a data frame, whose colnames like A.x, B.x, C.x, A.y, B.y, C.y. There could be many columns like this pattern. I want to compare data in columns A.x with A.y, B.x with B.y and C.x with C.y etc. Suppose my data frame is d, names(d) = c(A.x, B.x, C.x, A.y, B.y,

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread Christopher W Ryan
Here it is with the output: library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) dts [1] 02/27/92 02/27/92 01/14/92 02/28/92 02/01/92 dts.chron - as.chron(dts) dts.chron [1] 02/27/92 02/27/92 01/14/92 02/28/92 02/01/92 class(dts.chron) [1] dates times # all of

Re: [R] Why does loading saved/cached objects add significantly to RAM consumption?

2011-08-30 Thread Henrik Bengtsson
Hi. On Tue, Aug 30, 2011 at 3:59 AM, Janko Thyson janko.thyson.rst...@googlemail.com wrote: Dear list, I make use of cached objects extensively for time consuming computations and yesterday I happened to notice some very strange behavior in that respect: When I execute a given computation

Re: [R] Error in f(x, ...) : could not find function f2

2011-08-30 Thread Uwe Ligges
On 30.08.2011 14:31, . . wrote: Hi all, I am getting the erro showed in the subject. I was strange the this becomes to happen after a computer restar. I think after the restart another function f2 was in memory and it scape from me. func- Vectorize(FUN= function(y, frac, rate, sad,

Re: [R] ATSP to TSP reformulation

2011-08-30 Thread Ian Deters
It worked fabulously. Thank you so much for help and time. -- View this message in context: http://r.789695.n4.nabble.com/ATSP-to-TSP-reformulation-tp3777105p3779476.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] column names with rbind loop

2011-08-30 Thread Weidong Gu
How about to add a conditional statement to get the header from 1st file for(i in all.files) { if (i==all.files[1]) new.data - read.table(i,header=TRUE) else { new.data - rbind(new.data, read.table(i))}} Weidong Gu On Tue, Aug 30, 2011 at 1:42 PM, Vining, Kelly kelly.vin...@oregonstate.edu

Re: [R] Multiple Traveling Salesperson Problem

2011-08-30 Thread Michael Hahsler
Hi Ian, There is currently no support for the mTSP in tsp. The paper Tolga Bektas, The multiple traveling salesman problem: an overview of formulations and solution procedures, Omega, 34(3), June 2006, Pages 209-219 describes some methods to reformulate a mTSP as a regular TSP. However, I

[R] ROC plot for KNN

2011-08-30 Thread Qian Liu
Hi I need some help with ploting the ROC for K-nearest neighbors. Since KNN is a non-parametric classification methods, the predicted value will be either 0 or 1. It will not be able to test for different cutoff to plot ROC. What is the package or functions I should use to plot ROC for KNN?

Re: [R] splitting into multiple dataframes and then create a loop to work

2011-08-30 Thread Nilaya Sharma
Thank you for the help. My focus was to split data frame for a different function, not lm. I could provide detail of that lengthy function instead I provided the lm function. The comment were very helpful. Thanks; NIL On Mon, Aug 29, 2011 at 3:37 PM, Dimitris Rizopoulos

Re: [R] column names with rbind loop

2011-08-30 Thread Vining, Kelly
Thanks much for your help! This almost works. However, now I am getting the following error: for(i in all.files) { + if (i==all.files[1]) new.data - read.table(i,header=TRUE) else { + new.data - rbind(new.data, read.table(i))}} Error in match.names(clabs, names(xi)) : names do not match

Re: [R] locate the needed columns

2011-08-30 Thread Weidong Gu
If the pattern is characterized by capital letters as your sample suggests. The following code may help df-list() names(d) = c(A.x, B.x, C.x, A.y, B.y, C.y) group.v-matrix(NA,nrow=3,ncol=2) ### you may need to modify nrow and ncol for (i in 1:3) { group.v[i,]-names(d)[grep(LETTERS[i],names(d))]

Re: [R] gradient function in OPTIMX

2011-08-30 Thread Rubén Roa
Hi, In my package CatDyn, which uses optimx, I included the gradients of 20 version of the model involved. I estimate model parameters with numerical gradients, and at the final estimates I calculate the analytical gradients. In the simplest version of the model the analytical gradients

Re: [R] Fwd: help with by command

2011-08-30 Thread amalka
Thanks very much for the help. I ended up getting it to work with one small change: by(foo, foo$V2, function(foo) mean(foo$trust, na.rm=T)) thanks again, Ari -- View this message in context: http://r.789695.n4.nabble.com/help-with-by-command-tp3766285p3779622.html Sent from the R help

[R] Generating a sequence of diagonal matrices

2011-08-30 Thread meddee
I am trying to generate a sequence of diagonal matrices. In the scalar case I would use something like, seq(0,100,by=1). How do I generalise the above for , say a 2 dimensional diagonal matrix. In other words how do I produce the series of diagonal matrices { diag(0,2),diag(1,2),

Re: [R] column names with rbind loop

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 3:46 PM, Vining, Kelly wrote: Thanks much for your help! This almost works. However, now I am getting the following error: for(i in all.files) { + if (i==all.files[1]) new.data - read.table(i,header=TRUE) else { + new.data - rbind(new.data, read.table(i))}} Error in

Re: [R] RPostgreSQL Loading Issues

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, Joe Conway wrote: Just a guess, but possibly because libpq.so (the postgres client library) is not being found. Joe, My initial thought, too. But, that's not it. 1) Do you have libpq.so installed on your system? 2) If so, where? 3) If it is not in a standard system

Re: [R] Generating a sequence of diagonal matrices

2011-08-30 Thread Joshua Wiley
Hi Meddee, Try this: dmat - lapply(1:100, function(d) diag(d, 2)) That will give you a list of all 100 matrices. Cheers, Josh On Tue, Aug 30, 2011 at 1:00 PM, meddee meddee1...@gmail.com wrote: I am trying to generate a sequence of diagonal matrices. In the scalar case I would use

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread David Winsemius
You did read jannis' reply didn't you? -- David. On Aug 30, 2011, at 2:34 PM, Christopher W Ryan wrote: Here it is with the output: library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) dts [1] 02/27/92 02/27/92 01/14/92 02/28/92 02/01/92 dts.chron -

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread Gabor Grothendieck
On Tue, Aug 30, 2011 at 1:36 PM, Christopher W Ryan cr...@binghamton.edu wrote: Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) Try this: as.numeric(cut(dts, weeks))

Re: [R] RPostgreSQL Loading Issues

2011-08-30 Thread Joe Conway
On 08/30/2011 10:53 AM, Rich Shepard wrote: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/rshepard/R/i486-slackware-linux-gnu-library/2.13/RPostgreSQL/libs/RPostgreSQL.so': libR.so: cannot open shared object file: No such file or directory Error:

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread Gabor Grothendieck
On Tue, Aug 30, 2011 at 4:43 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Tue, Aug 30, 2011 at 1:36 PM, Christopher W Ryan cr...@binghamton.edu wrote: Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts -

[R] Fwd: ARMA show different result between eview and R

2011-08-30 Thread John C Frain
-- Forwarded message -- From: John C Frain fra...@gmail.com Date: 30 August 2011 21:52 Subject: Re: [R] ARMA show different result between eview and R To: Young Gyu Park ygpa...@gmail.com If you check your manuals you will find that R uses full maximum likelihood while Eviews

[R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
I don't find how to do what I need to do in Dalgaard or 'R Cookbook', so I'm asking here. I have a data frame with water chemistry data and I want to start exploring these data. There are three factors (site, date, chemical) associated with each measurement. The data frame looks like this:

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Tal Galili
Hi Rich, It is a bit hard to read the summary you are using. Consider please pasting the output of: ls.str(chemdata) Regarding your question, please start and see if this work (I'm not sure, since it seems you have made some changes to the summary output, and I am only guessing how things

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:00 PM, Rich Shepard wrote: I don't find how to do what I need to do in Dalgaard or 'R Cookbook', so I'm asking here. I have a data frame with water chemistry data and I want to start exploring these data. There are three factors (site, date, chemical) associated with

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Wed, 31 Aug 2011, Tal Galili wrote: It is a bit hard to read the summary you are using. Consider please pasting the output of: ls.str(chemdata) Tal, Yes, summary() is inappropriate. I do want str() instead. And what that shows is: str(chemdata) 'data.frame': 14886 obs. of 1

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, David Winsemius wrote: It appears that your original file was delimited by | and your used something else, perhaps the default white-space setting? David, Yes, the csv file separator is the pipe. I think you need to go back and do your input operations again with

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:30 PM, Rich Shepard wrote: On Tue, 30 Aug 2011, David Winsemius wrote: It appears that your original file was delimited by | and your used something else, perhaps the default white-space setting? David, Yes, the csv file separator is the pipe. It is _not_ a csv

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, David Winsemius wrote: I think you need to go back and do your input operations again with sep=| David, Yes, that's better. I did not know of the sep option. The new results: str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site_id: Factor w/ 148

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:38 PM, Rich Shepard wrote: On Tue, 30 Aug 2011, David Winsemius wrote: I think you need to go back and do your input operations again with sep=| David, Yes, that's better. I did not know of the sep option. The new results: str(chemdata) 'data.frame': 14886

[R] putting in special characters in print statements

2011-08-30 Thread Erin Hodgess
Dear R People: Here is a question which probably has a very simple answer. I want to print \end{verbatim} in the output of a sink file. If I put in \end{verbatim} I get an unrecognized escape sequence. If I put in \\end{verbatim}, it runs fine, but the output is \\end{verbatim} How do I get

  1   2   >