jeudi 24 juin 2021

wildcards to download particular csv

Still very new to R, so please excuse me.

I am trying to download csv data from the Sloane Digital Website Survey. Within R I do the following -

astro1 <- read.csv("https://dr14.sdss.org/optical/spectrum/view/data/format=csv/spec=full?mjd=55359&fiberid=596&plateid=4055")

This downloads 1 csv spectra per fibre ID per plate [here, plateid=4055]. However, if there are several hundred fibre IDs it will be a very long couple of days.

  1. Is there a way to batch download all csv data for all fibre IDs? I tried fibreid=* (and "", " ", @, but got the following error -

    "no lines available in input", or unexpected string constant.

  2. If for example there are 100 .csv files per plate. All will have a common x-axis (wavelength), but a different 3rd column (best fit, for y-axis). Is there a way to get the downloaded csv tables to form 1 very large dataset, with the same common axis (wavelength), and subsequent columns to show only the Best Fit columns?

Many thx




Aucun commentaire:

Enregistrer un commentaire