achilleas.psomas@wsl.ch
2005-Feb-09 16:15 UTC
[R] Using %variable% object-column names in function
Dear R-help.. I am rather new in R so i would appreciate your help in my problem.. I cant seem to be able to write a function that has arguments being objects and column names of these ojbects... A simple example code that doesnt work is the following.. auto_plot <- function (object1,column1,object2,column2) { plot(object1$column1,object2$column2) } I get the message: Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ Maybe the solution is simple but i just couldnt find it.. Thanks a lot for your help.. Achilleas.
achilleas.psomas@wsl.ch
2005-Feb-09 17:12 UTC
[R] Using %variable% object-column names in function
> Dear R-help.. > > I am rather new in R so i would appreciate your help in my problem.. > I cant seem to be able to write a function that has arguments being objects > and > column names of these ojbects... > A simple example code that doesnt work is the following.. > > > auto_plot <- function (object1,column1,object2,column2) { > > > plot(object1$column1,object2$column2) > > } > > > I get the message: > Error in xy.coords(x, y, xlabel, ylabel, log) : > x and y lengths differ > > Maybe the solution is simple but i just couldnt find it.. > > > Thanks a lot for your help.. > > Achilleas. > >
achilleas.psomas at wsl.ch wrote:> Dear R-help.. > > I am rather new in R so i would appreciate your help in my problem.. > I cant seem to be able to write a function that has arguments being objects and > column names of these ojbects... > A simple example code that doesnt work is the following.. > > > auto_plot <- function (object1,column1,object2,column2) { > > > plot(object1$column1,object2$column2)plot(object1[[column1]], object2[[column2]]) Uwe Ligges> } > > > I get the message: > Error in xy.coords(x, y, xlabel, ylabel, log) : > x and y lengths differ > > Maybe the solution is simple but i just couldnt find it.. > > > Thanks a lot for your help.. > > Achilleas. > > ______________________________________________ > R-help at 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
Dear R-help... I am rather new so I would appreciate your help.. My question if the following.. I have generated (with R) a data frame DF looking like this..> print(DF)X1 X2 2 C_05_04 C_05_11 3 C_05_04 C_05_17 4 C_05_04 C_06_08 5 C_05_04 C_06_29 6 C_05_04 C_07_16 Where "C_05_04"....and all the rest data are objects-names already calculated and existing in my R workspace... What i tried to do (and i doesnt work) is the following e.g x1 <- DF[1,1] C_05_04 (Where C_05_04 exists as an object in the workspace ) and then try to apply any kind of function using this x1 Is there a way to specify that x1 should be concidered as an object and not just as data ? I hope i have explained clearly enough my question.. I would appreciate any help. Achilleas.
<achilleas.psomas <at> wsl.ch> writes: : : Dear R-help... : : I am rather new so I would appreciate your help.. : My question if the following.. : : I have generated (with R) a data frame DF looking like this.. : : > print(DF) : X1 X2 : 2 C_05_04 C_05_11 : 3 C_05_04 C_05_17 : 4 C_05_04 C_06_08 : 5 C_05_04 C_06_29 : 6 C_05_04 C_07_16 : : Where "C_05_04"....and all the rest data are objects-names already calculated : and existing in my R workspace... : What i tried to do (and i doesnt work) is the following : e.g : : x1 <- DF[1,1] : C_05_04 : : (Where C_05_04 exists as an object in the workspace ) : and then try to apply any kind of function using this x1 : Is there a way to specify that x1 should be concidered as an object and not just : as data ? : : I hope i have explained clearly enough my question.. I think your setup is clear enough but perhaps you could give some more background on your application since there might be a better data structure in the first place.
Hello R-Helpers.. I am still new in R and I have the following question.. I am applying the function chull on a 2D dataset and have the convex hull nicely calculated and plotted. Do you know if there is a way to extract the coordinates of the line created from the connection of the chull data points.. I have alredy tried with "approx" to lineary interpolate but its not working correctly since the interpolated values sometimes fall inside the convex . Using the "yleft" or "yright" doesnt seem to help.. Any suggestions? Thank you in advance Achilleas.
Hello R-Helpers.. I am still new in R and I have the following question.. I am applying the function chull on a 2D dataset and have the convex hull nicely calculated and plotted. Do you know if there is a way to extract the coordinates of the line created from the connection of the chull data points.. I have alredy tried with "approx" to lineary interpolate but its not working correctly since the interpolated values sometimes fall inside the convex . Using the "yleft" or "yright" doesnt seem to help.. Any suggestions? Thank you in advance Achilleas Psomas
achilleas.psomas@wsl.ch
2005-Apr-14 18:54 UTC
[R] n-dimensional(hypercube)distance calculation..
Dear R-help.. I am rather new in R so i would appreciate your help in my problem.. I have 3 types of vegetation (A,B,C),50 measurements per class and 100 variables per measurement. I would like to perform seperability analysis between these classes meaning... a.)create the hypercube from these 100 variables b.)"plot" the 50 measurements for each class and identify the position of the center of each class.. c.)calculate the distances between each class center using Euclidean, Jeffries-Matusita or other measures. I have tried searching all keywords at CRAN but i was not able to find a post or a package that could be used for an analysis like that.. I would appreciate your help... Kind regards to all R-helpers.. Achilleas.
Hello R-Helpers.. Does anybody know if the Jeffries-Matusita distance is already applied in R code? Does it exist in any available package or has been ? I searched CRAN but couldnt find anything there.. Thanks in advance for your help.. AK
I believe not, but it would be a function of less than 10 lines, probably quicker to write than search for, find _and_ check what you found agrees with your definition (and BTW, more than one defn exists for it).> RSiteSearch("Matusita")A search query has been submitted to http://search.r-project.org The results page should open in your browser shortly (in 2.1.0 beta) gave no matches, and it that is pretty comprehensive. On Fri, 15 Apr 2005 achilleas.psomas at wsl.ch wrote:> Does anybody know if the Jeffries-Matusita distance is already applied in R > code? > Does it exist in any available package or has been ? I searched CRAN but couldnt > find anything there..-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595