Re: [R] Help in using PCR

2008-07-01 Thread Gavin Simpson
On Tue, 2008-07-01 at 10:54 +1000, Jason Lee wrote: Hi, Currently I have a dataset of 2400*408. And I would like to apply PCR method to study the any correlation between the tests. My current data is in data.frame and I have formed horizontal(1-407) to be the exact data, and (408) to be my

[R] extracting elements from a list in vectorized form

2008-07-01 Thread jgarcia
Hi; It seems to me that has probably been asked in the past. But I cannot find the track. I usually need to extract elements from a list and contruct vector from them; e.g., to create a table. Perhaps there is a way to directly extract them without looping? Simple example: S.lst $sublist.1

Re: [R] extracting elements from a list in vectorized form

2008-07-01 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote: Hi; It seems to me that has probably been asked in the past. But I cannot find the track. I usually need to extract elements from a list and contruct vector from them; e.g., to create a table. Perhaps there is a way to directly extract them without looping? Simple

Re: [R] extracting elements from a list in vectorized form

2008-07-01 Thread jgarcia
Perfect!! Thanks a lot! Javier --- [EMAIL PROTECTED] wrote: Hi; It seems to me that has probably been asked in the past. But I cannot find the track. I usually need to extract elements from a list and contruct vector from them; e.g., to create a table. Perhaps there is a way to

[R] Are centre coordinates or upper left corners used of x, y for SpatialPixels?

2008-07-01 Thread Jan.Verbesselt
Dear all, I'm working with satellite images in R and plotting them via the code below. I was wondering whether coordinates (spatial[x], spatial[y]) are used as centre coordinates of the pixels in the GRID? In this script; spatial[x] spatial[y] are the centre coordinates of the satellite image

Re: [R] Are centre coordinates or upper left corners used of x, y for SpatialPixels?

2008-07-01 Thread Paul Hiemstra
Hi Jan, In response to your ps. I think using rgdal is the best way to go. If your data is for example in a GeoTIFF file, reading it is as simple as: GRID = readGDAL(your_file.tif) Saves you some hassel and a number of lines of code. cheers and hth, Paul [EMAIL PROTECTED] wrote: Dear all,

Re: [R] Are centre coordinates or upper left corners used of x, y for SpatialPixels?

2008-07-01 Thread Paul Hiemstra
...and in addition: The r-sig-geo mailing list is a better forum for your kind of questions, you are much more likely to get good answers. cheers, Paul [EMAIL PROTECTED] wrote: Dear all, I'm working with satellite images in R and plotting them via the code below. I was wondering whether

Re: [R] Help in using PCR

2008-07-01 Thread Bjørn-Helge Mevik
Gavin Simpson [EMAIL PROTECTED] writes: You can do this another way though, that I feel is more natural. So lets assume that your data frame contains columns that are named, and that one of these is the response variable, the remaining columns are the predictors. Further assume that this

[R] Installing R into home directory?

2008-07-01 Thread Steve Cadman
I've been trying to install R into a user's home directory for them by compiling from source code, on a machine for which neither of us has administrative access. I've run configure using the --prefix option to specify their home directory. This seems to work OK up to a point, but when

[R] Help on Analysis of covariance

2008-07-01 Thread Partha
Dear All, Kindly tell me the steps to perform analysis of covariance (ANCOVA). Can I find anything in the help(). My prime objective is to analyze the genotypic and phenotypic correlation coefficients. Thanks, Partha Partha Protim Banerjee, Ph. D. Scientist - Corn Breeding Hytech Seed

[R] reshape matrices

2008-07-01 Thread Francisco Javier Santos Alamillos
Hello everyone, I need reshape an array. For example, if we have next array: a - c(1,2,3,4,5,6,7,8,9,10,11,12) dim(a) - c(2,2,3) a , , 1 [,1] [,2] [1,]13 [2,]24 , , 2 [,1] [,2] [1,]57 [2,]68 , , 3 [,1] [,2] [1,]9 11 [2,] 10 12 I

Re: [R] reshape matrices

2008-07-01 Thread jim holtman
Does this do what you want: a - 1:12 dim(a) - c(2,2,3) a , , 1 [,1] [,2] [1,]13 [2,]24 , , 2 [,1] [,2] [1,]57 [2,]68 , , 3 [,1] [,2] [1,]9 11 [2,] 10 12 dim(a) - c(4,3) (b - t(a)) [,1] [,2] [,3] [,4] [1,]1234

Re: [R] Help on Analysis of covariance

2008-07-01 Thread Chuck Cleland
On 7/1/2008 4:57 AM, Partha wrote: Dear All, Kindly tell me the steps to perform analysis of covariance (ANCOVA). Can I find anything in the help(). My prime objective is to analyze the genotypic and phenotypic correlation coefficients. Thanks, Partha RSiteSearch({analysis of covariance},

[R] dev.off() inside a function other glitches

2008-07-01 Thread Michael Hopkins
Hi R people I am using a function to create a pdf device, then send a lot of plots to it in a loop then a last lattice xyplot (itself within a function) outside the loop and finally call dev.off() to write to the file. This works well apart from the fact that the last plot does not get

Re: [R] Which distribution best fits the data?

2008-07-01 Thread Matthieu Stigler
Hello Regressions with time series model is something more complicate than usual, I recommend you to read more about it in any time series manual. The biggest problem comes from the so called potential spurious regression, that is your regression can lead to errnoneous conclusions (if you

[R] Set default value

2008-07-01 Thread Michela Cameletti
[EMAIL PROTECTED]Hi, i'm tryng to build a function that take some input from user and if the user doesn't provide that inputs the function should set a deafult value. I have taken as example a function that i found in the package dlm but with the same code i receive an error (the component is

Re: [R] Add comments on plot window

2008-07-01 Thread Jim Lemon
On Mon, 2008-06-30 at 04:43 -0700, mysimbaa wrote: Dear R users, Is it possible to add comments in a plot window? I have 3 plots - this plots have to be commented on same window Is possible to do the following : http://www.nabble.com/file/p18193822/plot%2526comments.JPG plot%26comments.JPG

Re: [R] Odp: newbie needs help plotting time series

2008-07-01 Thread Petr PIKAL
Kathi [EMAIL PROTECTED] napsal dne 01.07.2008 13:39:18: Thanks, Petr. After fiddling around some more with my code I found out that this seems to have something to do with the number of records the table I'm reading (here: column B112). Somehow, changing the number of records for

Re: [R] Add comments on plot window

2008-07-01 Thread Gabor Grothendieck
Try this. mar is used to widen the right margin and xpd allows display outside of the plot. See ?par and ?legend op - par(mar = c(5, 4, 4, 10) + 0.1, xpd = TRUE) plot(1:10) legend(topright, inset = c(-.3, 0), abc\ndef, box.lty = 0) par(op) On Mon, Jun 30, 2008 at 7:43 AM, mysimbaa [EMAIL

[R] Regression and fitting

2008-07-01 Thread Gunther Höning
Dear list, I have some values like Time2 4 8 24 48 72 UTR 82543 169105 207615 96633 31988 7005 UTRs82687 172934 205541 101842 31898 6950 of a twice repeated meassurement. I know that the underlying function

Re: [R] cohort sampling

2008-07-01 Thread Terry Therneau
Now that we have case cohort model , we have 1000 people and 50 cases Let the first 10 cases occur at the same time second 10 third 10 fourth 10 fifth10 How easy is it to randomly sample 50

Re: [R] lm and NA

2008-07-01 Thread Kenn Konstabel
use the function resid instead of lm.object$residuals to extract the residuals: resid(lm(a~b, na.action=na.exclude)) 1 2 3 4 5 6 -2.533445e-17 4.222409e-17 -8.444818e-18 -8.444818e-18 NANA lm(a~b,

[R] trivial list question

2008-07-01 Thread Boks, M.P.M.
Dear experts, For the makeGenotype function I need a list as in the example. However, since my list needs to be 184 long there must be an easy way to make it. list(1:2,3:4,5:6,7:8) [[1]] [1] 1 2 [[2]] [1] 3 4 [[3]] [1] 5 6 [[4]] [1] 7 8 I have tried lis-1:184 dim(lis)=c(92,2,1)

Re: [R] Regression and fitting

2008-07-01 Thread ONKELINX, Thierry
Try to set your own starting values. Use the values that you would expect for S0, mu and sigma. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest

[R] adtest for weibull distribution

2008-07-01 Thread René Pineda
HiI need help about anderson-darlin test for a weibull distribution in R.Thanks. René _ [[elided Hotmail spam]] e ready. [[alternative HTML version deleted]] __

Re: [R] trivial list question

2008-07-01 Thread Gabor Csardi
I think there are many simple solutions, here is one: lapply(1:92, function(x) c(2*x-1, 2*x)) Gabor On Tue, Jul 01, 2008 at 02:46:07PM +0200, Boks, M.P.M. wrote: Dear experts, For the makeGenotype function I need a list as in the example. However, since my list needs to be 184 long there

[R] Find classes of each column of data.frame()

2008-07-01 Thread Dong-hyun Oh
Dear UseRs, I would like to know the way to find classes of each column of data.frame(). Thank you in advance. = Dong-hyun Oh Center of Excellence for Science and Innovation Studies Royal Institute or Technology, Sweden e-mail:

Re: [R] trivial list question

2008-07-01 Thread ONKELINX, Thierry
Use lapply on a costum function. lapply(1:92, function(i){ (i - 1) * 2 + 1:2 }) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie,

Re: [R] Find classes of each column of data.frame()

2008-07-01 Thread Gabor Csardi
A data frame is a special list: d - data.frame( A=numeric(), B=logical(), C=character() ) lapply(d, class) $A [1] numeric $B [1] logical $C [1] factor Gabor On Tue, Jul 01, 2008 at 03:50:18PM +0200, Dong-hyun Oh wrote: Dear UseRs, I would like to know the way to find classes of each

Re: [R] trivial list question

2008-07-01 Thread Kenn Konstabel
another way: split(1:184, rep(1:92, each=2)) On Tue, Jul 1, 2008 at 3:46 PM, Boks, M.P.M. [EMAIL PROTECTED] wrote: Dear experts, For the makeGenotype function I need a list as in the example. However, since my list needs to be 184 long there must be an easy way to make it.

Re: [R] trivial list question

2008-07-01 Thread Wacek Kusnierczyk
... or try this: n = 184 split(1:n, rep(1:(n/2), each=2)) vQ ONKELINX, Thierry wrote: Use lapply on a costum function. lapply(1:92, function(i){ (i - 1) * 2 + 1:2 }) HTH, Thierry ir. Thierry

Re: [R] Find classes of each column of data.frame()

2008-07-01 Thread Henrique Dallazuanna
sapply(your_data, class) On Tue, Jul 1, 2008 at 10:50 AM, Dong-hyun Oh [EMAIL PROTECTED] wrote: Dear UseRs, I would like to know the way to find classes of each column of data.frame(). Thank you in advance. = Dong-hyun Oh

Re: [R] trivial list question

2008-07-01 Thread Henrique Dallazuanna
Try this also: unname(split(1:184, rep(1:(184/2), each = 2))) On Tue, Jul 1, 2008 at 9:46 AM, Boks, M.P.M. [EMAIL PROTECTED] wrote: Dear experts, For the makeGenotype function I need a list as in the example. However, since my list needs to be 184 long there must be an easy way to make it.

Re: [R] Find classes of each column of data.frame()

2008-07-01 Thread Dong-hyun Oh
Many thanks. On Jul 1, 2008, at 3:57 PM, Romain Francois wrote: sapply( iris, class ) Dong-hyun Oh wrote: Dear UseRs, I would like to know the way to find classes of each column of data.frame(). Thank you in advance. =

Re: [R] Find classes of each column of data.frame()

2008-07-01 Thread Dong-hyun Oh
many thanks. On Jul 1, 2008, at 4:00 PM, Henrique Dallazuanna wrote: sapply(your_data, class) On Tue, Jul 1, 2008 at 10:50 AM, Dong-hyun Oh [EMAIL PROTECTED] wrote: Dear UseRs, I would like to know the way to find classes of each column of data.frame(). Thank you in advance.

Re: [R] Problem reading a CSV

2008-07-01 Thread Paulo Barata
Nina, In which way have you obtained your CSV file? Did you export data from an Excel spreadsheet? Regards, Paulo Barata --- Paulo Barata Fundacao Oswaldo Cruz Rua Leopoldo Bulhoes 1480 - 8A 21041-210 Rio de Janeiro - RJ

Re: [R] Find classes of each column of data.frame()

2008-07-01 Thread Wacek Kusnierczyk
Dong-hyun Oh wrote: Dear UseRs, I would like to know the way to find classes of each column of data.frame(). sapply(your-data-frame, class) vQ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Query on packages for Emerging Patterns

2008-07-01 Thread Jason Lee
Hi, Currently I have a data set of 2 classes and I am interedted to use emerging patterns algorithm. I wondered if there is any packages or recommended code available for this? Please advise.Thanks. [[alternative HTML version deleted]] __

Re: [R] Messge ``no visible binding''.

2008-07-01 Thread Gregory Warnes
Simply add a definition for this variable to the source for your package, e.g.; .Last.make.date - NULL And the warning should go away. -g On 6/30/08 11:44PM , Rolf Turner [EMAIL PROTECTED] wrote: I have written a function make.fun(), which I keep in my personal ``miscellaneous''

Re: [R] Help in using PCR

2008-07-01 Thread Erik Iverson
So, I used df - data.frame( x=I(coef(cancerv1(,2:407))), y=cancerv1[,408])before feeding to PCR. However, I get the below error. Error in coef(cancerv1(, 2:407)) : could not find function cancerv1. It's because you have the syntax error 'cancerv1(...)', which looks to R, and me, a function

Re: [R] Add comments on plot window

2008-07-01 Thread mysimbaa
I solved the problem with plot(0:1,0:1, type = n, axes=FALSE,xlab=,ylab=) text(...) Thanks, Adel mysimbaa wrote: Dear R users, Is it possible to add comments in a plot window? I have 3 plots - this plots have to be commented on same window Is possible to do the following :

[R] Set default value

2008-07-01 Thread Marco Salvi
Hi, i'm tryng to build a function that take some input from user and if the user doesn't provide that inputs the function should set a deafult value. I have taken as example a function that i found in the package dlm but with the same code i receive an error (the component is missing...).

[R] if one of 4 conditions is not satisfied

2008-07-01 Thread mysimbaa
I'm trying to do realize the following: I have 4 condtions. If all conditions are satisfied I will paste(PASS) If any of these is not satisfied I will paste(FAIL). But I have to paste the corresponding failure. ifelse is a good solution but for a 2 conditions. Maybe switch or something like

[R] reshape matrices

2008-07-01 Thread Francisco Javier Santos Alamillos
Hello everyone, I need reshape an array. For example, if we have next array: a - c(1,2,3,4,5,6,7,8,9,10,11,12) dim(a) - c(2,2,3) a , , 1 [,1] [,2] [1,]13 [2,]24 , , 2 [,1] [,2] [1,]57 [2,]68 , , 3 [,1] [,2] [1,]9 11 [2,] 10 12 I

[R] select.list() cannot be used non-interactively

2008-07-01 Thread Fabio Fanoni
Hi. With the previous version of R, it was possible to execute the function 'select.list()' in BATCH mode. In this way, I could write my R code in a .R file and execute that with a double click on a .bat file, that contain the instruction tu run my R code in batch mode (R CMD BATCH myRcode.R).

[R] Plotting Bi-Gamma Distribution

2008-07-01 Thread Gundala Viswanath
Hi all, I've tried to plot a vector which has two peaks in the density. This link shows the figure. http://docs.google.com/View?docid=dcvdrfrh_1dk9r2rc7 The red line is normal curve and green line is gamma curve. Notice that red line can correctly fit the histogram that has two peaks (i.e. red

Re: [R] reshape matrices

2008-07-01 Thread Marc Schwartz
on 07/01/2008 04:58 AM Francisco Javier Santos Alamillos wrote: Hello everyone, I need reshape an array. For example, if we have next array: a - c(1,2,3,4,5,6,7,8,9,10,11,12) dim(a) - c(2,2,3) a , , 1 [,1] [,2] [1,]13 [2,]24 , , 2 [,1] [,2] [1,]57 [2,]

[R] how to automatically maximize the graph window (under XP) ?

2008-07-01 Thread Ptit_Bleu
Hello, I'm trying to produce graphs automatically from data stored in database. Before saving the graphs, I would like to maximize the size of the graphs. The best would be to directly open maximized windows with x11() but up to now I failed doing it. I tried different widths and heighs but I

[R] A regression problem using dummy variables

2008-07-01 Thread rlearner309
This is actually more like a Statistics problem: I have a dataset with two dummy variables controlling three levels. The problem is, one level does not have many observations compared with other two levels (a couple of data points compared with 1000+ points on other levels). When I run the

Re: [R] PCA : Error in eigen(cv,

2008-07-01 Thread Tanya Yatsunenko
Ok, the mistake was in the pca(x)-princomp(SampleD[i,j]), should've used pca(x)-princomp(SampleD) instead. Now, is there anyway to keep track of the matrix index, so in the end of all PCAs, I can tell which score/loading belongs to which sample? Thanks everyone! On Mon, Jun 30, 2008 at 9:08 PM,

Re: [R] Regression and fitting

2008-07-01 Thread Gunther Höning
Thanks! I tried already. Still the same error message... wishes Gunther - Original Message - From: ONKELINX, Thierry [EMAIL PROTECTED] To: Gunther Höning [EMAIL PROTECTED]; R-help@r-project.org Sent: Tuesday, July 01, 2008 3:08 PM Subject: RE: [R] Regression and fitting Try to set

Re: [R] if one of 4 conditions is not satisfied

2008-07-01 Thread Marc Schwartz
on 07/01/2008 07:40 AM mysimbaa wrote: I'm trying to do realize the following: I have 4 condtions. If all conditions are satisfied I will paste(PASS) If any of these is not satisfied I will paste(FAIL). But I have to paste the corresponding failure. ifelse is a good solution but for a 2

[R] ignore warning messages?

2008-07-01 Thread Hua Li
Hi All, I'm working with R and want to ignore the warning messages given, is there a way to stop R from giving out warning messages any more? an example: tt = test as.numeric(tt) would give me the following message: [1] NA Warning message: NAs introduced by coercion I decide to ignore the

[R] RES: how to automatically maximize the graph window (under XP) ?

2008-07-01 Thread Leandro Marino
Hi, you can use the jpeg(), pdf(), bmp() functions. In this function you can determinate the size of the graph, background color, quality of the image. Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Ptit_Bleu Enviada em: terca-feira, 1 de

[R] Orthogonal polynomials and poly

2008-07-01 Thread giovanni parrinello
Dear All, I have found in the poly help this sentence: The orthogonal polynomial is summarized by the coefficients, which can be used to evaluate it via the three-term recursion given in Kennedy Gentle (1980, pp. 343–4), and used in the predict part of the code. My question: which type of

Re: [R] ignore warning messages?

2008-07-01 Thread Jorge Ivan Velez
Dear Hua, Try options(warn=-1) tt = test as.numeric(tt) [1] NA See also ?options for more info. HTH, Jorge On Tue, Jul 1, 2008 at 12:11 PM, Hua Li [EMAIL PROTECTED] wrote: Hi All, I'm working with R and want to ignore the warning messages given, is there a way to stop R from giving

[R] Invalid object error in boxplot

2008-07-01 Thread mm745
Hi, I'm trying to make a boxplot with the data at the end of the message, and when I try to execute the command boxplot(Diatoms) (or for any other field instead of Diatoms) I get the following error message: Error in oldClass(stats) - cl : adding class factor to an invalid object Any advice

Re: [R] Set default value

2008-07-01 Thread Erik Iverson
You should consult An Introduction to R, section 11, Writing your own functions, along with any beginner books on R. http://www.r-project.org/doc/bib/R-books.html test - function(x = 2) { x^2 } test() ## will give 4 test(3) ## will give 9 Marco Salvi wrote: Hi, i'm tryng to build a

Re: [R] Help in using PCR

2008-07-01 Thread Gavin Simpson
On Wed, 2008-07-02 at 00:58 +1000, Jason Lee wrote: Hi, Thanks for the reply. Basically I dont have any label for my data except column 1 which is labeled with Sample1, Sample2...etc...(vertical). Well that is going to cause you problems, not the one you report below, but it will bite you

Re: [R] ignore warning messages?

2008-07-01 Thread Henrique Dallazuanna
options(warn = -1) or suppressWarnings(as.numeric(test)) On Tue, Jul 1, 2008 at 1:11 PM, Hua Li [EMAIL PROTECTED] wrote: Hi All, I'm working with R and want to ignore the warning messages given, is there a way to stop R from giving out warning messages any more? an example: tt = test

[R] Simulate from a GAM model

2008-07-01 Thread Mark Lyman
Does anybody have any suggestions on how I might simulate from fitted GAM model? I am using the gam function in the mgcv package to fit a variable coefficient model like the following from the examples. I would like simulate based on the fitted model like the simulate function in the stats

Re: [R] Invalid object error in boxplot

2008-07-01 Thread Erik Iverson
The advice is to store numeric data as numeric, and not factors. Try str(yourdata) and you'll probably see that Diatoms is stored as a 'factor'. Are those commas used as decimal points? read.table can deal with that if so. If not, you do not need them, and should convert those fields to

[R] RES: Invalid object error in boxplot

2008-07-01 Thread Leandro Marino
HI Miriam, the problem is that you have the Date and some other factors in your database. try to use the lapply(your_base,class) and see what appears. If you have any kind of factor or date you cannot use boxplot. If you verify that only V1, V2 and V3 are numeric you can do the box plot with

[R] Ignore blank columns when reading a row from a table

2008-07-01 Thread naw3
Hi, I am extracting data from a table where the rows have different column lengths, and empty columns have NA in them. Whenever I extract a row with some empty columns, the resulting vector carries all the NAs. Is there a way to ignore the empty columns? Thanks, -Nina

Re: [R] Ignore blank columns when reading a row from a table

2008-07-01 Thread Erik Iverson
It depends what you mean by 'ignore'. Some functions have an na.rm argument which throws out NAs before computing the statistic. if the vector 'x' has NAs, then x - x[!is.na(x)] may be what you're looking for. This removes NAs from x and reassigns the value to x. [EMAIL PROTECTED] wrote:

[R] WIERD: Basic computing in R

2008-07-01 Thread [EMAIL PROTECTED]
Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the computation is repeated. Thanks in advance for any

Re: [R] WIERD: Basic computing in R

2008-07-01 Thread Dirk Eddelbuettel
On Tue, Jul 01, 2008 at 11:15:58AM -0700, [EMAIL PROTECTED] wrote: Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to

Re: [R] Ignore blank columns when reading a row from a table

2008-07-01 Thread Jorge Ivan Velez
Dear Nina, If you have a matrix X like this # Data set set.seed(123) X=matrix(rnorm(10*5),ncol=5) X[1,1]-NA X[2,1]-NA X[1,5]-NA X[5,2]-NA X and you'd like to remove the NA values for a particular row (for example row 1), you can try something like: X[1,!is.na(X[1,])] Now, if you have a

[R] Prediction with Bayesian Network?

2008-07-01 Thread stephanos
Hi, I am interested in using a bayesian network as a predictor (machine learning); however, I can't get any of the implementations (deal, nblearn) to learn predict stuff. Shouldn't there also be probabilites for each node after the learning phase, how can I access these? Cheers, Stephan --

Re: [R] if one of 4 conditions is not satisfied

2008-07-01 Thread mysimbaa
Thank you very much for your precise help. I will try to implement this tomorrow. It looks like the best solution which could be done. Greetings, Adel Tekari Marc Schwartz wrote: on 07/01/2008 07:40 AM mysimbaa wrote: I'm trying to do realize the following: I have 4 condtions. If all

Re: [R] WIERD: Basic computing in R

2008-07-01 Thread Marc Schwartz
on 07/01/2008 01:15 PM [EMAIL PROTECTED] wrote: Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the

Re: [R] Problem reading a CSV

2008-07-01 Thread Jim Porzak
Nina, read.csv() will default fill = TRUE, or add to your read.table() argument list. If that does not help, you will need to use col.names argument. see ?read.table HTH, Jim Porzak Responsys, Inc. San Francisco, CA http://www.linkedin.com/in/jimporzak On Mon, Jun 30, 2008 at 11:16 AM, [EMAIL

Re: [R] WIERD: Basic computing in R

2008-07-01 Thread Mark Lyman
poolloopus at yahoo.com poolloopus at yahoo.com writes: Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables

[R] RES: WIERD: Basic computing in R

2008-07-01 Thread Leandro Marino
Hi, the problem is what you want! With the -2.7^8.6 you are doing -(2.7^8.6) it exists... But, if you try (-2.7)^8.6 the R gives you NaN. When you define p=-2.7 and q=8.6 and do p^q you are doing that (-2.7)^8.6. If you write p=2.7 and q=8.6 and use the -p^q it will work! Leandro Marino

[R] problem with mpiexec and Rmpi

2008-07-01 Thread Erin Hodgess
Dear R People: I'm having some trouble with mpiexec and Rmpi. I would like to be able to pass in the number of children via the mpiexec command (from the command line). this is in SUSE10.1, with R-2.7.1 Here are my files: cat eb.R library(Rmpi) mpi.remote.exec(paste(i

[R] Problem with loading library-ks

2008-07-01 Thread Mayukh Dass
Hi, I am trying to load the library(ks), but I am getting the following error: Loading required package: KernSmooth KernSmooth 2.22 installed Copyright M. P. Wand 1997 Loading required package: mvtnorm Loading required package: rgl Loading required package: misc3d Error in lazyLoadDBfetch(key,

[R] plot window

2008-07-01 Thread Leandro Marino
Hi list, I want to know how can i creat a plot window with this configuration: ___ | | | PLOT 1| | | |-| | | | | |

Re: [R] plot window

2008-07-01 Thread Henrique Dallazuanna
Try: nf - layout(matrix(c(1,2, 4, 6, 1, 3, 5, 6), nc = 2)) layout.show(nf) On Tue, Jul 1, 2008 at 4:15 PM, Leandro Marino [EMAIL PROTECTED] wrote: Hi list, I want to know how can i creat a plot window with this configuration: ___ | |

[R] Change name of a specific column of a data frame

2008-07-01 Thread naw3
Hi, Sorry for the simple question. Is there a way to change the name of only one column of an existing data frame? I know colnames allows you to set the name of all the columns, but only one column in the middle of my data frame needs a new name. Thanks, -Nina

Re: [R] Change name of a specific column of a data frame

2008-07-01 Thread jim holtman
x - data.frame(a=1,b=2,c=3) x a b c 1 1 2 3 colnames(x)[2] - done x a done c 1 12 3 On Tue, Jul 1, 2008 at 3:17 PM, [EMAIL PROTECTED] wrote: Hi, Sorry for the simple question. Is there a way to change the name of only one column of an existing data frame? I know colnames

Re: [R] Change name of a specific column of a data frame

2008-07-01 Thread Philip Twumasi-Ankrah
Try require(gregmisc) rename(data, from=old_name, to=new_name) A Smile costs Nothing  But Rewards Everything Happiness is not perfected until it is shared   -Jane Porter   --- On Tue, 7/1/08, [EMAIL PROTECTED] [EMAIL

[R] RES: plot window

2008-07-01 Thread Leandro Marino
I will see the code! It is similar that i want! Thanks a lot! -Mensagem original- De: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 1 de julho de 2008 16:22 Para: Leandro Marino Cc: [EMAIL PROTECTED] Org Assunto: Re: [R] plot window Look at the code for the

[R] RES: Change name of a specific column of a data frame

2008-07-01 Thread Leandro Marino
You can use names(database)[position] where position is the number of the column that you want to rename! Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de [EMAIL PROTECTED] Enviada em: terca-feira, 1 de julho de 2008 16:18 Para:

[R] Fitting a curve to data

2008-07-01 Thread Shirin Safa
Hi I have a set of data like this: *Time of Day* *Pct of Daily Volume* 9:45 7.50% 10 6.25% 10:15 4.45% 10:30 4.80% 10:45 4.45% 11:00 4.20% 11:15 2.50% 11:30 2.30% 11:45 2.25% 12:00 2.45% 12:15 2.60% 12:30 2.00% 12:45 2.05% 13:00 2.40% 13:15 1.90% 13:30 3.10% 13:45 2.90% 14:00 2.80% 14:15

Re: [R] Fitting a curve to data

2008-07-01 Thread stephen sefick
?lm lm(x[,1]~x[,2]) On Tue, Jul 1, 2008 at 2:28 PM, Shirin Safa [EMAIL PROTECTED] wrote: Hi I have a set of data like this: *Time of Day* *Pct of Daily Volume* 9:45 7.50% 10 6.25% 10:15 4.45% 10:30 4.80% 10:45 4.45% 11:00 4.20% 11:15 2.50% 11:30 2.30% 11:45 2.25% 12:00 2.45% 12:15

Re: [R] Fitting a curve to data

2008-07-01 Thread stephen sefick
does loess return the values that it produces- take that and then integrate under the curve. On Tue, Jul 1, 2008 at 4:28 PM, Shirin Safa [EMAIL PROTECTED] wrote: no this is not what I want. I was using loess function or smooth.spline. but For loess I don't know how would I be able to get the

Re: [R] Fitting a curve to data

2008-07-01 Thread Carl Witthoft
I think the previous answer (to use lm() ) is not necessarily the best option. Since what you want is the definite integral (area under the curve), you can just use one of the existing definite integration tools (sorry, I don't recall the names because I don't use them). If you want to get

Re: [R] WIERD: Basic computing in R

2008-07-01 Thread Thomas Lumley
This is FAQ 7.33 -thomas On Tue, 1 Jul 2008, [EMAIL PROTECTED] wrote: Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are

Re: [R] Simulate from a GAM model

2008-07-01 Thread Gavin Simpson
On Tue, 2008-07-01 at 17:12 +, Mark Lyman wrote: Does anybody have any suggestions on how I might simulate from fitted GAM model? I am using the gam function in the mgcv package to fit a variable coefficient model like the following from the examples. I would like simulate based on the

[R] W-E-I-R-D Weird!

2008-07-01 Thread Bert Gunter
Ow ow ow. I can't stand it any longer! Weird is one of those weird exceptions in English to the i before e except after c rule and is spelled W-E-I-R-D . In case you're interested, the other exceptions are seize, inveigle , either, leisure, neither. :-( -- Bert Gunter -Original

[R] Graph Order in xyplot

2008-07-01 Thread Sam Albers
I have constructed a Trellis style xyplot. lengthf - factor(length) xyplot(SLI$velocity ~ SLI$width | SLI$lengthf, layout = c(2,7), xlab = Width (cm), ylab = Velocity (m/s^2), col = black) This produces a lovely little plot. However, the grouping factor(lengthf) isn't in the right order. My

Re: [R] W-E-I-R-D Weird!

2008-07-01 Thread Rolf Turner
On 2/07/2008, at 10:15 AM, Bert Gunter wrote: Ow ow ow. I can't stand it any longer! Weird is one of those weird exceptions in English to the i before e except after c rule and is spelled W-E-I-R-D . In case you're interested, the other exceptions are seize, inveigle , either, leisure,

Re: [R] Fitting a curve to data

2008-07-01 Thread stephen sefick
I would like to know the answer to this question now that I know what we are getting at. integrate() looks like it is the right thing, but it has to use a function- I would like to know how to just integrate the area under a curve with just an input of x and y coordinates. Stephen On Tue, Jul

Re: [R] Graph Order in xyplot

2008-07-01 Thread Gabor Grothendieck
Here are some ways of rearranging panels: library(lattice) p - xyplot(Sepal.Length ~ Sepal.Width | Species, iris) p p[c(2, 1, 3)] xyplot(Sepal.Length ~ Sepal.Width | Species, iris, as.table = TRUE) On Tue, Jul 1, 2008 at 6:20 PM, Sam Albers [EMAIL PROTECTED] wrote: I have constructed a

[R] Area Under a Curve

2008-07-01 Thread stephen sefick
I would like to integrate the area under a curve without any smoothing or the like- just on the raw numbers. I looked at integrate() but it requires a function which I assume means something like x+x^2+x^3 is there a built in function in R for this? #let's say x - seq(1:50) y - seq(1:50)

Re: [R] W-E-I-R-D Weird!

2008-07-01 Thread Bert Gunter
Hoisted by own petard! How appropriate. 1. I hereby invoke the codicil. 2. Check the dictionary. An accepted pronunciation of inveigle is inveegle. Does this allow me to wriggle through the escape clause? -- Bert -Original Message- From: Rolf Turner [mailto:[EMAIL PROTECTED] Sent:

Re: [R] Graph Order in xyplot

2008-07-01 Thread Deepayan Sarkar
On 7/1/08, Sam Albers [EMAIL PROTECTED] wrote: I have constructed a Trellis style xyplot. lengthf - factor(length) xyplot(SLI$velocity ~ SLI$width | SLI$lengthf, layout = c(2,7), xlab = Width (cm), ylab = Velocity (m/s^2), col = black) As an aside, the recommended incantation is

Re: [R] Fitting a curve to data

2008-07-01 Thread Gabor Grothendieck
There is an integrate.xy in sfsmic. Limitations discussed there. On Tue, Jul 1, 2008 at 6:27 PM, stephen sefick [EMAIL PROTECTED] wrote: I would like to know the answer to this question now that I know what we are getting at. integrate() looks like it is the right thing, but it has to use a

Re: [R] Graph Order in xyplot

2008-07-01 Thread hippie dream
as.table =TRUE was exactly what I needed. Also thanks for the little aside. Gabor Grothendieck wrote: Here are some ways of rearranging panels: library(lattice) p - xyplot(Sepal.Length ~ Sepal.Width | Species, iris) p p[c(2, 1, 3)] xyplot(Sepal.Length ~ Sepal.Width | Species, iris,

Re: [R] Area Under a Curve

2008-07-01 Thread Rolf Turner
On 2/07/2008, at 10:38 AM, stephen sefick wrote: I would like to integrate the area under a curve without any smoothing or the like- just on the raw numbers. I looked at integrate() but it requires a function which I assume means something like x+x^2+x^3 is there a built in function in R

  1   2   >