Quoting "Shengxi David Wu" <dswu(a)stanford.edu>du>:
I am interested in using YourCast as a student for
academic purposes.
I'm a relatively new user to R, and so had a bit of difficulty running
the example. I've successfully loaded the YourCast software into R, as
well as imported the sma package, but when I input the line:
dta <- dataobj()
it gives me the following:
"Reading file /allc.txt
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
cannot open file '/allc.txt': No such file or directory"
Any help would be greatly appreciated.
Many thanks,
David
--
yourcast mailing list served by Harvard-MIT Data Center
List Address: yourcast(a)lists.gking.harvard.edu
Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/?info=yourcast
Hello Shengxi,
The command you mentioned
dta <- dataobj()
does not work any longer, and we are updating the documentation.
However you can see
an example of dataobj.Rdata inside the data/ directory, even if it
does not show in the library. You can just get
it from the package and use the load command as I show you here. Try just to
use the load command in the directory where dataobj.Rdata resides. Hope this
helps let me know if any more issues.
library(YourCast)
Loading required package: sma
data(package="YourCast")
Data sets in package ~YourCast~:
adjacency Country Similarity-Levels
allc All causes of death
brst Breast cancer
cerv Cervical cancer
cntry.codes Country codes and names
dgst Digestive disease
fat Covariate fat
gdp Covariate gross domestic product
hc Covariate human capital
lung Lung cancer
population World Population
rspi Respiratory disease
suic Suicide
tobacco Covariate tobacco consumption
trns Death cause by transportation accidents
data(allc)
ls()
[1] "allc"
allc[1:10, ]
allc csid strata
1 NA 5150001920 2
2 NA 5150001921 2
3 NA 5150001922 2
4 NA 5150001923 2
5 NA 5150001924 2
6 NA 5150001925 2
7 NA 5150001926 2
8 NA 5150001927 2
9 NA 5150001928 2
10 NA 5150001929 2
setwd("/nfs/home/E/evillalo/cvswork/yourcast/yourcast/YourCast/data")
getwd()
[1] "/nfs/home/E/evillalo/cvswork/yourcast/yourcast/YourCast/data"
dir(".")
[1] "245045" "418050" "428025"
[4] "adjacency.txt" "allc.txt"
"brst.txt"
[7] "cerv.txt" "cntry.codes.txt" "CVS"
[10] "dataobj.Rdata" "dgst.txt" "fat.txt"
[13] "gdp.txt" "hc.txt" "lung.txt"
[16] "population.txt" "prior_brst_s3.Rdata" "rspi.txt"
[19] "suic.txt" "tobacco.txt" "trns.txt"
dta <- load("dataobj.Rdata")
dta
[1] "dataobj"
names(dataobj)
[1] "data" "index.code" "proximity"
"G.names"
In addition you can run some of the demos as (see the demo directory)
demo(chp.2.7)
When you run the demo then after you use ls() you will see that you
have dataobj in your R working space, because every time we run a demo
we put the corresponding dataobj in the working environment.
All the demos should be run as demo(chp.#.#) where the two # referred
to the chapter and figure (see the demo directory to see which
chapter and figures to run).
Hope this help, let me know if you have questions
Elena
--
yourcast mailing list served by Harvard-MIT Data Center
List Address: yourcast(a)lists.gking.harvard.edu
Subscribe/Unsubscribe:
http://lists.gking.harvard.edu/?info=yourcast