[R] multcomp: Contrasts for Tukey

2014-06-18 Thread Andreas Maunz
I want to use the glht function. In the linfct argument, I provide my linear functions to be tested. I provide contrasts there, such as (for example) c(Group1 - Group2 = 0, Group1 - Group3 = 0) to compare group no 1 against the other groups. I want to do Tukey's test in this fashion. Is it

[R] title size problem

2014-06-18 Thread carol white
Hi, When I use any value greater than 2 for cex.main in title, I get  title(myTitle, cex.main= 5) Error in title(myTitle, cex.main = 5) :   X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 2 at size 60 could not be loaded How to fix it? Thanks Carol [[alternative HTML

[R] How to output name of object

2014-06-18 Thread yzh lin
Hi, every R user, I wanna output names of objects, I googled codes from website, but it was not what I wanted. the codes are as following: f - function (...) { unevaluatedArgs - substitute(...()) evaluatedArgs - list(...) stopifnot(length(unevaluatedArgs) == length(evaluatedArgs))

[R] how to decompose a daily time series

2014-06-18 Thread Charles Thuo
# I have a daily series of count of transactions data i want to decompose and forecast. d-c(723, 772, 967, 897, 621, 684, 722, 764, 856, 819, 678, 708, 698, 832, 928, 834, 649, 676, 635, 729, 778, 817, 616, 598, 605, 851, 822, 791, 678, 703, 716, 834, 872, 831, 641, 610, 699, 840, 901, 789, 620,

Re: [R] mgcv: I can't manually reconstruct a P-spline from a GAM's coefficients

2014-06-18 Thread Simon Wood
mgcv:gam automatically imposes sum-to-zero constraints on the smooths in a model (even if there is only one smooth). This is to avoid lack of identifiability with the intercept. The constraint removes one coefficient and shifts the curve... best, Simon On 17/06/14 15:40, Alexander Engelhardt

Re: [R] mgcv: BAM convergence conflicting messages

2014-06-18 Thread Simon Wood
I think it didn't converge. The warning message is for the whole fitting iteration, whereas mod07.3.BASE.bam5.1$converged indicates whether smoothing parameter selection converged at the final step of the iteration. best, Simon On 17/06/14 19:10, Trevor Davies wrote: I'm running some spatial

Re: [R] how to decompose a daily time series

2014-06-18 Thread Berend Hasselman
On 18-06-2014, at 10:50, Charles Thuo tcmui...@gmail.com wrote: # I have a daily series of count of transactions data i want to decompose and forecast. d-c(723, 772, 967, 897, 621, 684, 722, 764, 856, 819, 678, 708, 698, 832, 928, 834, 649, 676, 635, 729, 778, 817, 616, 598, 605, 851,

Re: [R] title size problem

2014-06-18 Thread Prof Brian Ripley
On 18/06/2014 08:14, carol white wrote: Hi, When I use any value greater than 2 for cex.main in title, I get title(myTitle, cex.main= 5) Error in title(myTitle, cex.main = 5) : X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 2 at size 60 could not be loaded How to fix it?

Re: [R] Aggregating 15 minute xts sequence to hourly

2014-06-18 Thread Joshua Ulrich
On Mon, Jun 16, 2014 at 7:04 AM, Costas Vorlow costas.vor...@gmail.com wrote: Dear Joshua, Thanks for your reply. As I see, the solution you suggest aligns the time stamps as required but leaves the aggregation results as is. Hence, the last quarter data of every hour are not aggregated

Re: [R] Aggregating 15 minute xts sequence to hourly

2014-06-18 Thread Costas Vorlow
Thanks Joshua. Your time and input is much appreciated as always. What will happen if I pick up manually the 00' hour. I.e., I count ever n'th (=4 quarters in my case) and pick up this observation, forming a new XTS object. I should not have any alignment problems then, should I? Example:

Re: [R] writeWorksheet(....,rownames..) warning

2014-06-18 Thread Knut Krueger
Am 17.06.2014 23:11, schrieb jim holtman: You were using 'rownames' incorrectly. Here is the correct way: library(XLConnect) wb - loadWorkbook(writeWorksheet.xlsx, create = TRUE) createSheet(wb, name = CO2) writeWorksheet(wb, CO2, sheet = CO2,rownames=Row Names) saveWorkbook(wb) Thank you I

Re: [R] How to output name of object

2014-06-18 Thread Jim Lemon
On Wed, 18 Jun 2014 04:24:58 PM yzh lin wrote: Hi, every R user, I wanna output names of objects, I googled codes from website, but it was not what I wanted. the codes are as following: f - function (...) { unevaluatedArgs - substitute(...()) evaluatedArgs - list(...)

Re: [R] How to output name of object

2014-06-18 Thread Prof Brian Ripley
On 18/06/2014 12:54, Jim Lemon wrote: On Wed, 18 Jun 2014 04:24:58 PM yzh lin wrote: Hi, every R user, I wanna output names of objects, I googled codes from website, but it was not what I wanted. the codes are as following: f - function (...) { unevaluatedArgs - substitute(...())

Re: [R] How to output name of object

2014-06-18 Thread Bert Gunter
Would f - function (...) { sapply(substitute(list(...)),deparse)[-1] } f(a1=log(1:4), m1=1:4, c1=pi) a1 m1 c1 log(1:4) 1:4 pi be equivalent? I find the substitute(...()) construction completely mysterious, while substitute(list(...)) makes sense to me.

Re: [R] C: drive memory full

2014-06-18 Thread David L Carlson
Windows 8 (and earlier versions) has a disk cleanup tool that will let you delete temporary files that might help. At the bottom of the screen on the taskbar, click the folder icon to bring up a windows showing your drives and folders. On the left side click on the drive you are interested in

Re: [R] C: drive memory full

2014-06-18 Thread jim holtman
One program that I have found valuable in looking at the size of files on disk is SequoiaView. It creates a 'treemap' of the sizes of the files and lets you zoom in to specific directories and such. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you

Re: [R] How to output name of object

2014-06-18 Thread Prof Brian Ripley
On 18/06/2014 15:01, Bert Gunter wrote: Would f - function (...) { sapply(substitute(list(...)),deparse)[-1] } f(a1=log(1:4), m1=1:4, c1=pi) a1 m1 c1 log(1:4) 1:4 pi be equivalent? I find the substitute(...()) construction completely mysterious, while

Re: [R] How to output name of object

2014-06-18 Thread Bert Gunter
Ah, yes. Much better -- that is what match.call() is for. As always, thanks for the insight, Best, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. Clifford Stoll On Wed, Jun 18,

Re: [R] Writing monthly .txt or .csv files from a long time series

2014-06-18 Thread Thomas Barningham
Hi David, Thank you for your help. The code you supplied is working, to an extent. However, i'm only outputting the first monthly file into my working directory. Apologies as I'm a relatively new to R, so please bear with my ignorance, have I not set up a loop correctly? Also, what is the

[R] Basic plot density question

2014-06-18 Thread Brian Smith
Hi, I wanted to plot two different density profiles. My code looks like: x1 - rnorm(100,mean=0,sd=1) x2 - rnorm(100,mean=1,sd=1) plot(density(x1),xlab=,col=red,main=) par(new=T) plot(density(x2),xlab=,col=blue,main=) However, the x-axis values don't match up for the two plots. Is there a way

Re: [R] prediction based on conditional logistic regression, clogit

2014-06-18 Thread peter dalgaard
On 17 Jun 2014, at 16:38 , Therneau, Terry M., Ph.D. thern...@mayo.edu wrote: As Peter D said, the clogit function simply sets up a special data set and then calls coxph, and is based on an identity that the likelihood for the conditional logistic is identical to the likelihood of a Cox

Re: [R] Basic plot density question

2014-06-18 Thread Bert Gunter
Try reading the docs! ?plot.default ... and note the xllim and ylim arguments. Have you read An Introduction to R or some other R tutorial. If not, you should do so before posting further. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information.

Re: [R] Basic plot density question

2014-06-18 Thread Greg Snow
First you should do your best to forget that you ever saw the command par(new=T), rip that page out of any book you saw it in, blacklist any webpage etc. In general (as you see) it causes more problems than it solves. Now to do what you want there are a couple of options, one of the simplest is

Re: [R] C: drive memory full

2014-06-18 Thread Hiyoshi, Ayako
Dear R users, Thank you so much for your help. I got deleted all files in my C:\xxx\AppData\Local\Temp file and also run suggested R codes to erase files. I list them below as somebody may be interested in. All in all, I got some space (1 GB) back, and compressing Stata data, I achieved what

Re: [R] Writing monthly .txt or .csv files from a long time series

2014-06-18 Thread jim holtman
You probably want: write.table(x, file = as.character(x$mon[1L])) because 'input$mon[1]' will always pick the same month (first one in 'input') Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jun

Re: [R] Basic plot density question

2014-06-18 Thread Brian Smith
Thanks Greg! On Wed, Jun 18, 2014 at 11:15 AM, Greg Snow 538...@gmail.com wrote: First you should do your best to forget that you ever saw the command par(new=T), rip that page out of any book you saw it in, blacklist any webpage etc. In general (as you see) it causes more problems than it

[R] Very very small problem...

2014-06-18 Thread Levent TERLEMEZ
Dear Users, This, substitute(paste(z,sigma)), small code doesn¡¦t work properly with text() within a loop z in ¡V3:3, except if i don¡¦t use print(z) while plotting. What may be the problem? This code is used in a user defined function. It was running in older versions. Thanks in advance.

Re: [R] Add points to subplots

2014-06-18 Thread Luca Cerone
Hi Greg and Jim. In the end I solved by modifying the function. I was just wondering if there is some function similar to Matlab's subplot, which let you change the active plot. Next time I will run in the same issue I will try the split.screen function proposed by Jim. Thanks a lot for the

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread MacQueen, Don
On my system (see info at the end) the plot succeeds. Can you plot other objects of class im? (see ?im for examples) Has it even been determined if the problem is with (a) the plotting process, or (b) the structure of the object being plotted? To check the structure of the object, you might

[R] How can I avoid the for and If loops in my function?

2014-06-18 Thread Laz
Dear R-users, I have a 3200 by 3200 matrix that was build from a data frame that had 180 observations, with variables: x, y, blocks (6 blocks) and treatments (values range from 1 to 180) I am working on. I build other functions that seem to work well. However, I have one function that has

Re: [R] Add points to subplots

2014-06-18 Thread Greg Snow
There is a subplot function in the TeachingDemos package, but its purpose is to put a small plot somewhere inside of a large plot. You can use it to position 2 plots on a blank plot. It does return the information that you need to then go back and modify the individual plots. However, it does

Re: [R] Pairwise Tukey test with letter in descending order

2014-06-18 Thread Cleber Chaves
Thanks, Jim, but I also tried with this recourse, and can't reach to the outcome I wanted... Cleber Chaves On Tue, Jun 17, 2014 at 9:22 PM, Jim Lemon j...@bitwrit.com.au wrote: On Tue, 17 Jun 2014 08:58:12 PM Cleber Chaves wrote: Dear all, has a long time that I unsuccessfully try to

Re: [R] mgcv: I can't manually reconstruct a P-spline from a GAM's coefficients

2014-06-18 Thread Alexander Engelhardt
Hello Simon, thanks for your response! I incorporated the intercept, i.e. coef(my_gam)[1] into the spline. That is, my B-spline coefficients are the intercept for the first one, and for all others I added the intercept to them (see the code below if I'm not clear) Now I *almost* reproduce

Re: [R] How can I avoid the for and If loops in my function?

2014-06-18 Thread Mramba,Lazarus K
Hi R-users, ### reproducible example: library(gmp) library(matlab) library(Matrix) library(foreach) library(MASS) library(mvtnorm) # ## A function to create a field experiment ## Returns a data frame, called matdf ##

[R] Publication-ready figures with two plots

2014-06-18 Thread Adam Hayward
Hi all, I have quite a specific problem with producing 300ppi plots in tiff format for publication. I have found ggsave to work beautifully with a single plot, which can then be exported to GIMP to compress the resulting large tiff file. However, it seems to run into trouble when plotting two

Re: [R] a workaround for indexing a function?

2014-06-18 Thread Adam Kustka
I noticed a missing line in the code associated with my question. I've re-supplied the question now with that line. Sorry for the trouble, Adam I have a dataset of peptide 15N/14N ratios from four experiments (where cells are grown under different conditions and were fed either

[R] a workaround for indexing a function?

2014-06-18 Thread Adam Kustka
I have a dataset of peptide 15N/14N ratios from four experiments (where cells are grown under different conditions and were fed either 15N or 14N nitrate aka plant food if you are interested) and I want to normalize each of these ratios to the median 15N/14N value from all 6000 peptides from each

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread Pablo Ramón
Dear Rolf, The problem persists with the function plot.im(), or plot (density ()), similar to with(bei.extra, plot (elev)). This problem occurs only with my personal machine, to another machine this problem does not occur. However, when I use another function, such kde2d () in the MASS package

Re: [R] How can I avoid the for and If loops in my function?

2014-06-18 Thread Jeff Newmiller
I don't feel any need to help you if you won't read the Posting Guide and follow its guidance... specifically you provide explanation (good) but not a reproducible example (see e.g. [1]) and you are posting in HTML which often corrupts your code (and is definitely not a

Re: [R] How can I avoid the for and If loops in my function?

2014-06-18 Thread jim holtman
First order of business, without looking in detail at the code, is to avoid the use of dataframes. If all your values are numerics, then use a matrix. It will be faster execution. I did see the following statements: newmatdf-Des[[i]] Des[[i]]-newmatdf why are you just putting

Re: [R] How can I avoid the for and If loops in my function?

2014-06-18 Thread lmramba
Hi Jim. If I avoid the dataframe, how can use the function model.matrix() to build the incident matrices X, And Z? I tried saving the design as matrix but ghen I got the wrong design matrix. Thanks. Laz Sent from my LG Optimus G™, an ATT 4G LTE smartphone -- Original

Re: [R] Publication-ready figures with two plots

2014-06-18 Thread Charles Berry
Adam Hayward a.hayward at sheffield.ac.uk writes: Hi all, I have quite a specific problem with producing 300ppi plots in tiff format for publication. I have found ggsave to work beautifully with a single plot, which can then be exported to GIMP to compress the resulting large tiff file.

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread Rolf Turner
Don, Pablo and I have been through all that. The structure of the im object was fine. I had no problem at all plotting the image on my system. Pablo could get nothing but blank plots on his system. The problem arose, as he said in a post just now, only on his personal machine. The

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread Rolf Turner
On 19/06/14 01:36, Pablo Ramón wrote: Dear Rolf, The problem persists with the function plot.im http://plot.im(), or plot (density ()), similar to with(bei.extra, plot (elev)). This problem occurs only with my personal machine, to another machine this problem does not occur. However, when I use

Re: [R] How can I avoid the for and If loops in my function?

2014-06-18 Thread jim holtman
One of the other things to do is to use Rprof to see where time is being spent. This will help focus on what has to be changed. This may point out how much time is being spent manipulating dataframes. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what

Re: [R] a workaround for indexing a function?

2014-06-18 Thread David Winsemius
See this? `[[alternative HTML version deleted]]` Means your efforts at including data have been sabotaged by failing to read the Posting guide and send plain text. Then this line:median[i] = median(normHL) Gets you: Error in median[i] = median(normHL) : object of type

[R] RWeka: how to pass arguments to BayesNet for specific search method

2014-06-18 Thread Valentin Kuznetsov
Hi, I'm trying to solve simple problem. How to pass arguments to specific search method in RWeka package using BayesNet classifier. Here is code example: BNet - make_Weka_classifier(weka/classifiers/bayes/BayesNet) K2=weka.classifiers.bayes.net.search.local.K2 wcontrol -

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread Christopher W. Ryan
Let me just say that the expertise and support on this List is amazing, and I'm very grateful. I'm learning a lot from your discussions. I will not be at my problematic machine again until Friday 20 June. I will take these steps then, and try to provide as many details about the system as I can.

Re: [R] RWeka: how to pass arguments to BayesNet for specific search method

2014-06-18 Thread p_connolly
My suggestion is not entirely satisfactory, but it's got me out of a few jams. When I can't get the RWeka syntax to work, I resort to using direct weka code in a system call. One such example looks like this and will make sense if you know how Weka does things. system(java