[R] Zero counts in an aggregate function

2011-05-16 Thread noellejm
Dear R-users, I've searched for an answer to my question, but so far haven't been able to find a solution. Its likely a simple issue, but have no idea how to do this. A simplified version my (very large) data set looks like this: > > bugs FRUIT SEED_ID SURVIVE 1 1 A 1 2

Re: [R] simulation from truncated poisson

2011-05-16 Thread cassie jones
It is truncated from left. On Mon, May 16, 2011 at 6:33 PM, Greg Snow wrote: > Which direction is it truncated? (only values less than a allowed or only > greater?). > > One simple approach is rejection sampling, just generate from a regular > poisson distribution, then throw away any values in

Re: [R] simulation from truncated poisson

2011-05-16 Thread cassie jones
Thanks for the help. I appreciate. On Mon, May 16, 2011 at 10:19 PM, Greg Snow wrote: > So there is no maximum value, just a minimum (greater than 0)? Correct? In > that case the sample option will not work (unless you choose some really > high value and say that you won’t go above that), but t

Re: [R] Question on approximations of full logistic regression model

2011-05-16 Thread Tim Hesterberg
My usual rule is that whatever gives the widest confidence intervals in a particular problem is most accurate for that problem :-) Bootstrap percentile intervals tend to be too narrow. Consider the case of the sample mean; the usual formula CI is xbar +- t_alpha sqrt( (1/(n-1)) sum((x_i - xbar

Re: [R] about spearman and kendal correlation coefficient calculation in "cor"

2011-05-16 Thread Baoqiang Cao
Thank you very much Thomas! I indeed learned a lot. Baoqiang On Tue, 2011-05-17 at 09:46 +1200, Thomas Lumley wrote: > } __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pro

Re: [R] simulation from truncated poisson

2011-05-16 Thread Greg Snow
So there is no maximum value, just a minimum (greater than 0)? Correct? In that case the sample option will not work (unless you choose some really high value and say that you won't go above that), but the rejection sampling would still work. How efficiently it works will depend on how much pr

[R] auto clustering with Rgraphviz: possible?

2011-05-16 Thread Mark Kimpel
I am working with about 600 nodes in an Rgraphviz graph. Within this graph there are, when plotted, about 8 obvious clusters that are highly connected within them but do not share connections between them. I have a wrapper function that handles a lot of tasks automatically for me like setting vario

[R] Dealing with null values Aggregate function

2011-05-16 Thread Andrew McFadden
Hi R users I trying to some aggregate statistics on a very large dataset. The null values are causing a problem. I would like to calculate aggregate values for groups. I am just no sure how to deal with the "" I would ideally like them to ignored ie if there is only 1 value over several columns th

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-16 Thread Bill.Venables
?relevel Also, you might want to fit the models as follows Model1 <- glm.nb(Cells ~ Cryogel*Day, data = myData) myData2 <- within(myData, Cryogel <- relevel(Cryogel, ref = "2")) Model2 <- update(Model1, data = myData1) &c You should always spedify the data set when you fit a model if at all p

Re: [R] changes in coxph in "survival" from older version?

2011-05-16 Thread Shi, Tao
Hi Frank, I know it's kind of beyond the scope of R help, but I would appreciate it if you can elaborate further on this. Are you worrying about this variable selection approach or you think that there is something wrong with the data (it's actually a real dataset)? If it's the first one, I

[R] pam() clustering for large data sets

2011-05-16 Thread Lilia Nedialkova
Hello everyone, I need to do k-medoids clustering for data which consists of 50,000 observations. I have computed distances between the observations separately and tried to use those with pam(). I got the "cannot allocate vector of length" error and I realize this job is too memory intensive. I

Re: [R] R CMD check: no visible binding for global variable

2011-05-16 Thread William Dunlap
If you install you package does the following work in a fresh R session library(yourPackage) annotIndex or do you need to say data(annotIndex) before using that object? (This may depend on whether yourPackage uses a namespace or not.) If so then adding the line LazyData: yes to DESCRIPTI

[R] Testing.

2011-05-16 Thread Rolf Turner
Please ignore this message. cheers, Rolf Turner __ 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,

[R] Subsetting depth profiles based on maximum depth by group with plyr

2011-05-16 Thread Sam Albers
Hello, Apologies for a similar earlier post. I didn't include enough details in that one. I am having a little trouble subsetting some data based on a grouping variable. I am using an instrument that does depth profiles of a water column. The instrument records on the way down as well as the way

Re: [R] R CMD check: no visible binding for global variable

2011-05-16 Thread Rolf Turner
Follow-up to my previous message; just remembered another work-around for the ``no visible binding'' note. Wrap up your calls that involve "annotIndex" in text strings and then evaluate these strings. E.g.: xxx <- "y <- x + annotIndex" eval(parse(text=xxx)) That will fool the package

Re: [R] simulation from truncated poisson

2011-05-16 Thread Greg Snow
Which direction is it truncated? (only values less than a allowed or only greater?). One simple approach is rejection sampling, just generate from a regular poisson distribution, then throw away any values in the truncated region. Another approach if the legal values are those from 0 to a, so

[R] simulation from truncated poisson

2011-05-16 Thread cassie jones
Dear all, I need to simulate values from a Poisson distribution which is truncated at certain value 'a'. Can anyone tell me if there is in-built package in R which can simulate from a truncated Poisson? If not, what should be the steps to write a function which would do that? Thanks in advance.

Re: [R] R CMD check: no visible binding for global variable

2011-05-16 Thread Rolf Turner
On 17/05/11 06:05, swaraj basu wrote: Dear All, I have built a package which has a data.frame "annotIndex.rda in its "data" folder. I am using this data frame within two functions in my package. Though my package works fine, yet when I do a

[R] Subsetting depth profiles based on maximum depth

2011-05-16 Thread Sam Albers
Hello, I am having a little trouble finding the right set of criteria to subset a portion of data. I am using an instrument that does depth profiles of a water column. The instrument records on the way down as well as the way up. ## So I am left with data like this: dat <- data.frame(var = runif

[R] Problem on glmer

2011-05-16 Thread Zhang,Yanwei
Hi all, I was trying to fit a Gamma hierarchical model using "glmer", but got weird error message that I could not understand. On the other hand, a similar call to the glmmPQL leads to results that are close to what I expect. I also tried to change tha "nAGQ" argument in "glmer", but it did not

Re: [R] nlrob(...) returns error message

2011-05-16 Thread David Winsemius
On May 16, 2011, at 4:19 PM, Timo Schlaefer wrote: Dear all, I implemented a non-linear model using nls(...) and it works just fine. I now tried to run the same model using nlrob(...) which basically does the same but uses a more robust estimation procedure. My problem: I cannot seem to

Re: [R] Using a sting in variable names

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 13:18 -0700, olafgy wrote: > Hi there, > > I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 > .dat" > into a respective table calld vpn1 to vpn100. > > I therfore have created a variable X<-1:100 > > I not want to use X as a subtitute for the numb

Re: [R] Using a sting in variable names

2011-05-16 Thread Duncan Murdoch
On 16/05/2011 4:18 PM, olafgy wrote: Hi there, I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 .dat" into a respective table calld vpn1 to vpn100. I therfore have created a variable X<-1:100 I not want to use X as a subtitute for the number in my filename, so that I

Re: [R] Adding same items together in data.frame

2011-05-16 Thread wong, honkit (Stephen)
Thanks !! This aggregate function is really powerful to do this kind of manipulation! Looks like R is quite versatile for text manipulation, I don't need to learn Perl language. Appreciate all your guys help! WONG, Hon-Kit (Stephen) Cleary Lab, Dept of Pathology Stanford University Lokey Stem C

[R] Inverse autocorrelation fonction

2011-05-16 Thread Jean-Baptiste Lepetit
I've been looking for an IACF() procedure in R for a long time (it's a very convenient function to check for overdifferencing time series), and eventually decided to write my own function. Here's what I came up with : 3 web-pages helped me estimate it : http://www.xycoon.com/inverse_autocorrelatio

[R] nlrob(...) returns error message

2011-05-16 Thread Timo Schlaefer
Dear all,   I implemented a non-linear model using nls(...) and it works just fine. I now tried to run the same model using nlrob(...) which basically does the same but uses a more robust estimation procedure. My problem: I cannot seem to get nlrob(...) running. Irrespective of how I try to call

[R] Draftsman plot axis modification

2011-05-16 Thread Michael Dolch
Dear all, I want to draw a draftsman plot using the pairs function and omit the axis labels of the diagonal panel which does not work. Is it also possible to remove the boxes of the diagonal panel? Here is an example what the graph looks like ## PC1<-c(1.1,1.2,1.

Re: [R] conditional rowsums in sapply

2011-05-16 Thread Assu
Hello David, I'm not sure I get your question; if you replied to SO, I had not seen it. I posted there today. I'm reading it now! I chose not to receive replies in my email from SO but I must change that. Thank you for making me see that! Sorry, I'm new to R-help and, especially, SO. Thanks for y

[R] using the predict function

2011-05-16 Thread Dave Evens
Dear all, I'm fitting a linear model with numerous lag terms of the response variable [i.e. y(t-1), y(t-2),y(t-3)...,] and other explanatory variables [x(1), x(2), x(3),]- which go into my design matrix X. I'm fitting the linear model: lm(Y ~ X, ...). I would like to use the predict.lm f

[R] Using a sting in variable names

2011-05-16 Thread olafgy
Hi there, I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 .dat" into a respective table calld vpn1 to vpn100. I therfore have created a variable X<-1:100 I not want to use X as a subtitute for the number in my filename, so that I have to write only one function and it

Re: [R] read a netcdf file _Fill_value=-32768

2011-05-16 Thread David William Pierce
On Fri, May 6, 2011 at 10:11 AM, francoise orain wrote: > Hello > I am a new user of R . > and I ve problem with R and netcdf . > I succed installation , I could use all examples . > But when I take my netcf it is different . > > I want to do statistic on this kind of file . > > 1) > first calcula

Re: [R] about spearman and kendal correlation coefficient calculation in "cor"

2011-05-16 Thread Thomas Lumley
On Tue, May 17, 2011 at 9:03 AM, Baoqiang Cao wrote: > Hi, > > I have the following two measurements stored in mat: > >> print(mat) >           [,1]     [,2] >  [1,] -14.80976 -265.786 >  [2,] -14.92417  -54.724 >  [3,] -13.92087  -58.912 >  [4,]  -9.11503 -115.580 >  [5,] -17.05970 -278.749 >  [6

[R] about spearman and kendal correlation coefficient calculation in "cor"

2011-05-16 Thread Baoqiang Cao
Hi, I have the following two measurements stored in mat: > print(mat) [,1] [,2] [1,] -14.80976 -265.786 [2,] -14.92417 -54.724 [3,] -13.92087 -58.912 [4,] -9.11503 -115.580 [5,] -17.05970 -278.749 [6,] -25.23313 -219.513 [7,] -19.62465 -497.873 [8,] -13.92087 -659.486 [

Re: [R] File to MYSQL

2011-05-16 Thread Phil Spector
If you're using the RMySQL package, the obvious choice for writing a data frame to a table is dbWriteTable. Note the append= argument, which if set to TRUE, will allow you to write as much or as little to the database as you need. But before you do that, you should probably try to understand how l

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 17:01 -0300, Nilza BARROS wrote: > Hi, Jerome > > I was trying to use RMYSQL > > for (i in length(Query)) { > rs1<-dbSendQuery(con,Query[i]) > } > > But although the Query have several lines the command above just feed > my database with the first one. > > > Query > [

[R] Problem installing Rcplex in ubuntu

2011-05-16 Thread kv
Dear List, I'm trying to install Rcplex on a ubuntu 64 bit machine, and have not been successful. After installing cplex latest version from ibm's website (everything as standard, except had it installed unto ~/ (the home directory) rather than the default directory). i type (from inside the

Re: [R] File to MYSQL

2011-05-16 Thread Nilza BARROS
Dear Jerome, I am a little ashamed about myself because the solutions is very easy. I thought I have already read help about write.table. But in fact I would like to use the RMysql to feed my database if you know something about I'd like to know. Bye and Thanks. On Mon, May 16, 2011 at 5:01 PM,

[R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-16 Thread Songer, Katherine B - DNR
Hi R experts, I'm attempting to run Linear Discriminant Analysis using the lda function in the MASS package. I've got around 50 predictor variables and one response variable. My response variable has 5 numeric categories that represent different clusters of fish abundance data (clusters were de

Re: [R] File to MYSQL

2011-05-16 Thread Patrick Connolly
On Mon, 16-May-2011 at 02:55PM -0300, Nilza BARROS wrote: |> Dear R-user, [...] |> 2) My script |> |> outfile<- with(as.data.frame(Alldados),sprintf("INSERT INTO OBS |> (date,TMAX_2M,TMIN_2M,TD_2M,PS,FF_10M,DD_10M,Station_NO) VALUES (%s, %s, %s, |> %s,%s,%s,%s,%s)",date2,TMAX_2M,TMIN_2M,TD_2M,P

Re: [R] File to MYSQL

2011-05-16 Thread Nilza BARROS
Hi, Jerome I was trying to use RMYSQL for (i in length(Query)) { rs1<-dbSendQuery(con,Query[i]) } But although the Query have several lines the command above just feed my database with the first one. > Query [1] "INSERT INTO OBS (date,T_2M,TMAX_2M,TMIN_2M,TD_2M,PS,FF_10M,DD_10M,TOT_PRCP,CLCL,

Re: [R] metaMDS and envfit: Help reading output

2011-05-16 Thread Songer, Katherine B - DNR
Thank you Michael; this was helpful! Katie -Original Message- From: Michael Denslow [mailto:michael.dens...@gmail.com] Sent: Wednesday, May 11, 2011 06:07 AM To: Songer, Katherine B - DNR Cc: r-help@r-project.org Subject: Re: [R] metaMDS and envfit: Help reading output Hi Katie, On Tue

Re: [R] metaMDS and envfit: Help reading output

2011-05-16 Thread Songer, Katherine B - DNR
Scott, Thanks very much! That thread was especially helpful. Katie P Katie Songer Water Resources Management Specialist Wisconsin Department of Natural Resources (*) phone: (608)264-8947 (*) e-mail: katherine.son...@wisconsin.gov From: Scott Chamberla

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 14:55 -0300, Nilza BARROS wrote: > Dear R-user, > > I have to feed my database using some SQL commands. I have already read a > data frame with the data I need but > after that these data should be write in a file wtih SQL commands. > > 1) My dataframe: > > dput(Alldados)

Re: [R] reading multiple .dbf files

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 08:40 -0700, Neera Thapa wrote: > Hello.. > I am currently working on running random forest to make predictions. For that > I > have a bunch of.dbf files from shapefiiles. Earlier I was running random > forest > on those dbf files individuallybut now I have >1,000 such fi

Re: [R] dir.choose analog of file.choose

2011-05-16 Thread jim holtman
?choose.dir On Mon, May 16, 2011 at 2:23 PM, Michael Friendly wrote: > Under Windows (and maybe others) you can use file.choose() as a substitute > for an explicit file= > argument in most places. > Is there an analog for what I'll call dir.choose(), so that I can say > > setwd(dir.choose()) > >

Re: [R] conditional rowsums in sapply

2011-05-16 Thread David Winsemius
On May 16, 2011, at 10:25 AM, Assu wrote: Hi all I have a data frame with duplicate columns and i want to remove duplicates by adding rows in each group of duplicates, but have lots of NA's. Data: dfrm <- data.frame(a = 1:4, b= 1:4, cc= 1:4, dd=1:10, ee=1:4) names(dfrm) <- c("a", "a", "b",

Re: [R] TR: Simulate keyboard

2011-05-16 Thread Thibault Charles
Thanks ! I'll do that, it seems easier with perl. Thibault Charles Solamen Audencia - 8 route de la Jonelière 44300 Nantes +33 2 40 37 46 76 Le 16 mai 2011 à 18:43, Philipp Pagel a écrit : > On Mon, May 16, 2011 at 01:50:15PM +0200, Thibault Charles wrote: >> Thank you for your response. >>

Re: [R] conditional rowsums in sapply

2011-05-16 Thread Dimitris Rizopoulos
assuming that the row entries for the columns with the same name are not all zero, you can try something in the following lines: dfrm <- data.frame(a = 1:4, a = 1:4, b = 1:4, b = 1:4, b = 1:4, check.names = FALSE) dfrm[3, 1:3] <- NA dfrm vals <- unlist(dfrm) res <- tapply(vals, names(vals),

Re: [R] changes in coxph in "survival" from older version?

2011-05-16 Thread Frank Harrell
Please don't be serious about doing variable selection with this dataset. Frank Shi, Tao wrote: > > Hi Terry, > > Really appreciate your help! Sorry for my late reply. > > I did realize that there are way more predictors in the model. My initial > thinking was use that as an initial model fo

[R] dir.choose analog of file.choose

2011-05-16 Thread Michael Friendly
Under Windows (and maybe others) you can use file.choose() as a substitute for an explicit file= argument in most places. Is there an analog for what I'll call dir.choose(), so that I can say setwd(dir.choose()) thx, -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, P

[R] Fwd: Re: rbind with partially overlapping column names

2011-05-16 Thread Peter Ehlers
I had meant to copy the list on this; must have hit 'Reply' instead of 'Reply All'. P Ehlers Original Message Subject: Re: [R] rbind with partially overlapping column names Date: Mon, 16 May 2011 11:14:11 -0600 From: Peter Ehlers To: Jonathan Flowers On 2011-05-16 08:56, Jon

[R] R CMD check: no visible binding for global variable

2011-05-16 Thread swaraj basu
Dear All, I have built a package which has a data.frame "annotIndex.rda in its "data" folder. I am using this data frame within two functions in my package. Though my package works fine, yet when I do a R CMD check to my packag

[R] Post-hoc tests in MASS using glm.nb

2011-05-16 Thread bryony
I am struggling to generate p values for comparisons of levels (post-hoc tests) in a glm with a negative binomial distribution I am trying to compare cell counts on different days as grown on different media (e.g. types of cryogel) so I have 2 explanatory variables (Day and Cryogel), which are bot

[R] conditional rowsums in sapply

2011-05-16 Thread Assu
Hi all I have a data frame with duplicate columns and i want to remove duplicates by adding rows in each group of duplicates, but have lots of NA's. Data: dfrm <- data.frame(a = 1:4, b= 1:4, cc= 1:4, dd=1:10, ee=1:4) names(dfrm) <- c("a", "a", "b", "b", "b") dfrm[3,2:3]<-NA dfrm a a b b b

[R] reading multiple .dbf files

2011-05-16 Thread Neera Thapa
Hello.. I am currently working on running random forest to make predictions. For that I have a bunch of .dbf files from shapefiiles. Earlier I was running random forest on those dbf files individually but now I have >1,000 such files and procesisng one by one is not an option. I started by tr

[R] Logistic regression model returns lower than expected logit

2011-05-16 Thread d_chall
Hi all, I'm using a logistic regression model (created with 'glm') with 3 variables to separate true positives from errors in a data set. All in all it seems to perform quite well, but for some reason the logit values seem to be much lower that they should be. What I mean is that in order to get ~9

[R] SEM Model Not Converging

2011-05-16 Thread Sam Stewart
I'm trying to build a SEM using the sem package. I'll attach my model specification below. When I turn debug=TRUE, it seems as if I'm getting to convergence because I get this message: Successive iterates within tolerance. Current iterate is probably solution. However, at the end of the process

Re: [R] changes in coxph in "survival" from older version?

2011-05-16 Thread Shi, Tao
Hi Terry, Really appreciate your help! Sorry for my late reply. I did realize that there are way more predictors in the model. My initial thinking was use that as an initial model for stepwise model selection. Now I wonder if the model selection result is still valid if the initial model did

[R] File to MYSQL

2011-05-16 Thread Nilza BARROS
Dear R-user, I have to feed my database using some SQL commands. I have already read a data frame with the data I need but after that these data should be write in a file wtih SQL commands. 1) My dataframe: dput(Alldados) structure(list(Station_NO = c(836490, 836920, 836950, 836980, 837380, 83

Re: [R] help: Using hotelling for a confidence region for PCA scores

2011-05-16 Thread Greg Hirson
Jessica, Take a look at the FactoMineR and SensoMineR packages: http://cran.r-project.org/web/packages/FactoMineR/ http://cran.r-project.org/web/packages/SensoMineR/ Best, Greg On 5/16/11 2:14 AM, Jessica Minkue wrote: > Hello everyone. > > In my last post I did not explained my problem quite w

Re: [R] Simulating correlations with varying sample sizes

2011-05-16 Thread Dennis Murphy
Hi: A more 'R-ish' way to do this would be to use sapply() in place of the loop as follows: N = c(1000,100,80,250,125,375,90,211,160,540) corrfun <- function(n) { require(MASS) dat <- mvrnorm(n=n, mu=c(0,0), Sigma=matrix(c(1,.3,.3,1), 2)) r <- cor(dat)[1, 2] } sapply(N, corrfun) # My

Re: [R] TR: Simulate keyboard

2011-05-16 Thread Philipp Pagel
On Mon, May 16, 2011 at 01:50:15PM +0200, Thibault Charles wrote: > Thank you for your response. > > In this case, do you think it is possible to write a little program in java > which would execute my script and simulate a press on my keyboard ? I think you need to do it the other way round: let

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Adele_Thompson
Re-sizing within the dev command works well. I'm not sure why I would need the dev.off(). I have the plot commands run. Then I have the dev.copy2pdf command. Thanks again for your help. -Original Message- From: greg.s...@imail.org [mailto:greg.s...@imail.org] Sent: Monday, May 16, 2011

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Greg Snow
If your goal is to end up with a pdf file, then I would suggest creating the pdf file directly using the pdf function (you can specify height and width in the function) then run your commands to create the plot and use dev.off() to finish. You often get different results when writing directly t

Re: [R] rbind with partially overlapping column names

2011-05-16 Thread Jonathan Flowers
Hi all, Thanks for your responses. The merge output works for the test case as Bill pointed out, but is contingent on non-overlapping values. Thanks for pointing this out Ian. My actual dataset needs to allow for overlapping values (sorry for the poor test case) so I will cook up something like

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Adele_Thompson
I just saw this post: http://r.789695.n4.nabble.com/X11-plot-window-sizes-td900509.html where is explains that the window size cannot be larger than 85% of your screen. I'm not sure what you are referring to about the copying the whole region, not just the plot. Also, I remember using the width a

Re: [R] Changing x-axis when dealing with time

2011-05-16 Thread Ken
Ken bu.edu> writes: > # create "chron" time vector > library(chron) > excel.dates <- seq(40179.0 + 1/6, 40180.0 + 1/6, 1/6) > orig <- chron("12/30/1899") > date.time <- orig + excel.dates; > time.only <- substr(date, 11, 18) Found one error in my script above. Correction: time.only <- substr(

Re: [R] Snow/Snowfall hangs on windows 7

2011-05-16 Thread luke-tierney
Thanks to Thomas, Steve, Uwe, and others for reporting the problem and suggesting fixes. A new version of snow is on its way to CRAN that hopefully fixes the problem on Windows without breaking tings elsewhere. I don't have access to Windows at the moment so if things don't work and you are willi

Re: [R] Changing x-axis when dealing with time

2011-05-16 Thread Ken
Pablo Rosado lbl.gov> writes: > > Hi, > > I am plotting data in which the x values are a timestamp. I am trying to > change the x-ticks so they will be in specified hours of the day, but it > always start from hour 4 of the day. And I need it to start from the > beginning of the axis (at x=0)

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Bert Gunter
Presumably you have read the help file and tried specifying width and/or height, right? Also, note the comment about copying the whole region, not just the plot. Does any of this help? -- Bert On Mon, May 16, 2011 at 7:41 AM, Schatzi wrote: > I am outputting the plot to a pdf file using the cod

Re: [R] wireframe advice - with reproducible code

2011-05-16 Thread Duncan Murdoch
On 16/05/2011 11:17 AM, Chris Mcowen wrote: Thanks for this, With the data i have what is the best method to convert it into the required matrix, as i am a little unsure how it would be done - i imagine this must be a common task? You can't convert it. Your data doesn't form a surface. You

Re: [R] wireframe advice - with reproducible code

2011-05-16 Thread Chris Mcowen
Thanks for this, With the data i have what is the best method to convert it into the required matrix, as i am a little unsure how it would be done - i imagine this must be a common task? Chris On 16 May 2011, at 16:05, Duncan Murdoch wrote: On 16/05/2011 10:57 AM, Chris Mcowen wrote: > Sorry,

Re: [R] wireframe advice - with reproducible code

2011-05-16 Thread Chris Mcowen
Sorry, My bad - I have notice you can remove the data call when using this and it works the same, also FD is the same as Residual_FD i just forgot i coded it different. wireframe(FD ~ Elevation * Temperature, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE) Sorry and thanks agai

Re: [R] wireframe advice - with reproducible code

2011-05-16 Thread Duncan Murdoch
On 16/05/2011 8:40 AM, Chris Mcowen wrote: Dear List, i am trying to produce a 3d plot using wireframe using the code: wireframe(Residuals_FD ~ Elevation * Temperature, data = data2, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE) As you can see when the code (using the data bel

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Schatzi
I am outputting the plot to a pdf file using the code: dev.copy2pdf(file="testing.pdf") The plots are too small though unless I first manually increase the size in R and then use the dev.copy command. Is there a way to automatically increase the window size? I tried fin and din, but those do not s

Re: [R] Survival Rate Estimates

2011-05-16 Thread Terry Therneau
I spoke too soon about tcut: it does not inherit from cut. The reason is that it preserves the original value, not just the category into which that value falls. Terry T. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Question on approximations of full logistic regression model

2011-05-16 Thread khosoda
Thank you for your comment, Prof. Harrell. I would appreciate it very much if you could teach me how to simulate for the estimation. For reference, following codes are what I did (bootcov, summary, and validation). MyFullModel.boot <- bootcov(MyFullModel, B=1000, coef.reps=T) > summary(MyFull

Re: [R] Survival Rate Estimates

2011-05-16 Thread Terry Therneau
>> pfit2 <- pyears(time, status) ~ acut + sex, data=mydata) >I think there was an omitted Surv function call above. Correct >And a follow on question and a tentative answer: Can one generate a >'pyears' table that incorporates categories of time observed by >tcut()- ting the time variable and

Re: [R] Simulating correlations with varying sample sizes

2011-05-16 Thread Holger Steinmetz
Wow, this was fast and helpful! Thank you very much. Best, Holger -- View this message in context: http://r.789695.n4.nabble.com/Simulating-correlations-with-varying-sample-sizes-tp3526231p3526288.html Sent from the R help mailing list archive at Nabble.com. ___

[R] MANOVA Post Hoc Testing Tukeys

2011-05-16 Thread wwreith
I used manova() with one predictor variable and four factor levels call them A, B, C, and D. There are 12 response variables. I now want to perform pairwise comparisons for A-B, A-C, etc. for all 12 response variables. If I were doing an ANOVA test I would run TukeyHSD() and be done. However mano

[R] RODBC sqlSave colnames argument - export to Excel

2011-05-16 Thread Ptashny, David
I'm trying to export a data frame to Excel using the RODBC sqlSave function. I don't want the colnames, so I use the colnames=F option. Unfortunately, the column names still show up as the first row in my spreadsheet. If I set the colnames=T, then the column names show up in BOTH rows 1 and 2. I

[R] wireframe advice - with reproducible code

2011-05-16 Thread Chris Mcowen
Dear List, i am trying to produce a 3d plot using wireframe using the code: wireframe(Residuals_FD ~ Elevation * Temperature, data = data2, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE) As you can see when the code (using the data below) is run the plot area is set-up correctly

Re: [R] Survreg object

2011-05-16 Thread Terry Therneau
-:begin inclusion --- There can be some risk in creating your own extraction methods, since the author of a package may have had reasons for not making it available, but in this case he did offer a table that includes the --end --- You are reading too deeply. When survreg was written 20+ y

Re: [R] Simulating correlations with varying sample sizes

2011-05-16 Thread Jorge Ivan Velez
Hi Holger, Replace "N" by "N[i]". HTH, Jorge On Mon, May 16, 2011 at 9:42 AM, Holger Steinmetz <> wrote: > Hi there, > > I would like to draw 10 correlations from a bivariate population - but > every > draw should be done with a different sample size. I thought I could to this > with a loop: >

[R] Simulating correlations with varying sample sizes

2011-05-16 Thread Holger Steinmetz
Hi there, I would like to draw 10 correlations from a bivariate population - but every draw should be done with a different sample size. I thought I could to this with a loop: r=numeric(10) #Goal vector N = c(1000,100,80,250,125,375,90,211,160,540) #Sample size vector for(i in 1:10) { data <

Re: [R] Question on approximations of full logistic regression model

2011-05-16 Thread Frank Harrell
The choice is not clear, and requires some simulations to estimate the average absolute error of the covariance matrix estimators. Frank 細田弘吉 wrote: > > Thank you for your reply, Prof. Harrell. > > I agree with you. Dropping only one variable does not actually help a lot. > > I have one more q

Re: [R] Russian language in R

2011-05-16 Thread Duncan Murdoch
On 16/05/2011 8:33 AM, Lyolya wrote: Dear Duncan, Thank you very much for your reply! I have tried what you have suggested. R was definitely assuming a different text encoding, and after trying the l10n_info() command, I got the following: l10n_info() $MBCS [1] TRUE $`UTF-8` [1] TRUE $`Lati

Re: [R] Russian language in R

2011-05-16 Thread Lyolya
Dear Duncan, Thank you very much for your reply! I have tried what you have suggested. R was definitely assuming a different text encoding, and after trying the l10n_info() command, I got the following: l10n_info() $MBCS [1] TRUE $`UTF-8` [1] TRUE $`Latin-1` [1] FALSE My data is a dataframe

Re: [R] integrate

2011-05-16 Thread Jonathan Daily
What exactly is the problem? Please read the posting guide and follow it. Your message is hard to interpret as is (in no small part because it looks like markup), contains no R code, and has no mention of an error at all. 2011/5/15 meltem gölgeli : > Dear R-users, > I'am really new at R. That's w

[R] MI help

2011-05-16 Thread Allen, Summer
Hi, I am trying to do multiple imputation on a panel of data and then, use the imputed values in stochastic frontier analysis. I am using this code just as a start to see if will run: mi(countrydata, n.iter = 30, R.hat = 1.1, max.minutes = 20, rand.imp.method = "bootstrap", run.past.conver

[R] filtering out unwanted words in a Term Document Matrix

2011-05-16 Thread Ingo Feinerer
> Hi Y'all, > > I am using the text mining package (tm). I am trying to filter out all of the > words in a Term Document Matrix that are not in a list of words that I am > interested in. I am using the following code: > > z<-tm_intersect(txt.dtm, c("communications", "safety", "climate", "blood

Re: [R] Matrix manipulation in for loop

2011-05-16 Thread jm_jem
hello I think if you try this: for(j in 1: length(nsample)){ MEANS[,]<-create.means.one.size(j,var,nboot) } it will work -- View this message in context: http://r.789695.n4.nabble.com/Matrix-manipulation-in-for-loop-tp3525849p3525888.html Sent from the R help mailing list arc

Re: [R] Snow/Snowfall hangs on windows 7

2011-05-16 Thread Uwe Ligges
Folks, I guess I know what is going on (and why I haven't seen this so far): All of you have installed R in a directory with blanks in it, right? Please source() the attached sock.R and afterwards try again. Does it work with SOCK clusters now? Then it was just the lack of quotes. CCing Luk

Re: [R] TR: Simulate keyboard

2011-05-16 Thread Thibault Charles
Thank you for your response. In this case, do you think it is possible to write a little program in java which would execute my script and simulate a press on my keyboard ? If yes, does anybody experiment it and could give me some help or advice ? Thanks, Thibault Charles Solamen Audencia - 8 r

Re: [R] TR: Simulate keyboard

2011-05-16 Thread Philipp Pagel
On Mon, May 16, 2011 at 11:27:05AM +0200, Thibault Charles wrote: > I cannot find a way to simulate a keyboard event as pressing the ?enter? > key. > for (i in 1:nombre_fichiers_monteCarlo){ > system(paste('"C:/Trnsys17/Exe/TRNExe.exe"',liste_dck_monteCarlo[i]),wait=TRUE) > } > > My problem is tha

Re: [R] Unexpected behaviour as.data.frame

2011-05-16 Thread Jan van der Laan
Santosh, Ivan, This is also what I was looking for. Thanks. Looking at the source of dataFrame.default is seems that it uses the same approach as I did: first create a list then a data.frame from that list. I think I'll stick with the code I already had as I don't want another dependency (mult

[R] Matrix manipulation in for loop

2011-05-16 Thread clips10
Hi all, I have a problem with getting my code to do what I want! This is the code I have: create.means.one.size<-function(nsample,var,nboot){ mat.x<-matrix(0,nrow=nboot,ncol=nsample) for(i in 1:nboot){ mat.x[i,]<-sample(var,nsample,replace=T) } mean.mat<-rep(0,nboot) for(i in 1

Re: [R] Unexpected behaviour as.data.frame

2011-05-16 Thread Ivan Calandra
Forget this last email, I oversaw the implementation in the examples... Ivan Le 5/16/2011 11:35, Ivan Calandra a écrit : Actually, what would be even better would be an extra argument to specify the column names. I don't think it's very difficult to implement and it would make things even easi

Re: [R] Unexpected behaviour as.data.frame

2011-05-16 Thread Ivan Calandra
Actually, what would be even better would be an extra argument to specify the column names. I don't think it's very difficult to implement and it would make things even easier. Ivan Le 5/16/2011 11:25, Ivan Calandra a écrit : Thanks Santosh! The more I learn about R.utils, the more I think tha

[R] TR: Simulate keyboard

2011-05-16 Thread Thibault Charles
Hello all R helpers, I really need your help… I cannot find a way to simulate a keyboard event as pressing the “enter” key. Does anyone know about it ? Thanks a lot, Thibault Charles Solamen Audencia - 8 route de la Jonelière 44300 Nantes +33 2 40 37 46 76 De : Thibault

  1   2   >