[R] The way giving the suitable data structure to the obtained data for the use of "prospectr"

rhotuser m@iii@g oii y@hoo@co@jp rhotuser m@iii@g oii y@hoo@co@jp
Thu Sep 19 15:08:15 CEST 2019


Dear Sir,
    I want to use the "prospectr" for the obtained spectra like the attached file, "Nirspectra".
  However, my understanding level of the data structure of "NIRsoil" is not yet enough.
  reference:  https://cran.r-project.org/web/packages/prospectr/vignettes/prospectr-intro.pdf
data(NIRsoil)str(NIRsoil) ----->  A little complicated for me.
I have 2 questions.
 I want to make the data structure of "Nirspectra" to be applied directly for "prospectre".
1. Please tell me the detail way for giving suitable data structure toward  "Nirspectra".
  abc<-read.csv('Nirspectra.csv')

  -------------------------------------------------------------------------------  My estimation of the final data sturucture of "Nirspectra"  for the direct use of "prospectr"
 'data.frame':   57 obs. of  3 variables:   $ train: num  1 1 0 1 1 0 1 1 0 1 ...   $ dep  : num  87.300003 87 87.099998 89.699997 84.900002 84.699997 89.300003...   $ spc  : num [2:58, 1:36] ...
2. Which is right, num [2:58, 1:36] or num [1:58, 1:36] ?
Best Regards,
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nirspectra.csv
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20190919/0165df88/attachment.ksh>


More information about the R-help mailing list