[R] select row
Hi all, I have a little problem selecting some rows from a data.frame. I'd like to select the rows where a determinated column take a partivolar value. For example: tab id x y 124-2005 1621814 4834991 224-2005 1621856 4834907 324-2005 1621763 4834956 4 25-2006 1622330 4835189 5 25-2006 1622533 4834834 6 25-2006 1622535 4834909 7 25-2006 1622543 4834803 8 28-2005 1622798 4835043 9 28-2005 1622299 4835129 I'd like to select the row where id=25-2006 I searched on the search of the R site but I did'nt find anything of simple. Can someone help me? Thank you very much Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] select row
Thanks all of you for the help! Hi all, I have a little problem selecting some rows from a data.frame. I'd like to select the rows where a determinated column take a partivolar value. For example: tab id x y 124-2005 1621814 4834991 224-2005 1621856 4834907 324-2005 1621763 4834956 4 25-2006 1622330 4835189 5 25-2006 1622533 4834834 6 25-2006 1622535 4834909 7 25-2006 1622543 4834803 8 28-2005 1622798 4835043 9 28-2005 1622299 4835129 I'd like to select the row where id=25-2006 I searched on the search of the R site but I did'nt find anything of simple. Can someone help me? Thank you very much Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://mrd.mail.yahoo.com/try_beta?.intl=ca __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] gpclib problem
Hi all, I am trying to test the new adehabitat package but I have a problem with a linked library, gpclib. When I try do install it I have this output: install.packages(gpclib, dependencies=TRUE, repos=http://cran.cnr.berkeley.edu/;) Avviso in install.packages(gpclib, dependencies = TRUE, repos = http://cran.cnr.berkeley.edu/;) : argument 'lib' is missing: using /usr/local/lib/R/site-library dependency ''gpclib'' is not available I have the same problem in other repository. Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] gpclib library
Hi my OS is Linux Debian distribution, my R vers is 2.4.0 Patched (2006-11-25 r39997) I tried several repositories but the output is ever the same Thank yor for your help All the best Leonardo Prof Brian Ripley ha scritto: It's a _package_ that you are looking for (there is something else called a gpclib library, to do with GNU Pascal). You haven't told us your OS or R version, so we don't know what file you are looking for. But try another mirror if one appears not to work (and using a US mirror with an email address in Italy seems odd). On Wed, 4 Apr 2007, Leonardo Lami wrote: Hi all, I'm tring to download the gpclib library but I don't find it in the old repository install.packages(c(gpclib), dependencies=TRUE, repos=http://cran.cnr.berkeley.edu/;) Avviso in install.packages(c(gpclib), dependencies = TRUE, repos = http://cran.cnr.berkeley.edu/;) : argument 'lib' is missing: using /usr/local/lib/R/site-library That's not what that message says: presumably you got some more output. May be my old library have some problem: library(gpclib) Errore in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : in 'gpclib', metodi da esportare specificati, ma nessuno definito: show, get.bbox, plot, intersect, union, setdiff, [, append.poly, scale.poly, area.poly, get.pts, coerce Errore: caricamento pacchetto/namespace fallito per 'gpclib' Someone knows where I can find the library Thank you Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] selection of character
Hi all, I have a simple question: I have a character vector like this [1] 10_1 1_1 11_1 2_1 3_1 4_1 5_1 6_1 7_1 8_1 [11] 9_1 1_3 2_3 3_3 4_3 1_4 2_4 3_4 4_4 5_4 [21] 6_4 7_4 1_5 2_5 10_6 11_6 12_6 1_6 2_6 3_6 [31] 4_6 5_6 6_6 7_6 8_6 9_6 1_7 1_8 2_8 3_8 [41] 10_9 1_9 2_9 3_9 4_9 5_9 6_9 7_9 8_9 9_9 [43] 1_10 2_10 and I'd like to have a vector with only the value after the under scor, like this: [1] 1 1 1 1 1 1 1 1 1 1 [11] 1 3 3 3 3 4 4 4 4 4 [21] 4 4 5 5 6 6 6 6 6 6 [31] 6 6 6 6 6 6 7 8 8 8 [41] 9 9 9 9 9 9 9 9 9 9 [43] 10 10 Is there a simple function to do this? Thank you for your help All the best Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] gpclib library
Hi all, I'm tring to download the gpclib library but I don't find it in the old repository install.packages(c(gpclib), dependencies=TRUE, repos=http://cran.cnr.berkeley.edu/;) Avviso in install.packages(c(gpclib), dependencies = TRUE, repos = http://cran.cnr.berkeley.edu/;) : argument 'lib' is missing: using /usr/local/lib/R/site-library May be my old library have some problem: library(gpclib) Errore in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : in 'gpclib', metodi da esportare specificati, ma nessuno definito: show, get.bbox, plot, intersect, union, setdiff, [, append.poly, scale.poly, area.poly, get.pts, coerce Errore: caricamento pacchetto/namespace fallito per 'gpclib' Someone knows where I can find the library Thank you Leonardo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] data.frame to shape
Hi all, I have a simple question: I have a data.frame like this: id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50 1647405 4815347 5 50 1647292 4815552 6 50 1647737 4815410 7 74 1647555 4815201 8 74 1647464 4815023 9 74 1646970 4815129 10 74 1646895 4815264 11 74 1646762 4815513 and I'd like to trasform it with the convert.to.shapefile function (shapefiles package) but to make this I must have a data.frame like this: id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50 1647405 4815347 5 50 1647292 4815552 6 50 1647737 4815410 7 50 1647685 4815259 8 74 1647555 4815201 9 74 1647464 4815023 10 74 1646970 4815129 11 74 1646895 4815264 12 74 1646762 4815513 13 74 1646762 4815513 with the first point of every id repeated to close the polygon. There is a function to make this indipendently by the number of the id Best regards Leonardo -- Leonardo Lami email + jabber: [EMAIL PROTECTED] www.faunalia.it Cell: (+39)349-1310164 Tel+Fax: (+39) 0587-213742 Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Fisher's discriminant functions
Hi, I have the same problem. I found a solution but I think there is something of more simple and correct. I take a group and I put 0 the values of the other group, after I use the function glm to abtain the Fisher's discriminant function for this group. I repeat the same for all the groups. Some times ago i try to make the same query but without results. Best wishes Leonardo Alle 22:22, giovedì 29 settembre 2005, Kjetil Holuerson ha scritto: This are in various packages, you could have a look at ade4 (on CRAN). Kjetil C NL wrote: Hi everyone, I'm trying to solve a problem about how to get the Fisher's discriminant functions of a lda (linear discriminant analysis) object, I mean, the object obtained from doing lda(formula, data) function of the package MASS in R-project. This object gives me the canonical linear functions (n-1 coefficients matrix of n groups at least), and only with this information I could predict the group of an observation data using the predict function. But what I need is the Fisher's discriminant functions (n coefficients matrix of n groups) in order to classify my future data. The object predict gives me only the following attributes x, posterior and class, but none of them are the coefficients matrix of the Fisher's discriminant functions, and the reason why I'm not using the predict function for my predictions is because the time spent is very high for what I'm expecting, about 0.5 seconds while I can obtain this prediction with the Fisher's discriminant functions faster. So, I don't know if there's a package which I can use to obtain the mentioned coefficients matrix of the Fisher's discriminant functions. I anyone can help, I would appreciate it greatly. Thank you and regards. Carlos Niharra López __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] lda discriminant functions
Hi list, I'm looking about lda function. I'd like to know how calcolate the value of the discriminant functions for the original datas. I see that in the result object lda there is $scaling a matrix which transforms observations to discriminant functions, normalized so that within groups covariance matrix is spherical. I'd like to have the value of the discriminant function not normalized. Best regards Leonardo -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] lda function
Hello, I'm tring to make a linear discriminant analysis eith lda (MASS). In the value of the resulting object is there information about the value of the centroids of the discriminated group for the discriminant functions? Thank you in advance for your help! Leonardo -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] predictive classification groups functions
Hi all, I have a little question about linear discriminant analysis in R. I have a dataframe with datas groupped by 4 cluster. I'd like to know if there is a command that give 4 predictive classification groups functions (one for every cluster group). Thanks of all Leonardo -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] tapply and NA value
Hi, I'm writing for a little help. I have a dataframe with same NA value and I'd like to obtain the means of the value of a coloumn grouped by the levels of a factor coloumn of the datframe. I'm using the function tapply but I see that if only a NA value is present the result is NA. There is an option to have the correct result or I must use an other function? Thanks of all Leonardo -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] tapply and NA value
Thanks very much! Best of all, Leonardo Alle 10:52, venerdì 25 marzo 2005, Dimitris Rizopoulos ha scritto: you should look at the 'na.rm=FALSE' argument of '?mean()', i.e., x - rnorm(100); x[sample(100, 10)] - NA f - sample(letters[1:5], 100, TRUE) ### tapply(x, f, mean) tapply(x, f, mean, na.rm=TRUE) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: Leonardo Lami [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Friday, March 25, 2005 10:35 AM Subject: [R] tapply and NA value Hi, I'm writing for a little help. I have a dataframe with same NA value and I'd like to obtain the means of the value of a coloumn grouped by the levels of a factor coloumn of the datframe. I'm using the function tapply but I see that if only a NA value is present the result is NA. There is an option to have the correct result or I must use an other function? Thanks of all Leonardo -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] bar charts
Hi, I'd like plot a bar graphic of a array. I'd like to have the values of the single columns as juxtaposed bars (like in barplot with beside=TRUE) and I'd like to have the values of the single columns expressed like percentage of the sum of the coloumn. In this way all the bars are composed by the sum of the percentage of the values of a coloumn (with different colors) and all they have 100% value. Thanks Leonardo Lami -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Bar chart
Hi, I'd like plot a bar graphic of a array. I'd like to have the values of the single columns as juxtaposed bars (like in barplot with beside=TRUE) and I'd like to have the values of the single columns expressed like percentage of the sum of the coloumn. In this way all the bars are composed by the sum of the percentage of the values of a coloumn (with different colors) and all they have 100% value. Thanks Leonardo Lami -- Leonardo Lami [EMAIL PROTECTED]www.faunalia.it Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy Tel: (+39)349-1310164 GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html https://www.biglumber.com __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html