Re: [R] Can strptime handle milliseconds or AM/PM?

2013-01-17 Thread e-letter
Readers, Responding to an old post (http://tolstoy.newcastle.edu.au/R/e2/help/07/06/18850.html), and using the example in the manual: monthextract-strptime(20/2/06 11:16:16.683, %m) monthextract [1] NA Why is the result 'NA' and not '2'? -- r2151 __

Re: [R] Can strptime handle milliseconds or AM/PM?

2013-01-17 Thread Prof Brian Ripley
On 17/01/2013 07:59, e-letter wrote: Readers, Responding to an old post (http://tolstoy.newcastle.edu.au/R/e2/help/07/06/18850.html), and using the example in the manual: monthextract-strptime(20/2/06 11:16:16.683, %m) monthextract [1] NA Why is the result 'NA' and not '2'? Because you have

Re: [R] Aligning labels to bars in barplot

2013-01-17 Thread Jim Lemon
On 01/17/2013 04:51 AM, David Arnold wrote: Nice, worked very well. But because of the realignment, I now need to lower by xlab a bit. Any suggestions? Hi David, This should give you an idea of how to do it: par(mar=c(6,4,4,2)) plot(1:10,xlab=) mtext(Index,side=1,line=4) Jim

[R] path matrix

2013-01-17 Thread tsang
Hi everyone, I have got an adjacency matrix here which gives my graph in R. But is there any way to write Breadth First Search algorithm to obtain path matrix? I'm really new to R, can anybody please help? I know the idea but just don't know how to write it, basically I am trying to look at only

Re: [R] Mean calculation by two variables

2013-01-17 Thread arun
HI, May be this helps: Example$Wi-unlist(aggregate(Weight~ID,data=Example,function(x) round(x/sum(x),2))[,2]) res-do.call(rbind,lapply(split(Example,Example$Specie),function(x) with(x, {aggregate(Wi,list(Food.item),function(y) sum(y)/length(unique(x[,1])))}))) names(res)-names(Solution)[2:3]  

Re: [R] How to plot this simple step function?

2013-01-17 Thread Bornin1992
Thank you for your reply! When I copy and paste the code into the Console, I receive several errors! 1) Error in plot(x, y, type = n) : object 'x' not found segments(x[-length(x)],y[-length(x)],x[-1],y[-length(x)]) Error in segments(x[-length(x)], y[-length(x)], x[-1], y[-length(x)]) :

[R] Issue while installing Hmisc package

2013-01-17 Thread vaseem shaikh
Hi, Please find the snap shot attached for the error reported wile installing Hmisc Package. Is there any thing you can help me with. Currently using R i386 2.15.2 Version of R on windows 7 platform. Ragards Vaseem Shaikh attachment:

Re: [R] How to plot this simple step function?

2013-01-17 Thread Jeff Newmiller
you forgot to define the x and y variables that you provided as examples. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread Michael Weylandt
Try a different CRAN mirror. MW On Jan 17, 2013, at 7:42 AM, vaseem shaikh vsma...@gmail.com wrote: Hi, Please find the snap shot attached for the error reported wile installing Hmisc Package. Is there any thing you can help me with. Currently using R i386 2.15.2 Version of R on

Re: [R] read tab delimited file from a certain line

2013-01-17 Thread Christof Kluß
Hello thank you for the fast and helpful answer! Now the following works fine for me x - readLines(filename) i - grep(^year, x) dlf - read.table(textConnection(x[i:length(x)]), header = T, stringsAsFactors=F,sep=\t) Greetings Christof Am 16-01-2013 16:55, schrieb Rui Barradas:

Re: [R] Log scale on y axis of parallel coordinate plot (lattice)

2013-01-17 Thread Roland Seubert
Hello all, Thanks a lot for you help! Just in case someone else will have that same problem in the future: Meanwhile I also found out that ggplot2 gives you the option to freely swap x- and y-axes and apply a log-scale to whichever one you need: library(ggplot2) library(reshape2) molten

Re: [R] exporting simulated data

2013-01-17 Thread Jessica Streicher
Rather unspecific. Basically you'd need a loop to create the sets, and a way to write them into a file. You did not specify the format of your data. You might be able to use write, write.table or write.csv and the like. You could also have a look at ?save which allows you to save any R

Re: [R] exporting simulated data

2013-01-17 Thread Rui Barradas
Hello, Em 17-01-2013 11:56, Jessica Streicher escreveu: Rather unspecific. Basically you'd need a loop to create the sets, and a way to write them into a file. You did not specify the format of your data. You might be able to use write, write.table or write.csv and the like. You could also

[R] Colors in interaction plots

2013-01-17 Thread Iuri Gavronski
Hi, I am trying to plot an interaction.plot with different color for each level of a factor. It has an erratic behavior. For example, it works for the first interaction.plot below, with the example from the ALDA book, but not with the other plots, from the NPK dataset: # from

Re: [R] Colors in interaction plots

2013-01-17 Thread S Ellison
I was unable to run your code; 'fac' is missing and npk$fac in teh interaction.plot returns NA. data(npk, package=MASS) fit - by(npk, npk$block, function(bydata) fitted.values(lm(yield ~ N, data=bydata))) fit - unlist(fit) interaction.plot(npk$N, npk$block, fit, xlab=N, ylab=yield) # fake

[R] Making an aggregated factor variable from an existing one

2013-01-17 Thread Antti Simola
Hi, This is quite simple data manipulation task and I need help for it. I want to make new factor variable that is an aggregation of an existing factor. This works as I intended: X[Y == original label] - new label How to make following work then (to make coding more convenient):

Re: [R] Making an aggregated factor variable from an existing one

2013-01-17 Thread Gerrit Eichner
Hi, Antti, you should look at ?levels (and particular its Examples section) to find out how to use levels( X) - c( new1, ..., newk) to achieve what you want. Regards -- Gerrit On Thu, 17 Jan 2013, Antti Simola wrote: Hi, This is quite simple data manipulation task and I need

Re: [R] How to change R file in stats?

2013-01-17 Thread S Ellison
-Original Message- I have changed some code in R file inside the stats package (dendrogram.R). That was brave. Others have already commented on its wisdom... Now I wan to test and run the stats package with the new updated code, what should I do in detail? 1. Read and follow

Re: [R] How to change R file in stats?

2013-01-17 Thread Duncan Murdoch
On 13-01-17 8:31 AM, S Ellison wrote: -Original Message- I have changed some code in R file inside the stats package (dendrogram.R). That was brave. Others have already commented on its wisdom... Now I wan to test and run the stats package with the new updated code, what should I

Re: [R] How to change R file in stats?

2013-01-17 Thread S Ellison
Stats is a base package, so that won't work. Base packages are built and installed differently from other packages. Dang! Of course it is. Scratch previous response. The irony is that my first thought was indeed Read 'R Installation and configuration' with special attention to 'Building

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread R. Michael Weylandt
On Thu, Jan 17, 2013 at 12:57 PM, vaseem shaikh vsma...@gmail.com wrote: Hello Michael, I have tried with different CRAN but still i am getting the same error. Most likely you've got something blocking your network. Can you download the source / binary from the CRAN pages (using your

[R] how to use ...

2013-01-17 Thread Ivan Calandra
Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side

[R] coxph with smooth survival

2013-01-17 Thread Bond, Stephen
Hello users, I would like to obtain a survival curve from a Cox model that is smooth and does not have zero differences due to no events for those particular days. I have: sum((diff(surv))==0) [1] 18 So you can see 18 days where the survival curve did not drop due to no events. Is there a

Re: [R] how to use ...

2013-01-17 Thread R. Michael Weylandt
On Thu, Jan 17, 2013 at 2:36 PM, Ivan Calandra ivan.calan...@u-bourgogne.fr wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a

Re: [R] how to use ...

2013-01-17 Thread Berend Hasselman
On 17-01-2013, at 15:36, Ivan Calandra ivan.calan...@u-bourgogne.fr wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer

Re: [R] R and Windows 8

2013-01-17 Thread Gabor Grothendieck
On Wed, Jan 16, 2013 at 12:39 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jan 16, 2013 at 11:06 AM, Claire Oswald claire.j.osw...@gmail.com wrote: Hello: I'd like to know if R will run under Windows 8? I am running R on Windows 8 with no apparent problems. Actually I

Re: [R] coxph with smooth survival

2013-01-17 Thread Bond, Stephen
I also tried fitting a spline to the resulting survival curve and the result was horrible. maybe spline won't work or knots need special handling. overall, I must have the final point of the smooth survival to be same as the final point of the raw Cox survival and no flat days, the drops

Re: [R] equivalent code that doesn't return same results?

2013-01-17 Thread cwladis
William Dunlap wrote eval(parse(text=paste(dataset,IVcat[k],sep=$)))-relevel(eval(parse(text=paste(dataset,IVcat[k],sep=$))),ref=online) This code returns the following error: Error in eval(parse(text = paste(dataset, IVcat[k], sep = $))) - relevel(eval(parse(text = paste(dataset, : target of

[R] importing a SAS syntax-files (value labels)

2013-01-17 Thread David Studer
Hello everybody, I imported an SAS data-file into R. open.sas7bdat() did not work, so I had to convert it to csv first. Now I would like to recode the value values into factors. Unfortunately I only have a SAS syntax file, having this form: proc format; value $resstatus 'B'=

Re: [R] how to use ...

2013-01-17 Thread Ivan Calandra
Ok, it is that simple... Actually I had tried it but messed up so that it didn't work. Do you know where I can find some documentation about it? Regarding return(), I know that it's not necessary, but when the function gets more complicated, I like to have it because it becomes clearer to me.

Re: [R] R and Windows 8

2013-01-17 Thread Duncan Murdoch
On 17/01/2013 9:59 AM, Gabor Grothendieck wrote: On Wed, Jan 16, 2013 at 12:39 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jan 16, 2013 at 11:06 AM, Claire Oswald claire.j.osw...@gmail.com wrote: Hello: I'd like to know if R will run under Windows 8? I am running R on

Re: [R] how to use ...

2013-01-17 Thread Bert Gunter
Well.. On Thu, Jan 17, 2013 at 7:42 AM, Ivan Calandra ivan.calan...@u-bourgogne.fr wrote: Ok, it is that simple... Actually I had tried it but messed up so that it didn't work. Do you know where I can find some documentation about it? The R language definition manual would be the logical

[R] help with error: DV converted to a factor

2013-01-17 Thread cwladis
I've spent several days compiling the following code (I apologize in advance - this code is very inelegant, and I'm sure could be written much more efficiently, but I've stuck with whatever method I could get to work - sometimes the more efficient code I just couldn't get to work without an error,

Re: [R] Colors in interaction plots

2013-01-17 Thread S Ellison
Iuri: Your code as emailed reads: ## data(npk, package=MASS) fit - by(npk, npk$block, function(bydata) fitted.values(lm(yield ~ N, data=bydata))) fit - unlist(fit) interaction.plot(npk$N, npk$block, fit, xlab=N, ylab=yield) # fake factor, numeric fac - c(rep(1,12),rep(2,12)) # plots

Re: [R] importing a SAS syntax-files (value labels)

2013-01-17 Thread Anthony Damico
it is easy to parse through yourself. if you don't care about the labels and just want to import fixed-width file data, you can use the SAScii package. if you do, run this code to get 'em :) # load the stringr package to trim strings quickly library(stringr) # example proc format block-- #

Re: [R] create block diagonal with each rows

2013-01-17 Thread Martin Maechler
arun smartpink...@yahoo.com on Wed, 16 Jan 2013 19:20:46 -0800 writes: Hi, May be this helps: library(Matrix) res1-lapply(split(x,1:nrow(x)),function(y) sparseMatrix(i=rep(1:4,each=5),j=1:(4*5),x=y))  do.call(rbind,lapply(seq_along(res1),function(i)

[R] How do I get Garamond font in R?

2013-01-17 Thread Keith Weintraub
Folks, I run R on a early 2009 MacBook Pro running Mountain Lion. I have a bunch of fonts in my user Library one of which is Garamond. I have tried the ttf_import function to no avail. I played with this for a couple of hours at least and I have gotten nowhere. Here is a bit of one of my

[R] How to calculate monthly average from daily files in R?

2013-01-17 Thread Jonsson
I have 365 binary files: https://echange-fichiers.inra.fr/get?k=oy3CN1yV1Um7ouRWm2U ,I want to calculate the monthly average. So from the 365 files, I will get 12 files.I would like also to tell R not to take into account the no-data value (-32765).for example, for the first month, there are

[R] Naming an object after another object...can it be done?

2013-01-17 Thread mtb954
Hello R-helpers, I have run the following line of code: x-dat$col and now I would like to assign names(x) to be dat$col (e.g., a character string equal to the column name that I assigned to x). What I am trying to do is to assign columns in my dataframe to new objects called x and y. Then I

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread Wensui Liu
are you looking for assign()? On Jan 17, 2013 1:56 PM, mtb...@gmail.com wrote: Hello R-helpers, I have run the following line of code: x-dat$col and now I would like to assign names(x) to be dat$col (e.g., a character string equal to the column name that I assigned to x). What I am

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread mtb954
Hi Liu - I have been trying with assign() but it's not working. I don't think that's what I'm looking forany other ideas? Many thanks, Mark On Thu, Jan 17, 2013 at 1:11 PM, Wensui Liu liuwen...@gmail.com wrote: are you looking for assign()? On Jan 17, 2013 1:56 PM, mtb...@gmail.com

[R] How can i keep only latest entries?

2013-01-17 Thread Mat
Hello togehter, i have a data.frame like this one: No. Date last change 1 1 2012-10-04 change settings 2 1 2012-10-20 bug fix 3 1 2012-11-05 final 4 2 2013-01-15new task 5 2 2013-01-16Bug fix 6 2 2013-01-17final now i

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread vaseem shaikh
Hello Michael, I have tried with different CRAN but still i am getting the same error. But still, i am also trying to install the package by locally giving absolute path with repos= Null and type = Source, will CRAN have any role to play here??? BR- Vaseem Shaikh On Thu, Jan 17, 2013 at 3:03

[R] Explore patterns with GAM

2013-01-17 Thread spyros
Dear all, I new to r and I would like your help. I want to explore the patterns (unimodal, monotonically increased/decreased) of species richness~altitude using GAM in R. Although I run the gam function in mgcv package I do not know how to manually define knots and degrees of freedom. Any help

[R] Line breaks in documentation \useage

2013-01-17 Thread Markku Karhunen
Hi again, R community. I wonder how you do line breaks in \useage{} section in .Rd files. I am sure there's some tutorial for this somewhere, but I just haven't found it. I have tried \\, \cr, \br and \newline, admittedly arbitrarily, but all of these produce warnings or errors. br,

Re: [R] create block diagonal with each rows

2013-01-17 Thread arun
Hi, I tried with kronecker() do.call(rbind,lapply(1:4,function(i) t(kronecker(diag(4), x[i,]))[i,]))   # [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,]    1    5    9   13   17    0    0    0    0 0 0 0 0 0 #[2,]    0    0    0    0    0    2   

[R] crontab to Run R Code

2013-01-17 Thread Pinaki
Could not figure out where I am going wrong. Following is my code in crontab -e:- MAILTO: users MAILTO= users # m h dom mon dow command 3 19 * * * $HOME/users/REPORT/MAIL; time R --slave report.R [[alternative HTML version deleted]] __

[R] Help with interpolation

2013-01-17 Thread beanbandit
hi guys I need to interpolate values for the zero coupon yield curve. Following data is given

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread Patrick Burns
You are thinking that 'names' does something different than it does. What you seem to be after is the deparse-substitute idiom: dat - data.frame(Col1=1:10, Col2=rnorm(10)) myPlotFun - function(x, y) { plot(y ~ x, xlab=deparse(substitute(x)), ylab=deparse(substitute(y))) } myPlotFun(dat$Col1,

[R] plotting from dataframes

2013-01-17 Thread condor
thanks to your guys help I am closer to solving my problem but I have some small problem. So let's say I start with data number day hour 1 17 10 2 17 11 3 17 6 4 18 4 5 18 10 6 19 8 7 19 8 I want to

Re: [R] Getting discrete colors on plot

2013-01-17 Thread Mary
Hi, This is my first post; I'm new to R but am a senior statistical programmer. I have done a lot of graphs using SAS Graph but now am trying to transition to using graphs in R. I'm trying to produce a graph where the colors have three categories- ideally I would like them to be Green for

Re: [R] how to use ...

2013-01-17 Thread Steve Taylor
The ellipsis object is not listed in the base help pages! help(`+`) # this works - help on arithmetic operators help(+) # also works help(`...`) # fails with Error: '...' used in an incorrect context help(...) # fails also with No documentation for '...' in specified packages and libraries: you

Re: [R] Explore patterns with GAM

2013-01-17 Thread Andrew Robinson
Hi Spyros, I suggest that you borrow / buy the book that was written by the author of that package, and study it. It's Generalized Additive Models: An Introduction with R. There's a lot of stuff going on in GAM fitting that it would be worth paying close attention to. I hope that this helps,

Re: [R] crontab to Run R Code

2013-01-17 Thread Gergely Daróczi
Not sure if it would solve all your problems, but try to specify absolute path first e.g. for R, as *your* PATH is not available for the cronjob. Best, Gergely On Thu, Jan 17, 2013 at 2:53 PM, Pinaki pinakimah...@gmail.com wrote: Could not figure out where I am going wrong. Following is my

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread Patrick Burns
If you want the column names but not the data frame name, then you could do: with(dat, myPlotFun(Col1, Col2)) Pat On 17/01/2013 20:07, Patrick Burns wrote: You are thinking that 'names' does something different than it does. What you seem to be after is the deparse-substitute idiom: dat -

Re: [R] plotting from dataframes

2013-01-17 Thread Andrew Robinson
It's not really clear to me what you mean when you say that you want to plot the hours, so it's hard to help. Regardless, take a look at looping and plotting in any of the free documentation on CRAN. http://cran.r-project.org/other-docs.html I hope that this helps, Andrew On Fri, Jan 18,

Re: [R] how to use ...

2013-01-17 Thread Steve Taylor
Here's a link (on my local CRAN)... http://cran.stat.auckland.ac.nz/doc/manuals/r-release/R-intro.html#The-three-dots-argument -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Friday, 18 January 2013 4:54a To:

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread Bert Gunter
? But Pat... The canonical way to do this is: myPlotFin(Col2 ~ Col1, data = dat) I have no idea what the OP wants, but my guess is that the right answer is: Don't do that. Cheers, Bert On Thu, Jan 17, 2013 at 12:25 PM, Patrick Burns pbu...@pburns.seanet.com wrote: If you want the column

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread mtb954
Hi everyone, and thanks for your replies. Let me make this a little simpler. Please forget the plotting, that's not the issue. I have run the following line of code: x-dat.col Now, is there a function (or combination of functions) that will let me assign the character string dat.col to a new

Re: [R] How can i keep only latest entries?

2013-01-17 Thread Rui Barradas
Hello, Try the following. (I've named your data.frame 'dat') do.call(rbind, lapply(split(dat, dat$`No.`), tail, 1)) Hope this helps, Rui Barradas Em 17-01-2013 10:50, Mat escreveu: Hello togehter, i have a data.frame like this one: No. Date last change 1 1

[R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread mtb954
Hello R-helpers, I have run the following lines of code: x-cars$dist y-noquote(x) Now y is a string containing the characters cars$dist My questionis there an R function (or combination of functions) that I can apply to y that will cause y to contain the numbers in cars$dist? Even better,

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread Bert Gunter
On Thu, Jan 17, 2013 at 1:29 PM, mtb...@gmail.com wrote: Hi everyone, and thanks for your replies. Let me make this a little simpler. Please forget the plotting, that's not the issue. I have run the following line of code: x-dat.col Now, is there a function (or combination of functions)

[R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread C W
Dear list, How do you delete repeated samples? In MCMC, when your candidate value has been reject, so you remain on the same point, so you keep that value. Say I have this toy example, c(1,6,6,6,3,5,4,4,2,3,5) The 6 and 4 are repeated, I only want the index of the non-repeated values. I

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread Duncan Murdoch
On 13-01-17 4:50 PM, C W wrote: Dear list, How do you delete repeated samples? In MCMC, when your candidate value has been reject, so you remain on the same point, so you keep that value. Say I have this toy example, c(1,6,6,6,3,5,4,4,2,3,5) The 6 and 4 are repeated, I only want the index

[R] fastICA package: C, R codes provide vastly different results

2013-01-17 Thread Ranjan Maitra
Dear friends, I have been trying out the C and the R codes in the fastICA package. However, it turns out that these often give vastly different results, especially when row.norm is set to T. This happens even though I have initialized the input matrix to be exactly the same for both of them.

Re: [R] Naming an object after another object...can it be done?

2013-01-17 Thread David Winsemius
On Jan 17, 2013, at 1:29 PM, mtb...@gmail.com wrote: Hi everyone, and thanks for your replies. Let me make this a little simpler. Please forget the plotting, that's not the issue. I have run the following line of code: x-dat.col Now, is there a function (or combination of

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread Peter Langfelder
On Thu, Jan 17, 2013 at 4:57 AM, vaseem shaikh vsma...@gmail.com wrote: But still, i am also trying to install the package by locally giving absolute path with repos= Null and type = Source, will CRAN have any role to play here??? To compile a package on Windows, you need to install R tools

Re: [R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread David Winsemius
On Jan 17, 2013, at 1:36 PM, mtb...@gmail.com wrote: Hello R-helpers, I have run the following lines of code: x-cars$dist y-noquote(x) Now y is a string containing the characters cars$dist My questionis there an R function (or combination of functions) that I can apply to y

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread C W
Exactly what I am looking for. Thanks a lot! Mike On Thu, Jan 17, 2013 at 4:59 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 13-01-17 4:50 PM, C W wrote: Dear list, How do you delete repeated samples? In MCMC, when your candidate value has been reject, so you remain on the same

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread David Winsemius
On Jan 17, 2013, at 1:50 PM, C W wrote: Dear list, How do you delete repeated samples? In MCMC, when your candidate value has been reject, so you remain on the same point, so you keep that value. Say I have this toy example, c(1,6,6,6,3,5,4,4,2,3,5)

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread Bert Gunter
What answer is wanted for c(1,1,1,2,3,1) ? Note that Duncan's two suggestions below give different answers for this. -- Bert On Thu, Jan 17, 2013 at 1:59 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-01-17 4:50 PM, C W wrote: Dear list, How do you delete repeated samples? In

Re: [R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread mtb954
Hi David, I would like to have two objects, one containing the values in a column and the other containing the column's name. Of course, that's easy to do manually, but I don't want to have to type out the name of the column more than once (thus, below, I have typed it once in quotes, and I am

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread C W
I was looking for the first answer. In MCMC, at time t, when the candidate sample is rejected, candidate_sample[t] - current_sample say, at time t+1, the sample is rejected AGAIN, we have candidate_sample[t+1] - current_sample so, at time t, and t+1, we have the same value. When I

Re: [R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread David Winsemius
On Jan 17, 2013, at 2:26 PM, mtb...@gmail.com wrote: Hi David, I would like to have two objects, one containing the values in a column and the other containing the column's name. You have not addressed the question ... why? Where are you going with this? Of course, that's easy to do

Re: [R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread Bert Gunter
Inline below. -- Bert On Thu, Jan 17, 2013 at 3:02 PM, David Winsemius dwinsem...@comcast.net wrote: On Jan 17, 2013, at 2:26 PM, mtb...@gmail.com wrote: Hi David, I would like to have two objects, one containing the values in a column and the other containing the column's name. You

Re: [R] How to delete repeated values in MCMC sampling and get index of unique values?

2013-01-17 Thread Duncan Murdoch
On 13-01-17 5:33 PM, C W wrote: I was looking for the first answer. In MCMC, at time t, when the candidate sample is rejected, candidate_sample[t] - current_sample say, at time t+1, the sample is rejected AGAIN, we have candidate_sample[t+1] - current_sample so, at time t, and t+1, we

Re: [R] How to convert a string to the column it represents in a dataframe, with a reproducible example

2013-01-17 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of mtb...@gmail.com Sent: Thursday, January 17, 2013 2:27 PM To: David Winsemius; r-help@r-project.org Subject: Re: [R] How to convert a string to the column it represents in a

Re: [R] How can i keep only latest entries?

2013-01-17 Thread p_connolly
Quoting Mat matthias.we...@fnt.de: Hello togehter, i have a data.frame like this one: No. Date last change 1 1 2012-10-04 change settings 2 1 2012-10-20 bug fix 3 1 2012-11-05 final 4 2 2013-01-15new task 5 2 2013-01-16Bug fix 6

Re: [R] Sweave, Texshop, and sync with included Rnw file

2013-01-17 Thread michele caseposta
Hi, I just updated R and patchDVI (from CRAN). Now I can reverse search from the pdf to the included.Rnw. However, I cannot forward search from the included to the pdf. Is this how it is expected to work? Forward and inverse search work between main Rnw and pdf. I am pasting below the code in

Re: [R] Line breaks in documentation \useage

2013-01-17 Thread Rolf Turner
On 01/18/2013 12:33 AM, Markku Karhunen wrote: Hi again, R community. I wonder how you do line breaks in \useage{} section in .Rd files. I am sure there's some tutorial for this somewhere, but I just haven't found it. I have tried \\, \cr, \br and \newline, admittedly arbitrarily, but

Re: [R] how to use ...

2013-01-17 Thread Rolf Turner
The help facility is applicable to functions and data sets. It is not designed or intended to give help with respect to R syntax (with the exception of the basic syntax of the operators --- unary and binary --- and the associated rules of precedence). cheers, Rolf Turner On

[R] powerTransform Warning Message

2013-01-17 Thread Beatriz González
Hello, I would like to perform a Box-Cox (“bcPower”) transformation on my data. For this, I am determining lambda using the “powerTransform” function. However, with one of my variables I get the following Warning Message: In estimateTransform(x, y, NULL, ...) : Convergence failure:

Re: [R] Sweave, Texshop, and sync with included Rnw file

2013-01-17 Thread huang min
Anybody know if it is possible to use texshop and knitr with the sync working? I add a knitr engine but cannot sync. PS, I am comfortable with texshop but not RStudio. Huang On Fri, Jan 18, 2013 at 7:33 AM, michele caseposta mic.c...@gmail.comwrote: Hi, I just updated R and patchDVI (from

Re: [R] Sweave, Texshop, and sync with included Rnw file

2013-01-17 Thread Yihui Xie
Sweave produces foo-concordance.tex from foo.Rnw, and writes \input{foo-concordance.tex} in the LaTeX output. You can turn on the concordance option in knitr as well. Since you do not use RStudio, you have a couple of more steps to go: 1. borrow \Sconcordance from Sweave.sty; 2. manually

Re: [R] Colors in interaction plots

2013-01-17 Thread S Ellison
But I don't want to plot random colors. ... That's why I have this vector with length 24 - each one matches one line in the npk dataset. ... which is not what interaction.plot, or matplot, needs; it needs one per line on the plot. How can I inform to the interaction.plot function the color

Re: [R] Using table to get frequencies of several factors at once

2013-01-17 Thread Greg Snow
The tables package may be of use to you for this. On Fri, Jan 11, 2013 at 4:17 AM, Pancho Mulongeni p.mulong...@namibia.pharmaccess.org wrote: Hi, I have a dataframe with n columns, but I am only looking at five of them. And lots of rows, over 700. So I would like to find frequencies for

Re: [R] how to use ...

2013-01-17 Thread John Sorkin
Rolf Perhaps the philosophy of the help system needs to change . . . John Sent from my iPhone On Jan 17, 2013, at 7:11 PM, Rolf Turner rolf.tur...@xtra.co.nz rolf.tur...@xtra.co.nz wrote: The help facility is applicable to functions and data sets. It is not designed or intended to

Re: [R] how to use ...

2013-01-17 Thread David Winsemius
On Jan 17, 2013, at 7:00 PM, John Sorkin wrote: Rolf Perhaps the philosophy of the help system needs to change . . . John It's probably unwise to accept any one person's claim regarding the philosophy of the help system. If you have the time, energy and skills to construct a help page

Re: [R] Getting discrete colors on plot

2013-01-17 Thread Jim Lemon
On 01/18/2013 04:02 AM, Mary wrote: Hi, This is my first post; I'm new to R but am a senior statistical programmer. I have done a lot of graphs using SAS Graph but now am trying to transition to using graphs in R. I'm trying to produce a graph where the colors have three categories- ideally

[R] reading multiple key=value pairs per line

2013-01-17 Thread Frank Singleton
Hi, Thanks for a great environmentfor statistical computing :-) I have some input data in a file (input_kvpairs.csv) of the form key1=23, key2=67, key3=hello there key1=7, key2=22, key3=how are you key1=2, key2=77, key3=nice day, thanks Now in my head I wish it was of the form (input.csv)

Re: [R] Getting discrete colors on plot

2013-01-17 Thread arun
HI, May be this helps: mydata_long1-within(mydata_long,{colorvar-factor(colorvar,levels=1:3)}) require(ggplot2) p - ggplot(data=mydata_long1,       aes(x=variable, y=value, group=id, colour = colorvar)) +     geom_line() p A.K. - Original Message - From: Mary mlhow...@avalon.net To:

Re: [R] Getting discrete colors on plot

2013-01-17 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Mary Sent: Thursday, January 17, 2013 6:02 PM To: r-help@r-project.org Subject: Re: [R] Getting discrete colors on plot Hi, This is my first post; I'm new to R but am

Re: [R] reading multiple key=value pairs per line

2013-01-17 Thread Christophe Pallier
Maybe you can use ',=' as separators. ( I don't have R to check). Otherwise, I would clean the file with an editor or tool like 'sed' to replace the regular expression /key[0-9]=/ by nothing. On Jan 18, 2013 8:05 AM, Frank Singleton b17fly...@gmail.com wrote: Hi, Thanks for a great