Re: [R] Function to locate points in 3d octants or points on two axes

2011-02-02 Thread Petr Savicky
On Tue, Feb 01, 2011 at 08:30:22PM -0500, Bryan Hanson wrote: [Sorry, resending with a proper subject line!] Hi Guru's... I have a set of points that may lie along any of the x, y and z axes in a Cartesian coordinate system. I am hoping that a function exists which will determine if

Re: [R] Hidden environment

2011-02-02 Thread Prof Brian Ripley
On Tue, 1 Feb 2011, Joel wrote: Hi I wondering if its possible to make a hidden environment for a package, so the user cant see whats in it but the diffrent functions inside the package can use the variables in the environment. Up to a point: 1) See the manual about the concept of a name

[R] Finding the maximum in a particular group in a dataframe

2011-02-02 Thread Asan Ramzan
Hello I am trying to find a way to find the max value, for only a subset of a dataframe, depending on how the data is grouped for example, How would I find the maxmium responce, for all the GPR119a condition below: I've tried tapply tapply(GPR119data$responce, GPR119data$GPR119a, max) Error

[R] combining vectors into list

2011-02-02 Thread Lorenzo Cattarino
Hi R users I have these two vectors: Row - sample(1:25, 10) Col - sample(1:25, 10) Is there a way to combine them into a list, whose first component is a vector containing the first element of Row and the first element of Col, the second component is a vector containing the second

[R] Why my package is not being generate?

2011-02-02 Thread Cristiano Strieder
Hi all, I have commited a new release of my package and waited for more than one day. After that install.packages(tests,repos=http://r-forge.r-projet.org;) still returns package 'tests' is not available. I have done the local build check and the package seems ok. Also have mofified the Title in

[R] error in scan(...

2011-02-02 Thread gked
I know it's a common error and there is a lot of help available but still can't resolve the issue: all i am trying to do is to read a csv file from my folder and this is what i get: Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : scan() expected 'a real', got

[R] reshape data, adding rows to dataframe

2011-02-02 Thread Lucia Rueda
Hello everyone, I have a data set like this: head( fish_transect) ID_TRANSECT ID_PROJECT DE_ZONE DE_LOCALITY DE_SECTOR MES 1 42 MB TarragonaCreixell Control I 9 2 42 MB TarragonaCreixell Control I 9 3 42 MB Tarragona

[R] Counter in a For Loop - Efficiency Issue

2011-02-02 Thread Leendert Punt
I have a 32000 x 14 matrix (M) where entry (x, y) corresponds to person x at a discrete time y. I then have a matrix (M2) of 6 x 2 where each entry is a an event by a person that is in the above 32000 and at a time that is in the range of the discrete time points above. I want to populate the

Re: [R] Preparing dataset for glmnet: factors to dummies

2011-02-02 Thread Mark Difford
Hi Frank, I believe that glmnet scales variables by their standard deviations. This would not be appropriate for categorical predictors. That's an excellent point, which many are likely to forget (including me) since one is using a model matrix. The default argument is to standardize inputs,

[R] error in density plot

2011-02-02 Thread Ramya
Hi, I have the code for the density plot j - 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i])) } This gives me an error Error in density.default(diff_in_sample[, i]) : 'x' contains missing values I am not quite sure what to do.

Re: [R] How to Plot Two Curves Into One Page

2011-02-02 Thread Edwin Groot
On Tue, 1 Feb 2011 14:20:51 +0900 Gundala Viswanath gunda...@gmail.com wrote: I have a R script that contain these lines for plotting: plot(foo,lwd=2,lty=3,col=red, main=); plot(bar,lwd=2,lty=3,col=blue); legend(0.6,0.6,c('Default','Probabilistic'), col=c('red','blue'),lwd=3); But it

[R] RMySQL, cant find MySQL

2011-02-02 Thread Joel
Hi I'm having some trouble with getting RMySQL installed on my Ubuntu system. As the apt-get install version of R is 2.10.x I've reinstalled 2.12 the old fashion way by ./conf and make. But now when I shall install RMySQL I get Configuration error: could not find the MySQL installation

Re: [R] help

2011-02-02 Thread Łukasz Ręcławowicz
We don't need a loop! require(Rmpfr) factorial(mpfr(1:500,3800)) 2011/2/2 Waclaw Kusnierczyk w...@idi.ntnu.no library(bc) factorial = function(n) bc(sprintf(' define factorial(n) { if (n 2) return (1) f = 2 i = 2 while (i n) f *= ++i return (f)

Re: [R] combining vectors into list

2011-02-02 Thread Ivan Calandra
Hi, Try this: mapply(FUN=c, Row, Col, SIMPLIFY=FALSE) HTH, Ivan Le 2/2/2011 08:55, Lorenzo Cattarino a écrit : Hi R users I have these two vectors: Row- sample(1:25, 10) Col- sample(1:25, 10) Is there a way to combine them into a list, whose first component is a vector containing

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Ivan Calandra
Hi, Not sure what you want to do, but take a look at ?duplicated, ?unique, and maybe ?aggregate; it might be what you're looking for. HTH, Ivan Le 2/2/2011 10:13, Lucia Rueda a écrit : Hello everyone, I have a data set like this: head( fish_transect) ID_TRANSECT ID_PROJECT DE_ZONE

Re: [R] RMySQL, cant find MySQL

2011-02-02 Thread Prof Brian Ripley
On Wed, 2 Feb 2011, Joel wrote: Hi I'm having some trouble with getting RMySQL installed on my Ubuntu system. As the apt-get install version of R is 2.10.x I've reinstalled 2.12 the old fashion way by ./conf and make. But now when I shall install RMySQL I get Configuration error: could

Re: [R] Help in getting info from a DataFrame

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 31.01.2011 15:51:16: snip Hi thanks. I am not sure if I have understood 100% but at least I know now that there's a diference. About this: lapsales Store Prod qtd 5 Aveiro Lapiseira 3 8 Coimbra Lapiseira 1

Re: [R] Counter in a For Loop - Efficiency Issue

2011-02-02 Thread Petr Savicky
On Wed, Feb 02, 2011 at 09:35:28AM +0200, Leendert Punt wrote: I have a 32000 x 14 matrix (M) where entry (x, y) corresponds to person x at a discrete time y. I then have a matrix (M2) of 6 x 2 where each entry is a an event by a person that is in the above 32000 and at a time that is in

Re: [R] sum the values in a vector as a complete number

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.02.2011 07:02:50: Hi AD, You might try the following: # data a - c(2,3,5) b - c(8,7) # you got this wrong ;) # option 1 foo - function(x) as.numeric(paste(x, sep = , collapse = )) # examples foo(a) # [1] 235 foo(b) # [1] 87

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Petr Savicky
On Wed, Feb 02, 2011 at 01:13:11AM -0800, Lucia Rueda wrote: Hello everyone, I have a data set like this: head( fish_transect) ID_TRANSECT ID_PROJECT DE_ZONE DE_LOCALITY DE_SECTOR MES 1 42 MB TarragonaCreixell Control I 9 2 42 MB Tarragona

[R] How column names/row names are preserved in matrix calculation?

2011-02-02 Thread Bogaso Christofer
Can somebody tell me that, if I do some arithmetic calculation over 2 matrices then how the column names and row names are preserved? It seems that, for multiplication, column names and row names of the 2nd matrix are preserved and for additional, there seems not having any explicit rule:

Re: [R] Help in getting info from a DataFrame

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.02.2011 11:14:18: Hi r-help-boun...@r-project.org napsal dne 31.01.2011 15:51:16: snip Hi thanks. I am not sure if I have understood 100% but at least I know now that there's a diference. About this:

Re: [R] kmeans: number of cluster centres must lie between 1 and nrow(x)

2011-02-02 Thread Feng Li
Thank you for the suggestion and it is exactly as you said only one observation in each cluster. I know I can avoid this anyway and I am just out of curiosity of the error. I am writing a special algorithm to cluster some datasets with different numbers of observations. For some particular

[R] Odp: Read a similarity matrix from excel

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.02.2011 10:20:48: Good morning, I have an excel spreadsheet with similarities among objects. The format of the file is the following: 1st row: empty cell,object-1-name,object-name-2,...,object-N 2nd row: object-name-1,0,s1,2,s1,3,...,s1,N

[R] pass nrow(x) to dots in function(x){plot(x,...)}

2011-02-02 Thread Marianne Promberger
Dear Rers, I have a function to barplot() a matrix, eg myfun - function(x, ...) { barplot(x , ... )} (The real function is more complicated, it does things to the matrix first.) So I can do: m1 - matrix(1:20,4) myfun(m1) myfun(m1, main=My title) I'd like to be able to add the number of

Re: [R] Counter in a For Loop - Efficiency Issue

2011-02-02 Thread Bart Joosen
without a reproducible sample, it is hard to tell, but I will give it a shot. Maybe it's possible to merge your M with M2: merge(M, M2) If you only want to count times, you can use seq_along(x) in a by function eg: dat - data.frame(person=rep(c(1,2,3), each=5), time=rnorm(15)) by(dat$person,

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Lucia Rueda
Hi Ivan, Thanks for your reply. This is what I want to do: Imagine my dataset looks like this: Species N Size Coris julis 1 8 Coris julis 3 10 D.vulgaris 2 12 I have 1 C.julis of 8 cm, 3 C. julis of 10 cm and 2 D.vulgaris of 12 cm. I want 1 row for each

[R] Manipulating XTS data

2011-02-02 Thread Greg Hanley
Hi, I'm pulling in data for the past 30 days or so. I'm going to slice each day into 5 minute time intervals, and I want to find the average value across all days for the given slice of time. That is, I want to know what the average value at 8:00 was for the 30 day period, the average value at

[R] clustering with finite mixture model

2011-02-02 Thread karuna m
Dear R-help, I am doing clustering via finite mixture model. Please suggest some packages in R to find clusters via finite mixture model with continuous variables. And also I wish to verify the distributional properties of the mixture distributions by fitting the model with lognormal, gamma,

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Henrique Dallazuanna
Try this: transform(fish[rep(seq(nrow(fish)), fish$N),], N = 1) On Wed, Feb 2, 2011 at 8:58 AM, Lucia Rueda lucia.ru...@ba.ieo.es wrote: Hi Ivan, Thanks for your reply. This is what I want to do: Imagine my dataset looks like this: Species N Size Coris julis 1 8 Coris

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Lucia Rueda
Exactly!! Thanks a lot Petr. It worked! Thansk to you as well Ivan! -- View this message in context: http://r.789695.n4.nabble.com/reshape-data-adding-rows-to-dataframe-tp3253640p3253793.html Sent from the R help mailing list archive at Nabble.com.

[R] Error of 'memory not mapped' in ff Package with VirtualBox

2011-02-02 Thread Wonsang You
Dear R Helpers, I would like to report on an error in the ff package here. The ff package is an R package which enables us to store large data on disk systematically and have fast access to the database. I used the package in Linux as a guest OS of VirtualBox, and executed the following

[R] multicore + xeon ?

2011-02-02 Thread kv
Is there any reason to expect a problem ? i'm running this script on the cluster down the hall: module load R/2.11.0 R library(multicore) fxx-function(ll) runif(1) mclapply(1:10,fxx) i get: Error in fork() : Unable to fork. less /proc/cpuinfo yields: processor : 0 vendor_id :

Re: [R] help

2011-02-02 Thread Petr Savicky
On Tue, Feb 01, 2011 at 12:51:18PM -0800, Kiogou Lydie wrote: PLEASE HELP I actually want to do the following: a[j] = (1/(j!))*?? (i-1-d), j = 500, ?? means product i = 1 to j ?? Yet, j! will stop at 170 and ?? (i-1-d) at 172; so, a[j] will not exceed 170. I would like to

[R] String to Matrix

2011-02-02 Thread Romildo Martins
Hello, How to convert x into y? x [1] 15, 23, 2, 21, 11, 5 y [,1] [,2] [1,] 15 23 [2,] 232 [3,]221 [4,] 21 11 [5,] 115 Thanks a lot! Romildo [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] String to Matrix

2011-02-02 Thread Henrique Dallazuanna
Try this: embed(scan(textConnection(x), sep = ,), 2) On Wed, Feb 2, 2011 at 10:12 AM, Romildo Martins romildo.mart...@gmail.comwrote: Hello, How to convert x into y? x [1] 15, 23, 2, 21, 11, 5 y [,1] [,2] [1,] 15 23 [2,] 232 [3,]221 [4,] 21 11 [5,]

Re: [R] Strange result from sort: sort(c(aa, ff)) gives ff aa with R.2.12.1 on windows 7

2011-02-02 Thread Prof Brian Ripley
'Strange' to have no response on this. Can a knowledgeable Danish writer please confirm that this is how the OSes are supposed to handle Danish collation? On Mon, 24 Jan 2011, Prof Brian Ripley wrote: On Mon, 24 Jan 2011, Søren Højsgaard wrote: Dear list, Please consider the following

Re: [R] Error of 'memory not mapped' in ff Package with VirtualBox

2011-02-02 Thread Prof Brian Ripley
This is clearly a problem occuring in the C code of the ff package. Please report to the package maintainer, Cced here (with the 'at a minimum' information requested in the posting guide, most importantly the Linux architecture and the versions involved). FWIW it works for me on

Re: [R] Strange result from sort: sort(c(aa, ff)) gives ff aa with R.2.12.1 on windows 7

2011-02-02 Thread Søren Højsgaard
Not sure if I qualify as being knowledgeable, but... You write I recall that 'aa' used to sort at the end of the alphabet in Danish telephone books, so it seems the sort used on Windows thinks so too. See ?Comparison for some further details. What I don't understand is that someone

[R] Problem with getFX function

2011-02-02 Thread Usuario R
Hi everyone, Following this post: http://r.789695.n4.nabble.com/currency-conversion-function-tt906056.html#a906061 I was trying to run the code: foo - function(from, to, date){ url - http://www.oanda.com/convert/classic?script=..%2Fconvert%2Fclassiclanguage=envalue=1 params -

Re: [R] error in scan(...

2011-02-02 Thread jim holtman
It is clear that you have letters in the data you are trying to process; that is the cause of the erro. What was the 'scan' statement you were using? Were you expecting all numerics in the string? The error message is consistent with your input. On Wed, Feb 2, 2011 at 2:07 AM, gked

Re: [R] Strange result from sort: sort(c(aa, ff)) gives ff aa with R.2.12.1 on windows 7

2011-02-02 Thread Prof Brian Ripley
On Wed, 2 Feb 2011, Søren Højsgaard wrote: Not sure if I qualify as being knowledgeable, but... You write I recall that 'aa' used to sort at the end of the alphabet in Danish telephone books, so it seems the sort used on Windows thinks so too. See ?Comparison for some further details. What

Re: [R] error in density plot

2011-02-02 Thread Ben Bolker
Ramya ramya.victory at gmail.com writes: I have the code for the density plot j - 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i])) } This gives me an error Error in density.default(diff_in_sample[, i]) : 'x' contains

Re: [R] Function to locate points in 3d octants or points on two axes

2011-02-02 Thread Bryan Hanson
Thanks Petr, the sign function will be of help. I was not aware of it. Bryan On Feb 2, 2011, at 3:21 AM, Petr Savicky wrote: On Tue, Feb 01, 2011 at 08:30:22PM -0500, Bryan Hanson wrote: [Sorry, resending with a proper subject line!] Hi Guru's... I have a set of points that may lie

Re: [R] Error of 'memory not mapped' in ff Package with VirtualBox

2011-02-02 Thread Wonsang You
Dear Prof. Brian Ripley, Thank you for your kind advice. I have to report to you that I attempted to save the ff file at a shared directory between guest OS (Linux) and host OS (Windows 7). I tried to change the working directory as an unshared folder, and then I tried the same commands. In

[R] subset in a BIG matrix

2011-02-02 Thread alcesgabbo
I have a matrix with a lot of values inside.. when I execute the folowing command matrix2=subset(martix, condition.) it works... but after the previous command I execute another subset matrix3=subset(martix2, condition2.) and appears the following error: (subscript) logical

[R] Lattice nb/wlist help

2011-02-02 Thread Gary Nobles
Hi all, I have a grid of points at regular intervals (taken from a raster). I want to create a listw matrix which opperates like this 1 1 1 1 1 1 1 1 1 and also like this 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 and so on I want it to work with

Re: [R] reshape data, adding rows to dataframe

2011-02-02 Thread Lucia Rueda
Thanks Henrique! It solves the problem of having the column N with unreal number of individuals since N=1 with Petr's example: expand - transform(dat[rep(1:nrow(dat), times=dat$N), ] ,N=1) rownames(expand) - NULL expand expand animal N 1 a 1 2 a 1 3 b 1 4 c 1 5 c 1

[R] Significant codes in mtable

2011-02-02 Thread Striessnig, Erich
Hi all, Does anyone know a way to change the significant stars in mtable (package memisc)? The default is Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1, however I need it to be Signif. codes: 0 '***' 0.01 '**' 0.05 '*' 0.1 ' ' 1 Kind regards, Erich [[alternative

[R] Finding the dominant factor in an unbalanced group

2011-02-02 Thread Sandy Small
Hi all. This is perhaps more a statistics question but I'm hoping someone can help me. I have a group of patients for whom I'm looking at beat to beat RR interval changes. I have plotted the difference between one beat length and the next against the difference between the previous beat length

[R] Error w tokenizer .jcall unless run as root

2011-02-02 Thread Nick Torenvliet
Hi all, I've got an R script that loads the following libraries library(rJava) library(RWeka) library(tm) At some when I try to run the tm tokenizer as MyTokenizer - function(x) NGramTokenizer(x, Weka_control(min = 1, max = 4)) ECONOMIST_TDM -

[R] Acf of Frima

2011-02-02 Thread Chuse chuse
Hello, I am trying to calculate the autocovariance matrix for any general farima(p,d,q) with p,q 1. Could anyone give an idea how to implement in R or if there is any package for this? thank you beforehand. Jose. __ R-help@r-project.org mailing list

Re: [R] Significant codes in mtable

2011-02-02 Thread Henrique Dallazuanna
Take a look on symnum function: symnum(runif(30), cutpoints = c(0, 0.01, 0.05, 0.1, 1), symbols = c(***, **, *, )) On Wed, Feb 2, 2011 at 11:25 AM, Striessnig, Erich erich.striess...@wu.ac.at wrote: Hi all, Does anyone know a way to change the significant stars in mtable (package memisc)?

Re: [R] Finding the maximum in a particular group in a dataframe

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 3:48 AM, Asan Ramzan wrote: Hello I am trying to find a way to find the max value, for only a subset of a dataframe, depending on how the data is grouped for example, How would I find the maxmium responce, for all the GPR119a condition below: I've tried tapply

[R] help

2011-02-02 Thread ghasem amini
hello I have recently started using the LOCFIT package, together with Clive Loader's book. I need to implement some method for automatic (plug-in) bandwidth selection in a multivariate kernel regression. From the book, and the LOCFIT documentation, it is not clear whether this is possible. As

Re: [R] clustering with finite mixture model

2011-02-02 Thread Matt Shotwell
There are quite a few packages that work with finite mixtures, as evidenced by the descriptions here: http://cran.r-project.org/web/packages/index.html These might be useful: http://cran.r-project.org/web/packages/flexmix/index.html http://cran.r-project.org/web/packages/mclust/index.html

Re: [R] Help in getting info from a DataFrame

2011-02-02 Thread David Winsemius
On Jan 31, 2011, at 3:44 AM, ADias wrote: David Winsemius wrote: On Jan 30, 2011, at 5:27 PM, ADias wrote: dados- data .frame (Store = c (Setubal ,lx ,Aveiro ,Coimbra ,Aveiro,Evora,Aveiro,Coimbra,Setubal),Prod=c(Bloco Desenho,Bloco Desenho ,Tinteiro ,Régua ,Lapiseira ,Regua

[R] Applying multiple functions to one object

2011-02-02 Thread Karl Ove Hufthammer
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply’) somewhere. Example: If the function was named ’fun’ the output of fun(3.14, mode, typeof, class) would be identical to the output of

Re: [R] Applying multiple functions to one object

2011-02-02 Thread Eik Vettorazzi
Hi Karl, same to me. Much of the times when coding I think, 'damn it, I have seen that before, but where...' ... and so the following is from scratch, not from memory. fun-function(x,...){ mthd-list(...) lapply(mthd,function(m) do.call(m,list(x))) } fun(3.14, mode, typeof, class) there is no

[R] General Solution to Drawing a Spline Curve in 3d?

2011-02-02 Thread Bryan Hanson
Hello Again... I know that R has plenty of functions for drawing splines between two points in 2d, and plenty of ways to fit a spline curve among various points in 2d or 3d (I think), but, is there a function which can be used to draw a simple spline curve between any two points in 3d

Re: [R] error in density plot

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: Ramya ramya.victory at gmail.com writes: I have the code for the density plot j - 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i])) } This gives me an error Error in

[R] update not working

2011-02-02 Thread Luis Ridao
R-help, I'm using the update command for a multiple regression model and it is just not working: update(model1, . ~ . – temp:wind:rad,data=ozone.pollution) Error: unexpected input in model2-update(model1, . ~ . – summary(model1) Call: lm(formula = ozone ~ temp * wind * rad + I(rad^2) +

Re: [R] Regression type 2, x measured with error

2011-02-02 Thread misil
Excellent!! thanks for all! misil 2011/2/1 mbedward [via R] ml-node+3253006-114577237-210...@n4.nabble.comml-node%2b3253006-114577237-210...@n4.nabble.com Another search term is geometric mean regression. For simple models you can try the lmodel2 package. Michael On 2 February 2011

[R] matrix and a function - apply function

2011-02-02 Thread ADias
Hi I have this function and this matrix: function(x,y) x+y/x m-matrix(c(1,2,4,2,10,8),3,2) m [,1] [,2] [1,]12 [2,]2 10 [3,]48 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the image in order to get this results: for point

[R] Need help subsetting time series data

2011-02-02 Thread Nathaniel
Hi all, I have multiple datasets of time series data taken from GPS collars. The collars are supposed to take a fix every hour on the half hour, i.e., 0:30, 1:30, 2:30...23:30, (because it sometimes takes longer for the collars to acquire a location the minute of these locations vary from

[R] Help me apply mapply

2011-02-02 Thread Alaios
Hello all I would like to ask your help use mapply. I have a function called findCell that takes two arguments(x,sr) where x is a vector of size two (e.g x-c(2,3) and sr is a matrix. I would like to call many times the findCell function (thus I need mapply) for different x inputs but always for

[R] SVM Prediction and Plot

2011-02-02 Thread Brian
Hi I'm trying to predict using a model I fitted with SVM. I constructed the model (called Svm) using a training set, and now I want to use a test set (called BankTest) for prediction. The response variable is in the first column of BankTest. SvmPred = predict(Svm, BankTest[,-1],

Re: [R] matrix and a function - apply function

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 9:12 AM, ADias wrote: Hi I have this function and this matrix: function(x,y) x+y/x m-matrix(c(1,2,4,2,10,8),3,2) m [,1] [,2] [1,]12 [2,]2 10 [3,]48 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the

Re: [R] SVM Prediction and Plot

2011-02-02 Thread Steve Lianoglou
Hi, On Wed, Feb 2, 2011 at 9:56 AM, Brian ctto...@hotmail.com wrote: Hi I'm trying to predict using a model I fitted with SVM. I constructed the model (called Svm) using a training set, and now I want to use a test set (called BankTest) for prediction. The response variable is in the

Re: [R] matrix and a function - apply function

2011-02-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.02.2011 16:05:21: On Feb 2, 2011, at 9:12 AM, ADias wrote: Hi I have this function and this matrix: function(x,y) x+y/x m-matrix(c(1,2,4,2,10,8),3,2) m [,1] [,2] [1,]12 [2,]2 10 [3,]48

Re: [R] matrix and a function - apply function

2011-02-02 Thread Eik Vettorazzi
there is no need for 'apply' here, because R can handle vectors. ord-m[,1]+m[,2]/m[,1] Am 02.02.2011 15:12, schrieb ADias: Hi I have this function and this matrix: function(x,y) x+y/x m-matrix(c(1,2,4,2,10,8),3,2) m [,1] [,2] [1,]12 [2,]2 10 [3,]48

[R] grey scale graphs

2011-02-02 Thread Sebastián Daza
Hi everyone, Does anyone know how to get black and white theme (grey scale,, I would say) graphs using lattice or ggplot2, as it is shown in this webpage: http://lmdvr.r-forge.r-project.org/figures/figures.html? I am using Sweave, and I cannot get that color configuration. I have added the

Re: [R] update not working

2011-02-02 Thread Ista Zahn
Hi Luis, Well, when I copied your code I discovered that On Wed, Feb 2, 2011 at 9:42 AM, Luis Ridao luri...@gmail.com wrote: R-help, I'm using the update command for a multiple regression model and it is just not working: update(model1, . ~ . – temp:wind:rad,data=ozone.pollution)

Re: [R] help

2011-02-02 Thread Wacek Kusnierczyk
On 2/2/11 3:59 AM, Łukasz Ręcławowicz wrote: We don't need a loop! require(Rmpfr) factorial(mpfr(1:500,3800)) This is very good! I get an unexpected warning, though: Warning message: In if (mpfr.is.integer(x)) round(r) else r : the condition has length 1 and only the first element will

Re: [R] grey scale graphs

2011-02-02 Thread Ista Zahn
Well, if you're using pdf, you could set the gray option there, e.g., pdf.options(colormodel=gray) Or you could just use a gray theme. In ggplot2 use + theme_gray() Not sure in lattice, but I think it also has a themeing system. Best, Ista 2011/2/2 Sebastián Daza sebastian.d...@gmail.com: Hi

[R] drawing from one cell to another using layout() - possible?

2011-02-02 Thread Mark Heckmann
Is it possible to cross the cell boundaries set by layout using base graphics? I.e. I want to draw e.g. a line from one layout cell to another. Is there a way to do that? layout(matrix(c(1,2), byrow=TRUE, ncol=2)) plot.new() text(0,0,paste(rep(a, 200), collapse=), xpd=T) layout.show(2) I would

Re: [R] help

2011-02-02 Thread Eik Vettorazzi
Hi, maybe you rethink your calculations. Just for curiosity, what's the purpose? First of all, using prod(1:j-1-.25) #and prod(1:j) instead of a loop is much more efficent. If you need all values for a[1] up to a[j] you can use cumprod But this doesn't get you rid of numeric overflow but

Re: [R] Finding the maximum in a particular group in a dataframe

2011-02-02 Thread Dennis Murphy
Hi: Using df as your data frame, max(subset(df, condition == 'GPR119a', select = responce)) [1] 0.6451204 You asked this question yesterday with several correct responses. What was wrong with them? Dennis On Wed, Feb 2, 2011 at 12:48 AM, Asan Ramzan asanram...@yahoo.com wrote: Hello I am

Re: [R] SMA and EMA in package TTR

2011-02-02 Thread Joshua Ulrich
Hi Anyi, That's not currently possible. You could use the rollmean function in the development version of the zoo package (on R-forge) to calculate the simple moving average as you described. I would like to add this as an option to TTR functions, but it is not high on my priority list. I

Re: [R] Function to locate points in 3d octants or points on twoaxes

2011-02-02 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bryan Hanson Sent: Wednesday, February 02, 2011 5:23 AM To: Petr Savicky Cc: r-help@r-project.org Subject: Re: [R] Function to locate points in 3d octants or points on twoaxes

Re: [R] Acf of Frima

2011-02-02 Thread Spencer Graves
What's farima? functional arima or fractional arima? If the former, the fda package includes a function cor.fd for correlation matrix from functional data object(s). If the latter, I suggest you use sos as follows: library(sos) (fr - findFn('fractional arima')) findFn searches a

Re: [R] Function to locate points in 3d octants or points on twoaxes

2011-02-02 Thread Bryan Hanson
Thanks Dan for pointing that out. My question really arose from the need to draw splines between arbitrary 3d pairs of points, so I posted a new question to the list addressing that more specifically. While the issue of 3d splines must have been dealt with in graphics/ animation oriented

Re: [R] subset in a BIG matrix

2011-02-02 Thread jim holtman
To solve it, a little more data would help. At least provide exactly the statements you are using and an 'str' of the objects; e.g., str(matrix2) str(condition2) error message might indicate that the length of condition2 is larger than the subset of matrix2 that you want. On Wed, Feb 2, 2011

Re: [R] subset in a BIG matrix

2011-02-02 Thread Steve Lianoglou
Hi, On Wed, Feb 2, 2011 at 8:30 AM, alcesgabbo alcesga...@hotmail.com wrote: I have a matrix with a lot of values inside.. when I execute the folowing command matrix2=subset(martix, condition.) it works... but after the previous command I execute another subset

Re: [R] grey scale graphs

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 10:26 AM, Sebastián Daza wrote: Hi everyone, Does anyone know how to get black and white theme (grey scale,, I would say) graphs using lattice or ggplot2, as it is shown in this webpage: http://lmdvr.r-forge.r-project.org/figures/figures.html? I am using Sweave, and I

[R] Why my package is not being generated?

2011-02-02 Thread Cristiano Strieder
Hi all, I have commited a new release of my package and waited for more than one day. After that install.packages(tests,repos=http://r-forge.r-projet.org;) still returns package 'tests' is not available. I have done the local build check and the package seems ok. Also have mofified the Title in

Re: [R] SVM Prediction and Plot

2011-02-02 Thread Brian
Thanks for the reply. When I run this: head(SvmPred) 3570 2361 5406 2041 3440 4123 NNYYYY Levels: N Y -- View this message in context: http://r.789695.n4.nabble.com/SVM-Prediction-and-Plot-tp3254421p3254570.html Sent from the R help mailing list archive at

[R] Efficient way to determine if a data frame has missing observations

2011-02-02 Thread H Roark
I have a data set covering a large number of cities with values for characteristics such as land area, population, and employment. The problem I have is that some cities lack observations for some of the characteristics and I'd like a quick way to determine which cities have missing data. For

[R] exact logistic regression

2011-02-02 Thread Den
Hello to R people Does anybody know to calculate exact logistic regression in R? Does such option exist anywhere? Surprisingly, could not find it using search engine. It is hard to believe, however, that such useful function is not implemented in R yet? Could you help, please Thank you Denis

[R] Merging by factor variables

2011-02-02 Thread H Roark
I'm wondering about the behavior of the merge function when using factors as by variables. I know that when you combine two factors using c() the results can be odd, as in: c(factor(1:5),factor(6:10)) which prints: [1] 1 2 3 4 5 1 2 3 4 5 I presume this is because factors are actually stored

[R] Average of several line plots

2011-02-02 Thread mattnixon
Hi, I have several data sets which are all approximately within the same values as each other (both X and Y) and all of these data sets more or less overlap each other when plotted on the same graph. However, although each data set varies between approximately the same range, there are vastly

Re: [R] Function to locate points in 3d octants or points on twoaxes

2011-02-02 Thread David Winsemius
On Feb 2, 2011, at 12:28 PM, Bryan Hanson wrote: Thanks Dan for pointing that out. My question really arose from the need to draw splines between arbitrary 3d pairs of points, so I posted a new question to the list addressing that more specifically. While the issue of 3d splines must

Re: [R] Merging by factor variables

2011-02-02 Thread Erik Iverson
H Roark wrote: I'm wondering about the behavior of the merge function when using factors as by variables. I know that when you combine two factors using c() the results can be odd, as in: c(factor(1:5),factor(6:10)) which prints: [1] 1 2 3 4 5 1 2 3 4 5 I presume this is because factors

Re: [R] Efficient way to determine if a data frame has missing observations

2011-02-02 Thread Erik Iverson
H Roark wrote: I have a data set covering a large number of cities with values for characteristics such as land area, population, and employment. The problem I have is that some cities lack observations for some of the characteristics and I'd like a quick way to determine which cities have

Re: [R] SVM Prediction and Plot

2011-02-02 Thread Steve Lianoglou
Hi, On Wed, Feb 2, 2011 at 10:35 AM, Brian ctto...@hotmail.com wrote: Thanks for the reply. When I run this: head(SvmPred) 3570 2361 5406 2041 3440 4123   N    N    Y    Y    Y    Y Levels: N Y Hmmm ... I think we'll need more info. It looks like it should be working. By your output,

Re: [R] Efficient way to determine if a data frame has missing observations

2011-02-02 Thread Henrique Dallazuanna
Try this: subset(as.data.frame(xtabs( ~ city + var, df)), !Freq) On Wed, Feb 2, 2011 at 1:49 PM, H Roark hrbuil...@hotmail.com wrote: I have a data set covering a large number of cities with values for characteristics such as land area, population, and employment. The problem I have is

Re: [R] Average of several line plots

2011-02-02 Thread Peter Ehlers
On 2011-02-02 08:44, mattnixon wrote: Hi, I have several data sets which are all approximately within the same values as each other (both X and Y) and all of these data sets more or less overlap each other when plotted on the same graph. However, although each data set varies between

[R] Indexing from two variables

2011-02-02 Thread dunner
Hello, thank you all for your patience and time I am essentially trying to get disorganised data into long form for linear modelling. I have 2 dataframes rec and book Each row in book needs to be pasted onto the end of several of the rows of rec according to two variables in the row: MRN and

Re: [R] Average of several line plots

2011-02-02 Thread Eduardo de Oliveira Horta
It is not clear from your message whether these data represent functions or such. Could you perhaps bring up an example? I'm guessing each data set contains evaluation points and function values at those points, and that you would like to plot these functions and the mean function all on the same

Re: [R] Indexing from two variables

2011-02-02 Thread Ista Zahn
Hard to know exactly without seeing the structrure of rec and book, but I would start with ?merge Best, Ista On Wed, Feb 2, 2011 at 2:06 PM, dunner ross.du...@tcd.ie wrote: Hello, thank you all for your patience and time I am essentially trying to get disorganised data into long form for

  1   2   >