Re: [R] R-bash beginneR

2011-11-08 Thread David A.
Dear Jeff, thanks ever so much for your comment. Please excuse me, but is it really not an R question?? well, my IT support team at the lab said it is not an informatics question either, so what shall I do? Complain to my boss because they don't speak R?. I found information for an R

Re: [R] Sampling with conditions

2011-11-08 Thread Ted Harding
[Yet another correction -- this one is important. I start from scratch this time] On 07-Nov-11 22:22:54, SarahJoyes wrote: Hey everyone, I am at best, an amateur user of R, but I am stuck on how to set-up the following situation. I am trying to select a random sample of numbers from 0 to

Re: [R] rearrange set of items randomly

2011-11-08 Thread flokke
Sorry, but I dont think that I get what you mean (I am a quite new user though) I hae a data file of a sample, so I cannot use random numbers, the only thing I want to do is to randomly reassign the order of the items. -- View this message in context:

Re: [R] rearrange set of items randomly

2011-11-08 Thread Ted Harding
On 08-Nov-11 07:46:15, flokke wrote: Sorry, but I dont think that I get what you mean (I am a quite new user though) I hae a data file of a sample, so I cannot use random numbers, the only thing I want to do is to randomly reassign the order of the items. The simplest method of randomly

Re: [R] ordination in vegan: what does downweight() do?

2011-11-08 Thread Jari Oksanen
kelsmith kelsmith at usgs.gov writes: Can anyone point me in the right direction of figuring out what downweight() is doing? I am using vegan to perform CCA on diatom assemblage data. I have a lot of rare species, so I want to reduce the influence of rare species in my CCA. I have read

Re: [R] rearrange set of items randomly

2011-11-08 Thread Ted Harding
On 08-Nov-11 08:59:38, Ted Harding wrote: On 08-Nov-11 07:46:15, flokke wrote: Sorry, but I dont think that I get what you mean (I am a quite new user though) I hae a data file of a sample, so I cannot use random numbers, the only thing I want to do is to randomly reassign the order of the

Re: [R] ordination in vegan: what does downweight() do?

2011-11-08 Thread Gavin Simpson
On Mon, 2011-11-07 at 10:24 -0800, kelsmith wrote: Can anyone point me in the right direction of figuring out what downweight() is doing? I am using vegan to perform CCA on diatom assemblage data. I have a lot of rare species, so I want to reduce the influence of rare species in my CCA. I

[R] Reading a specific column of a csv file in a loop

2011-11-08 Thread Sergio René Araujo Enciso
Dear all: I have two larges files with 2000 columns. For each file I am performing a loop to extract the ith element of each file and create a data frame with both ith elements in order to perform further analysis. I am not extracting all the ith elements but only certain which I am indicating on

Re: [R] error message

2011-11-08 Thread Juliana Machado Ferreira
Ok, I got it, I found a stupid typing error. Just got the genind object. Tks J 2011/11/7 JulianaMF j...@ib.usp.br As I mentioned, the archives with the exact thread were back at the lab. Here they are: read.structure(file = SimStru.str) How many genotypes are there? 820 How many

Re: [R] Reading a specific column of a csv file in a loop

2011-11-08 Thread Gabor Grothendieck
2011/11/8 Sergio René Araujo Enciso araujo.enc...@gmail.com: Dear all: I have two larges files with 2000 columns. For each file I am performing a loop to extract the ith element of each file and create a data frame with both ith elements in order to perform further analysis. I am not

[R] skip on error

2011-11-08 Thread Alaios
Dear all, I have a different data sets and I am doing some calculations over time, For that every data set is split into junks based on the time stamps so one data set has like 10 timestamps. There is also the case that one data set has less than 10 timestamps. In my code I was doing the

Re: [R] Reading a specific column of a csv file in a loop

2011-11-08 Thread Jim Holtman
have you considered reading in the data and then creating objects for each column and then saving (save) each to disk. That way you incur the expense of the read once and now have quick access (?load) to the column as you need them. You could also use a database for this. On Nov 8, 2011, at

Re: [R] skip on error

2011-11-08 Thread Jim Holtman
?try Sent from my iPad On Nov 8, 2011, at 5:49, Alaios ala...@yahoo.com wrote: Dear all, I have a different data sets and I am doing some calculations over time, For that every data set is split into junks based on the time stamps so one data set has like 10 timestamps. There is also

[R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
Dear R-helpers, I want to split the following vector into 2 vectors by the last occurance of a . dput(rownames(sensext)) c(pat, cash_bank_bal, invest_abroad, pat.1, cash_bank_bal.1, invest_abroad.1, pat.2, cash_bank_bal.2, invest_abroad.2, pat.3, cash_bank_bal.3, invest_abroad.3, pat.4,

Re: [R] help to ... import the data from Excel

2011-11-08 Thread writinghealth
Sarah, it seems your current directory is not where your LTS.xls file is located. What I would is the following: always use the xlsReadWrite functions in the current directory where your excel file is located Also, just reaad the ENTIR excel sheet, rather than referencing columns. This the

Re: [R] R-bash beginner

2011-11-08 Thread Matteo Giani
On 11/07/2011 05:17 PM, David A. wrote: Hi, I am trying to run some R commands into my bash scripts and want to use shell variables in the R commands and store the output of R objects into shell variables for further usage in downstream analyses. So far I have managed the first, but how to

Re: [R] Estimate of intercept in loglinear model

2011-11-08 Thread Colin Aitken
Sorry about that. However I have solved the problem by declaring the explanatory variables as factors. An unresolved problem is: what does R do when the explanatory factors are not defined as factors when it obtains a different value for the intercept but the correct value for the fitted

Re: [R] iplots problem

2011-11-08 Thread agent dunham
I also have the same problem. Can you send me the link to download a proper Sun Java application (I have Microsot Windows XP Profesional V.2002)? Anyway, this is what I tried: library(JGR) Loading required package: JavaGD Loading required package: iplots Error : .onLoad failed in

Re: [R] Aggregate or extract function ?

2011-11-08 Thread Celine
Thanks for your help, I still have a little problem with this function because I don't have the same number of line in my two datarame so when I try to apply the dataframe function, I obtain this response ; that I have a different number of lines. Erreur dans data.frame(train, test[rowz, ]) :

Re: [R] variance explained by each predictor in GAM

2011-11-08 Thread huidongtian
Dear Prof. Wood, I read your methods of extracting the variance explained by each predictor in different places. My question is: using the method you suggested, the sum of the deviance explained by all terms is not equal to the deviance explained by the full model. Could you tell me what

Re: [R] Selecting 3 different hours in a day

2011-11-08 Thread Jim Holtman
attach another column to you dataframe with the hour of the day and then use 'subset' to collect the three hours of interest. Sent from my iPad On Nov 8, 2011, at 1:12, jck13 jennake...@hotmail.com wrote: Hello, I have a csv with 5months of hourly data for 4 years. I would like to get

Re: [R] How much time a process need?

2011-11-08 Thread Jim Holtman
could be that the process was waiting for the user to select a file from a list, or some other input before proceeding. Would have to see what the overall performance of the system was at that point. It could also have been that the process was low on physical memory and there was a lot of

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Gabor Grothendieck
On Tue, Nov 8, 2011 at 6:06 AM, Ashim Kapoor ashimkap...@gmail.com wrote: Dear R-helpers, I want to split the following vector into 2 vectors by the last occurance of a . dput(rownames(sensext)) c(pat, cash_bank_bal, invest_abroad, pat.1, cash_bank_bal.1, invest_abroad.1, pat.2,

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
Assuming we want to split off the number at the end try this which splits on those dots which are followed by a digit: strsplit(r, \\.(?=\\d), perl = TRUE) Dear Gabor, Thank you very much. That works very well. I don't completely understand it though. A few words on what the (?=\\d) is

[R] ggplot2 reorder factors for faceting

2011-11-08 Thread Iain Gallagher
Dear List I am trying to draw a heatmap using ggplot2. In this heatmap I have faceted my data by 'infection' of which I have four. These four infections break down into two types and I would like to reorder the 'infection' column of my data to reflect this. Toy example below:

Re: [R] similar package in R like SKEW CALCULATOR?

2011-11-08 Thread R. Michael Weylandt
See the replies given to you two days ago when you asked the same question: http://r.789695.n4.nabble.com/similar-package-in-R-like-quot-SKEW-CALCULATOR-quot-td3993216.html Feel free to follow up though with further questions, Michael On Tue, Nov 8, 2011 at 2:34 AM, Knut Krueger

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Gabor Grothendieck
On Tue, Nov 8, 2011 at 6:48 AM, Ashim Kapoor ashimkap...@gmail.com wrote: Assuming we want to split off the number at the end try this which splits on those dots which are followed by a digit: strsplit(r, \\.(?=\\d), perl = TRUE) Dear Gabor, Thank you  very much. That works very well. I

Re: [R] Unexpected behavior when browsing list objects by name, when the object name is a substring (prefix) of an existing object that has a valid value

2011-11-08 Thread R. Michael Weylandt
You've stumbled on one of the reasons use of the $ operator is discouraged in formal programming: it uses partial matching when given names. E.g., a = list(boy = 1:5, cat = 1:10, dog = 1:3) a$d #Exists If you want to require exact matching (and it seems you do), use the [[ operator. a[[d]] #

Re: [R] splitting by the last occurance of a dot

2011-11-08 Thread Ashim Kapoor
See the info on zero width lookahead assertions on the ?regex page. Thank you again. Best Regards, Ashim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Simple coordinate transformations

2011-11-08 Thread Matthew Young
Hi, I need to do some simple coordinate transforms between cartesian, cylindrical and spherical coordinates. I can't find any built in functions or packages to do this, is this because they do not exist? Obviously I can write my own code, but don't want to re-invent the wheel if I can

[R] Building package problem

2011-11-08 Thread Eduardo M. A. M. Mendes
Dear R-users I am trying to recompile a CRAN package on Windows 32. Rtools for 2.14 (that is the version I am running) and miktex were sucessfully installed on my machine. Problems: a) hydroGOF is a CRAN package, but R CMD check does not work on it. C:\Users\eduardo\Documents\R_tests2R CMD

Re: [R] Building package problem

2011-11-08 Thread Joshua Wiley
Hi Ed, If the only error is in examples then this should work: R CMD check --no-examples foopkg should not have anything to do with vignettes (although those may also not run, who knows). As far as building a binary, look at: R CMD INSTALL --help which leads you to R CMD INSTALL --build

Re: [R] ggplot2 reorder factors for faceting

2011-11-08 Thread Kenneth Frost
Hi, Iain- You might want to have a look at ?relevel i.e.  plotData$infection-relevel(plotData$infection, ref = 'InfC') Ken On 11/08/11, Iain Gallagher wrote: Dear List I am trying to draw a heatmap using ggplot2. In this heatmap I have faceted my data by 'infection' of

Re: [R] ggplot2 reorder factors for faceting

2011-11-08 Thread ONKELINX, Thierry
Dear Iain, RSiteSearch(ggplot2 reorder, restrict = c(Rhelp10, Rhelp08)) gives you the solution. Best regards, Thierry -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Iain Gallagher Verzonden: dinsdag 8 november 2011 12:51

[R] Export interactive linked graphs?

2011-11-08 Thread Rainer M Krug
Hi I am falling in love with iplots, especially the linked graphs, i.e. selecting points in one will highlight the same points in the other graph as well. But I would like to be able to export the graphs, so that I can give them to somebody else to be able to look at the graphs and explore the

Re: [R] Aggregate or extract function ?

2011-11-08 Thread Jean V Adams
Celine wrote on 11/08/2011 02:28:32 AM: Thanks for your help, I still have a little problem with this function because I don't have the same number of line in my two datarame so when I try to apply the dataframe function, I obtain this response ; that I have a different number of lines.

Re: [R] How much time a process need?

2011-11-08 Thread Alaios
Actually I want to have a rough approximation. A process that takes one day and a half it is good to send me how many hours it gets. It is not a problem to convert the values of system.error the major is that I am not sure If I should use the user or elapsed time for getting an estimation of

[R] save at relative directory

2011-11-08 Thread Alaios
Dear all, I have a variable called thres and before I run a script I set it to a value like thres- -10 at the end of the execution I am issuing a save(variablename,file='Results') which will end up with a file saved at the current directory with the name Results   I would like though to use thres

Re: [R] save at relative directory

2011-11-08 Thread Joshua Wiley
Hi Alex, Look at some of these functions: apropos(dir) apropos(exists) Cheers, Josh On Tue, Nov 8, 2011 at 5:36 AM, Alaios ala...@yahoo.com wrote: Dear all, I have a variable called thres and before I run a script I set it to a value like thres- -10 at the end of the execution I am

[R] match first consecutive list of capitalized words in string

2011-11-08 Thread Richter-Dumke, Jonas
Dear R-Helpers, this is my first post ever to a mailing list, so please feel free to point out any missunderstandings on my side regarding the conventions of this mailing list. My problem: Assuming the following character vector is given: names - c(filia Maria, vidua Joh Dirck Kleve (oo

[R] compare linear regressions

2011-11-08 Thread Holger Taschenberger
Hi, I'm trying to compare two linear regressions. I'm using the following approach: ## xx-1:100 df1 - data.frame(x = xx, y = xx * 2 + 30 + rnorm(n=length(xx),sd=10), g = 1) df2 - data.frame(x = xx, y = xx * 4 + 9 + rnorm(n=length(xx),sd=10), g = 2) dta - rbind(df1, df2)

Re: [R] How much time a process need?

2011-11-08 Thread jim holtman
The 'user' + 'system' will give you how much CPU is required which is an indication of how many of the CPU cycles you are using. The elapsed time is just how long it spent. If the script is CPU intensive, and there is no paging going on, you should see the CPU time close to the elapsed time.

[R] Rename a directory in R

2011-11-08 Thread Gavin Blackburn
Hi, I want to be able to rename a folder using R, similar to file.rename. I want to paste - done onto the folder name. The reason for this is we run a loop on a large number of folders on a server and it would be nice for people to be able to log in and instantly see if their data has been

Re: [R] compare linear regressions

2011-11-08 Thread R. Michael Weylandt
Yes, adding -1 or +0 both return a lm without an intercept term. Michael On Tue, Nov 8, 2011 at 8:52 AM, Holger Taschenberger holger.taschenber...@mpi-bpc.mpg.de wrote: Hi,        I'm trying to compare two linear regressions. I'm using the following approach: ## xx-1:100

Re: [R] Simple coordinate transformations

2011-11-08 Thread Duncan Murdoch
On 11-11-08 7:24 AM, Matthew Young wrote: Hi, I need to do some simple coordinate transforms between cartesian, cylindrical and spherical coordinates. I can't find any built in functions or packages to do this, is this because they do not exist? Obviously I can write my own code, but don't

[R] from points in Lon/Lat to physical distance in dist class

2011-11-08 Thread Mao Jianfeng
Dear R-listers, Here, I would like to hearing helps from you. I have GPS data (multiple points in the geographic scale) in longitude/latitude. I intend to calculate distance (in kilometer) among such points and output the distance matrix in dist class. I have gotten some progress, but I still

Re: [R] Rekeying value denoting NA

2011-11-08 Thread Jean V Adams
SML wrote on 11/07/2011 09:10:30 PM: I'm trying to rekey values which denote there is no values, i.e., '-999' in a dataset which contains both '-999' and NA entries. When I try the following command I get the following error: data.frame[data.frame$MAR = -9,MAR] - NA missing values

Re: [R] Rename a directory in R

2011-11-08 Thread jim holtman
apropos('rename') you will find 'file.rename' which also works on directories. On Tue, Nov 8, 2011 at 7:45 AM, Gavin Blackburn gavin.blackb...@strath.ac.uk wrote: Hi, I want to be able to rename a folder using R, similar to file.rename. I want to paste - done onto the folder name. The

Re: [R] from points in Lon/Lat to physical distance in dist class

2011-11-08 Thread David L Carlson
Look at distm() in package geosphere. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread R. Michael Weylandt michael.weyla...@gmail.com
Have you tried wrapping it in a function and using integrate()? R is pretty good at handling numerical integration. If integrate() isn't good for you, can you say more as to why? Michael On Nov 6, 2011, at 4:15 PM, JeffND zuofeng.shan...@nd.edu wrote: Hello to all, I am having trouble

Re: [R] compare linear regressions

2011-11-08 Thread Holger Taschenberger
Thank you. I was confused because the output of the line summary(lm(formula =... reads: Coefficients: (1 not defined because of singularities), which did not look like a normal message (which can safely be ignored) to me. --Holger On Tue, 8 Nov 2011 15:06:28 +0100 Peter Konings

Re: [R] Building package problem

2011-11-08 Thread Uwe Ligges
On 08.11.2011 13:50, Joshua Wiley wrote: Hi Ed, If the only error is in examples then this should work: R CMD check --no-examples foopkg Disabling the example checks is not the solution - well, it is the one to hide the errors, of course. should not have anything to do with vignettes

Re: [R] compare linear regressions

2011-11-08 Thread Jeff Newmiller
Just because your model specification is valid does not mean your data can be analyzed using that particular model specification. --- Jeff NewmillerThe . . Go Live...

Re: [R] Building package problem

2011-11-08 Thread Prof Brian Ripley
R CMD check is *not* 'building a package'. Nor is making a Windows binary package. 'Building a package' is creating a source tarball from a source directory. On Tue, 8 Nov 2011, Joshua Wiley wrote: Hi Ed, If the only error is in examples then this should work: R CMD check --no-examples

Re: [R] save at relative directory

2011-11-08 Thread Alaios
Hmm I will try something like that     if (file.exists('threshold')==FALSE)       dir.create(paste('./',abs(threshold)))     save(var,file=paste('./',abs(threshold),'/',DataSource[[4]],sep=) I just need a bit of confirmation If I am doing soemthing terribly wrong that might harm my filesystem.

Re: [R] save at relative directory

2011-11-08 Thread Uwe Ligges
On 08.11.2011 16:09, Alaios wrote: Hmm I will try something like that if (file.exists('threshold')==FALSE) dir.create(paste('./',abs(threshold))) save(var,file=paste('./',abs(threshold),'/',DataSource[[4]],sep=) I just need a bit of confirmation If I am doing soemthing

Re: [R] save at relative directory

2011-11-08 Thread Joshua Wiley
Hi Alex, For the R part, I would abstract it a bit: mydir - paste(./, abs(threshold), sep = ) if (!file.exists(mydir)) dir.create(mydir) save(var, file = paste(mydir, DataSource[[4]], sep = /)) if you use file.exists('threshold') you are testing for the existence of threshold, not the value

[R] window?

2011-11-08 Thread Kevin Burton
Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d - rep(1:53,2) (s - ts(d, frequency=53, start=c(2000,10))) n - length(s) k - n%/%3 for(i in (n-k):n) { st - c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] + i) %% frequency(s))

Re: [R] window?

2011-11-08 Thread Uwe Ligges
On 08.11.2011 16:26, Kevin Burton wrote: Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d- rep(1:53,2) (s- ts(d, frequency=53, start=c(2000,10))) n- length(s) k- n%/%3 for(i in (n-k):n) { st- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s),

Re: [R] RpgSQL row names

2011-11-08 Thread Ben quant
This is great, thanks! I have another unrelated question. I'll create a new email for that one. ben On Mon, Nov 7, 2011 at 4:16 PM, Gabor Grothendieck ggrothendi...@gmail.comwrote: On Mon, Nov 7, 2011 at 5:34 PM, Ben quant ccqu...@gmail.com wrote: Hello, Using the RpgSQL package, there

Re: [R] Rekeying value denoting NA

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 8:57 AM, Jean V Adams wrote: SML wrote on 11/07/2011 09:10:30 PM: I'm trying to rekey values which denote there is no values, i.e., '-999' in a dataset which contains both '-999' and NA entries. When I try the following command I get the following error:

Re: [R] Rename a directory in R

2011-11-08 Thread Gavin Blackburn
Thanks Jim, I didn't think it worked on directories but I've got it working now. Cheers, Gavin. -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: 08 November 2011 14:18 To: Gavin Blackburn Cc: r-help@r-project.org Subject: Re: [R] Rename a directory in R

Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 9:43 AM, R. Michael Weylandt wrote: Have you tried wrapping it in a function and using integrate()? R is pretty good at handling numerical integration. If integrate() isn't good for you, can you say more as to why? Michael On Nov 6, 2011, at 4:15 PM, JeffND

Re: [R] similar package in R like SKEW CALCULATOR?

2011-11-08 Thread Knut Krueger
Am 08.11.2011 13:01, schrieb R. Michael Weylandt: See the replies given to you two days ago when you asked the same Hi Michael, thank you for your second answer. I did not get my first question and I did not get your answer via mail - strange Knut

[R] multi-line query

2011-11-08 Thread Ben quant
Hello, I'm using package RpgSQL. Is there a better way to create a multi-line query/character string? I'm looking for less to type and readability. This is not very readable for large queries: s - 'create table r.BOD(id int primary key,name varchar(12))' I write a lot of code, so I'm looking

Re: [R] rearrange set of items randomly

2011-11-08 Thread flokke
Thanks for the replies! Indeed, I could use order() instead of sample() but that it wouldnt be random anymore, as it sorts data points in increasing(!) order. Second, I have to use 1000 different samples. I got the hint that I have to do somethin with indeces, but still cant figure out what

Re: [R] Sampling with conditions

2011-11-08 Thread SarahJoyes
Sorry about being confusing, I have so many loops in loops and ifelses that I get mixed up sometimes, it was just a typo, it was supposed to be for(i in 1:5) Sorry, Thanks for you help! SJ -- View this message in context:

[R] Error message after updating pkg spatstat

2011-11-08 Thread Robin W Hunnewell
Hello, I recently downloaded an updated version of the {spatstat} package 1.24-1. But now, when I do  help() to look up a certain function in the spatstat library, I get an error message. It only seems to be for spatstat fns. The following error: Error in fetch(key) : internal error -3 in

Re: [R] Sampling with conditions

2011-11-08 Thread SarahJoyes
That is exactly what I want, and it's so simple! Thanks so much! -- View this message in context: http://r.789695.n4.nabble.com/Sampling-with-conditions-tp4014036p4016050.html Sent from the R help mailing list archive at Nabble.com. __

[R] Help with SEM package: Error message

2011-11-08 Thread lisamp85
Hello. I started using the sem package in R and after a lot of searching and trying things I am still having difficulty. I get the following error message when I use the sem() function: Warning message: In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could

[R] Question

2011-11-08 Thread Parida, Mrutyunjaya
Hi My name is Rocky and I am trying to use the org.Dm.eg.db library. When I am using the org.Dm.egFLYBASE2EG[fb_ids] it is stopping at a point where it cannot find any value for a given ID such as the following: Error in .checkKeys(value, Rkeys(x), x@ifnotfound) : value for FBgn0004461 not

[R] lapply to list of variables

2011-11-08 Thread Ana
Hi Can someone help me with this? How can I apply a function to a list of variables. something like this listvar=list(Monday,Tuesday,Wednesday) func=function(x){x[which(x=10)]=NA} lapply(listvar, func) were Monday=[213,56,345,33,34,678,444] Tuesday=[213,56,345,33,34,678,444] ... in my case

[R] determine length of bivariate polynomial

2011-11-08 Thread Nicolas Schuck
Dear R-community, I have a fitted bivariate polynomial, i.e: fit = lm(cbind(x, y)~poly(t, 15)) and I would like to determine the length of the line in the interval t = [a, b]. Obviously, I could use predict and go through all the points, i.e. for (t in a:(b-1)) { length = length +

[R] GAM

2011-11-08 Thread Gyanendra Pokharel
Hi R community! I am analyzing the data set motorins in the package faraway by using the generalized additive model. it shows the following error. Can some one suggest me the right way? library(faraway) data(motorins) motori - motorins[motorins$Zone==1,] library(mgcv) amgam - gam(log(Payment) ~

Re: [R] rearrange set of items randomly

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 11:31 AM, flokke wrote: Thanks for the replies! Indeed, I could use order() instead of sample() but that it wouldnt be random anymore, as it sorts data points in increasing(!) order. Second, I have to use 1000 different samples. Please re-read the help page for

Re: [R] Question

2011-11-08 Thread David Winsemius
I suspect you are lost. This is almost certainly more appropriate on the BioConductor list. There are relatively few people on this list who will know what (un-named) packages you might be using. Read the Posting Guide, note the link to the Bioconductor mailing list page, configure your

[R] dbWriteTable with field data type

2011-11-08 Thread Ben quant
Hello, When I do: dbWriteTable(con, r.BOD, cbind(row_names = rownames(BOD), BOD)) ...can I specify the data types such as varchar(12), float, double precision, etc. for each of the fields/columns? If not, what is the best way to create a table with specified field data types (with the RpgSQL

Re: [R] lapply to list of variables

2011-11-08 Thread Uwe Ligges
On 08.11.2011 17:59, Ana wrote: Hi Can someone help me with this? How can I apply a function to a list of variables. something like this listvar=list(Monday,Tuesday,Wednesday) This is a list of length one character vectors rather than a list of variables.

Re: [R] why NA coefficients

2011-11-08 Thread array chip
Sure it does, but still struggling with what is going on... Thanks John From:David Winsemius dwinsem...@comcast.net To:David Winsemius dwinsem...@comcast.net oject.org Sent:Monday, November 7, 2011 10:27 PM Subject:Re: [R] why NA coefficients But this output

Re: [R] why NA coefficients

2011-11-08 Thread array chip
true, why it has to omit treat 7-group 2 Thanks again From: David Winsemius dwinsem...@comcast.net Cc: r-help@r-project.org r-help@r-project.org Sent: Monday, November 7, 2011 10:19 PM Subject: Re: [R] why NA coefficients On Nov 7, 2011, at 10:07 PM,

Re: [R] multi-line query

2011-11-08 Thread jim holtman
Why not just send it in as is. I use SQLite (via sqldf) and here is the way I write my SQL statements: inRange - sqldf(' select t.* , r.start , r.end from total t, commRange r where t.comm = r.comm and t.loc

Re: [R] Sampling with conditions

2011-11-08 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of SarahJoyes Sent: Tuesday, November 08, 2011 5:57 AM To: r-help@r-project.org Subject: Re: [R] Sampling with conditions That is exactly what I want, and it's so simple! Thanks

Re: [R] multi-line query

2011-11-08 Thread Ben quant
Because I don't know anything about sqldf. :) Here is what happens, but Im sure it is happening because I didn't read the manual yet: s - sqldf('create table r.dat(id int primary key,val int)') Error in ls(envir = envir, all.names = private) : invalid 'envir' argument Error in !dbPreExists :

[R] passing dataframe col name through cbind()

2011-11-08 Thread Eric Rupley
Hi all --- I note that the column name of the first column in a dataframe does not necessarily get passed on when using cbind (example below)… I'm looking for help in clarifying why this behavior occurs, and how I can get all col names, including the first, passed on to the result…while I

Re: [R] why NA coefficients

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 12:36 PM, array chip wrote: Sure it does, but still struggling with what is going on... Have you considered redefining the implicit base level for treat so it does not create the missing crossed-category? test$treat2_ - factor(test$treat, levels=c(2:7, 1) )

Re: [R] why NA coefficients

2011-11-08 Thread Dennis Murphy
The cell mean mu_{12} is non-estimable because it has no data in the cell. How can you estimate something that's not there (at least without imputation :)? Every parametric function that involves mu_{12} will also be non-estimable - in particular, the interaction term and the population marginal

[R] rpanel package - retrieve data from panel

2011-11-08 Thread michalseneca
Dear Co-Forumeees Does anybody have experience with using rpanel..or how to retrieve data from created panel. For example my panel draws some interactive graph and computes something inside the panel. Question : is there a way to retrieve those data ? For illustration: if (interactive()) {

Re: [R] geoR, variofit/likfit

2011-11-08 Thread katiab81
up -- View this message in context: http://r.789695.n4.nabble.com/geoR-variofit-likfit-tp4013734p4016970.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] passing dataframe col name through cbind()

2011-11-08 Thread jim holtman
Try this: cbind(scores[,1,drop = FALSE], scores[,2:3]) name round1 round2 1 Bob 40 5 2 Ron 30 6 3 Bud 20 4 Then do ?'[' to learn about 'drop' On Tue, Nov 8, 2011 at 1:06 PM, Eric Rupley erup...@umich.edu wrote: Hi all --- I note that the column name of

Re: [R] geoR, variofit/likfit

2011-11-08 Thread David Winsemius
On Nov 8, 2011, at 1:20 PM, katiab81 wrote: up down ... for a variety of reasons. And... PLEASE do read the posting guide http://www.R-project.org/posting-guide.html It's very possible that you are not communicating with the package authors by posting to rhelp (by way of Nabble) ,

Re: [R] why NA coefficients

2011-11-08 Thread array chip
Hi Dennis, Thanks very much for the details. All those explanations about non-estimable mu_{12} when it has no data make sense to me!  Regarding my specific example data where mu_{12} should NOT be estimable in a linear model with interaction because it has no data, yet the linear model I

Re: [R] ggplot2 reorder factors for faceting

2011-11-08 Thread Dennis Murphy
Hi: (1) Here is one way to reorganize the levels of a factor: plotData[['infection']] - factor(plotData[['infection']], levels = c('InfA', 'InfC', 'InfB', 'InfD')) Do this ahead of the call to ggplot(), preferably after plotData is defined. relevel() resets the

Re: [R] how to use quadrature to integrate some complicated functions

2011-11-08 Thread R. Michael Weylandt
It's polite to include the whole list in your replies so the threads get archived properly. Yes, underflow is occasionally a problem: hence the common use of log-likelihood in MLE and other applications. Might that help you out here? You can get log-likelihoods directly from pnorm and dnorm with

Re: [R] why NA coefficients

2011-11-08 Thread William Dunlap
It might make the discussion easier to follow if you used a smaller dataset that anyone can make and did some experiments with contrasts. E.g., D - data.frame(expand.grid(X1=LETTERS[1:3], X2=letters[24:26])[-1,], Y=2^(1:8)) D X1 X2 Y 2 B x 2 3 C x 4 4 A y 8 5 B y 16 6 C y

[R] nesting scale_manual caracteristics in ggplot

2011-11-08 Thread Sigrid
Hi there, I am having a little problem with combining three scale_manual commands in a facet plot. I am not able to combine the three different characteristics, instead ending up with three different descriptions next to the graph for the same geom. I would like to see two separate labels (not

[R] Question about R mantissa and number of bits

2011-11-08 Thread Lafaye de Micheaux
Dear all, I think that every number x in R can be represented in floating point arithmetic as: x = (-1)^s (1+f) 2^(e-1023) where s is coded on 1 bit, e (positive integer) is coded on 11 bits, and f (real in [0,1)) is coded on 52 bits. Am I right? We have f=\sum_{i=1}^{52} k_i 2^{-i} for

Re: [R] rpanel package - retrieve data from panel

2011-11-08 Thread michalseneca
I found names(y)-y before the end is working ;) some more ideas ? -- View this message in context: http://r.789695.n4.nabble.com/rpanel-package-retrieve-data-from-panel-tp4016953p4017082.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Estimate of intercept in loglinear model

2011-11-08 Thread Mark Difford
On Nov 08, 2011 at 11:16am Colin Aitken wrote: An unresolved problem is: what does R do when the explanatory factors are not defined as factors when it obtains a different value for the intercept but the correct value for the fitted value? Colin, I don't think that happens (that the

[R] How to handle empty arguments

2011-11-08 Thread Alaios
Dear all, I am having a data stucture that contains Products and Time Stamps,   I have made also two lists ProductList=list(c('Example1','Example2'...) TimeStamp=list(c(1990-02-03 12:57:60),c(1990-02-03 12:57:60),   then I have made few functions that call each other   do_analysis_for_all the

[R] window?

2011-11-08 Thread Kevin Burton
This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10))

  1   2   >