[R] Sweave absolute path versus relative path

2011-10-29 Thread Trevor Davies
Sorry, I should have really started a new thread with this because really it
is a new question only loosely related to the first Q.
Thanks for the assist.

As  suggested I switched over to sweave.  I have a lot of .tex tables that I
 have already created that I was previously inserting into my tex document
 (using \input).  The journal I plan on submitting to eventually wants the
 final .tex file so I thought it would be a good idea to use Sweave, it makes
 a tex doc with my tables generated and it should be all good.

 I just spend a few hours trying to get the \SweaveInput commant to work
 properly.  I finally determined that I couldn't put the file in as an
 absolute path but it had to be a relative path.  I.e

 \SweaveInput{/home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex}
 gave the error:

 R CMD Sweave hitmiss.Rnw
 Error in SweaveReadFile(c(ifile, file), syntax, encoding = encoding) :
   no Sweave file with name
 './/home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex'
 found
 Calls: Anonymous - Sweave - SweaveReadFile - SweaveReadFile
 Execution halted
 make: *** [hitmiss.tex] Error 1

 However, when i use:

 \SweaveInput{../../../../../../../../home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex}
 It works fine.

 What am I missing here?
 Thanks.



[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Split an array into arbirtary sizes

2011-10-29 Thread Bazman76
sorry!

vols=read.csv(file=C:/Documents and Settings/Hugh/My
Documents/PhD/QuickDirtyVols.csv 
+  , header=TRUE, sep=,)
 x-ts(vols[,2])
 x

so I have an ts object of 500 elements.

I want to be able to split the array into say two parts of 250?

How can I do it?
I want to keep the elements in the same order



--
View this message in context: 
http://r.789695.n4.nabble.com/Split-an-array-into-arbirtary-sizes-tp3948938p3949426.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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 with ggplot backgrounds

2011-10-29 Thread RanRL
Hi, I have two questions regarding plotting of this dataset:

Product ColorStoreA StoreB StoreC   Price

A  Red  4  2378
Blue  5  22   78
   Greem4 3 2   80

B  Red   3 

And so on (Not all products have same colors).

I made 2 plots: one is a scatter where x=Price and y=Values (of different
stores). The different stores are facet_wrapped, and Color is indicated by
point color while Product by point_shape. 
Second plot is a polar plot of geom_bars with position=dodge for all
Products to differentiate the colors. The y value is the value for each
store (Price is not represented).

My questions:
1. for the first plot, I want to make a background area split into 3, top
right is red (indicating high-price/high-values), middle is yellow, the rest
is green (these are kind of reverse-log areas, like in heat maps).

2. for the second plot, the red-yellow green are just background geom_rects
filled in, but I cant figure out how to specify the xmin and xmax for this
(since they are discrete variables).

Any help will be appreciated, thanks.


--
View this message in context: 
http://r.789695.n4.nabble.com/help-with-ggplot-backgrounds-tp3949320p3949320.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] problem with glsm.krige: trendd and trend l must have similar specifications error

2011-10-29 Thread Christy Meredith
Hello, 

I used glsm.mcmc and likfit.glsm to create model. Now I want to predict at 
different locations, but I can't get glsm.krige to work. I keep getting the 
error that trend.d and trend.l must have similar specifications. I have tried 
numerous ways to include the covariates in the glsm.krige model, and I keep 
getting the same error message. The bolded part is the part that doesn't work. 
Any help would be appreciated!

reddmcmc=glsm.mcmc(geodata, coords=geodata$coords, 
data=geodata$data,model=list(family=poisson, 
cov.pars=c(50,8000),beta=c(-26,-.04,6.94),cov.model=spherical,nugget=5,trend=~powerb1+temp1),mcmc.input
 = mcmc.control(S.scale =.01 ,thin=10))
prepareredd1=prepare.likfit.glsm(reddmcmc)
lik.redd1.1 - likfit.glsm(prepareredd1, ini.phi = 10,cov.model = 
spherical,trend=~powerb1 + temp1)

# predict at new locations
trendpred=trend.spatial(~habitat2$powerb + habitat2$avgtemp)
test2 - glsm.krige(reddmcmc,coords,trend.l=trendpred)  # trend.d and trend.l 
must have similar specifications ?
test2 - glsm.krige(reddmcmc,coords,trend.l=habitat2$powerb + 
habitat2$avgtemp)  # same error message...
[[alternative HTML version deleted]]

__
R-help@r-project.org 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] How to plot survival data from multiple trials (simulations)?

2011-10-29 Thread Zheng Lu


 Dear all:
 
Could anyone please provide some R codes to plot the below survival data to 
compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction 
interval on the plot from these 2 trials.  I would like to simulate 1000 trials 
later. Thanks a lot for your great help and consideration!
yan
 
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
1 1 1 1 2.2636717 0.255634126 1 1 99.4 F
3 1 2 1 24.7719223 0.756458142 0 1 8.1 T
5 1 3 0 4.7685832 0.908777937 1 0 2.6 T
7 1 4 0 2.5934492 -0.231564522 1 1 7.4 T
9 1 5 0 4.7309141 -2.455991696 0 1 0.4 T
11 1 6 1 3.5904766 -0.459694803 1 1 13.1 T
13 1 7 1 4.8592495 0.983131140 1 1 17.8 T
15 1 8 1 3.1308760 -1.136462783 0 0 10.6 T
17 1 9 1 5.8127637 -0.131647588 0 1 1.2 T
19 1 10 0 4.0875668 -3.567509428 0 1 0.4 T
21 1 11 1 14.7112528 0.900416367 1 1 15.2 T
23 1 12 0 6.7290298 -0.140283251 0 0 8.5 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
25 1 13 0 6.6118789 -0.095603854 0 1 13.8 T
27 1 14 1 1.1191479 0.735691765 1 1 60.5 F
29 1 15 0 11.9169275 0.796172293 0 0 40.1 F
31 1 16 1 6.7940011 0.845746271 1 1 68.1 F
33 1 17 0 4.7380330 0.582527179 1 1 11.7 T
35 1 18 0 12.0571049 0.165637187 0 0 25.0 T
37 1 19 1 3.1922217 0.891862148 1 1 34.0 T
39 1 20 0 10.6253830 -0.747701704 0 1 7.8 T
41 1 21 0 2.0178336 -2.732716143 0 1 0.8 T
43 1 22 1 13.8066137 0.706372607 0 1 58.2 F
45 1 23 1 11.8844261 0.842735359 1 1 13.9 T
47 1 24 1 3.9546421 0.193353044 0 1 2.7 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
49 1 25 0 27.0913396 0.970400135 1 1 19.1 T
51 1 26 1 12.0249672 0.886403017 1 1 27.1 T
53 1 27 1 5.9453281 0.964694968 1 1 21.2 T
55 1 28 0 6.8084911 -1.333850454 1 0 4.1 T
57 1 29 1 8.3642227 -0.024960757 0 1 4.4 T
59 1 30 0 26.6382483 0.714020234 0 0 3.9 T
61 1 31 1 13.1107410 0.372041597 0 1 26.2 T
63 1 32 0 4.2271255 0.056569282 1 1 14.3 T
65 1 33 0 17.7269456 0.252550311 0 0 11.2 T
67 1 34 1 3.6215522 -0.282323084 0 0 0.3 T
69 1 35 1 19.3787770 0.349288143 0 1 5.2 T
71 1 36 0 8.9546567 0.945492048 1 1 15.2 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
73 1 37 0 2.7796959 -3.119155682 0 0 12.3 T
75 1 38 0 9.4029912 -0.793046460 0 1 1.2 T
77 1 39 1 7.8146429 0.888593758 1 1 8.0 T
79 1 40 0 9.6419102 0.525301532 1 1 22.4 T
81 1 41 1 3.3174969 0.915870306 1 1 24.7 T
83 1 42 1 12.4030358 0.661856980 1 1 16.4 T
85 1 43 1 24.2982862 0.710967270 0 1 5.5 T
87 1 44 0 10.4332028 0.940833126 1 0 2.9 T
89 1 45 0 4.7520799 0.897518558 1 1 32.6 T
91 1 46 0 2.7028663 -3.484128492 0 1 0.2 T
93 1 47 1 2.7572158 0.890976979 1 0 30.9 T
95 1 48 0 7.2240161 -0.377073350 0 0 3.7 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
97 1 49 0 20.6156368 0.500864314 0 1 12.2 T
99 1 50 1 12.8547093 0.982784519 1 1 54.4 F
2 2 1 1 3.0862631 0.931988949 1 1 199.2 F
4 2 2 1 18.6633707 0.540651036 0 1 8.1 T
6 2 3 0 5.5728260 -1.851336117 1 0 3.0 T
8 2 4 0 4.0740408 0.021119280 1 1 10.1 T
10 2 5 0 14.2396242 0.465013972 0 1 6.6 T
12 2 6 1 37.5234448 0.986992132 1 1 30.5 T
14 2 7 1 11.2925748 0.922905093 1 1 14.0 T
16 2 8 1 15.2298842 0.459418082 0 0 12.6 T
18 2 9 1 5.3266590 -1.487487920 0 1 0.3 T
20 2 10 0 11.7956270 0.606294774 0 1 26.9 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
22 2 11 1 26.0051377 0.823996317 1 1 8.6 T
24 2 12 0 4.7851855 -1.635216564 0 0 10.7 T
26 2 13 0 5.4896572 -1.085740446 0 1 3.8 T
28 2 14 1 15.0284557 0.981428564 1 1 56.1 F
30 2 15 0 15.3001584 -0.101949376 0 0 36.7 T
32 2 16 1 4.1838899 -0.002416447 1 1 26.0 T
34 2 17 0 1.9213881 0.678721863 1 1 15.5 T
36 2 18 0 22.0870166 0.682030393 0 0 18.8 T
38 2 19 1 7.8815644 0.938210236 1 1 25.9 T
40 2 20 0 6.8308086 -0.774314088 0 1 8.5 T
42 2 21 0 6.0056206 -0.656448295 0 1 5.4 T
44 2 22 1 11.9301049 0.137476151 0 1 32.2 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
46 2 23 1 4.4453597 0.932378925 1 1 18.3 T
48 2 24 1 7.0352655 0.142463064 0 1 2.4 T
50 2 25 0 22.1603315 0.990013687 1 1 23.5 T
52 2 26 1 1.7582992 0.041687569 1 1 13.6 T
54 2 27 1 4.0864310 0.893550143 1 1 18.7 T
56 2 28 0 3.7564158 0.149721394 1 0 3.1 T
58 2 29 1 23.7880592 0.312680371 0 1 4.0 T
60 2 30 0 7.3082204 0.084729300 0 0 3.4 T
62 2 31 1 29.8669157 0.779756301 0 1 24.3 T
64 2 32 0 6.7967624 0.228897567 1 1 15.8 T
66 2 33 0 9.0048160 -1.073334969 0 0 9.5 T
68 2 34 1 9.3920052 0.183028557 0 0 0.3 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
70 2 35 1 17.0794700 0.575865059 0 1 6.7 T
72 2 36 0 5.8638675 0.986021171 1 1 18.2 T
74 2 37 0 12.7073727 0.808851125 0 0 11.6 T
76 2 38 0 6.6391834 -0.515246589 0 1 1.5 T
78 2 39 1 4.0731162 0.640324530 1 1 6.9 T
80 2 40 0 8.1501724 0.963706289 1 1 37.9 T
82 2 41 1 7.1095450 0.852592536 1 1 19.9 T
84 2 42 1 6.3169479 0.686874101 1 1 23.2 T
86 2 43 1 12.8719503 -0.442671821 0 1 2.5 T
88 2 44 0 19.2469239 0.982064666 1 0 3.3 T
90 2 45 0 6.7743672 0.724107074 1 1 24.1 T
92 2 46 0 7.9332652 0.050580084 0 1 5.9 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
94 2 47 1 0.6997334 -0.146007844 1 0 23.7 T
96 2 48 0 14.6486847 0.723251604 0 0 4.5 T
98 2 49 0 4.1576131 0.232732832 0 1 15.6 T
100 2 50 1 7.2583626 0.811803286 1 1 49.0 F  

[R] Matching

2011-10-29 Thread shish matt
I have a spatial weight file in csv that I want as listw object in R.
The file has the following 3 variables (left to right in the file) -- OID_, NID 
and WEIGHTS. NID stands for the neighbors and OID_ as the origins. There are 
217 origins with 4 neighbors each.


I have been able to read the csv file as a data frame (test.csv). Then I tried 
to check whether the OID_ variable is in the right place in the dataframe. I 
used match for that using:
o
- match(OID_, OID_)
I am not sure whether this is the right way to match. Please advice.

Anyway, next I created a matrix object (m) using:

m
- as.matrix(test.csv[, -1])

Then I created object m1, using:

m1
- m[o, o]

Finally, I tried creating listw object using:
mat2listw(m1)
Here I get an error that x is not a square matrix.

Not sure what to do now. Any helo appreciated!

Thanks,
Shishm

__
R-help@r-project.org 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] Extracting data by row

2011-10-29 Thread Vinny Moriarty
Thanks everyone for you help with my last question, and now I have one last
one...


Here is a sample of my data in .csv format

site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63
06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56
06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51
06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53
06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60
06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66
06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 2, 29.68


My goal was to extract all of the rows from a certain depth. Using the
column sensor_depth_m to order my data by, I wanted all of the data from
10m. So this is what I wanted when I finished

site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68




To pull out all of the data from a 10m sensor depth I came up with the code:

Ten-dataTable1[(dataTable1$sensor_depth_m==10),]


But when I run it I just get an extra column tacked onto the end like this


site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c,
sensor_depth_m
06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63,10
06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56,10
06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51,10
06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53,10
06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57,10
06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60,10
06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66,10
06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68,10
06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68,10


It seems pretty straight forward, I'm not sure what I am missing.


Thanks

V

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] fPortfolio constraints

2011-10-29 Thread nguyenBW
I have a list of 5 stocks consisting of IBM, AXP, XOM, BA, GE. I am able to
solve the optimal portfolio without long only constraints along with group
weight constraints. However, I am not able to add one more constraint
regarding Beta of the portfolio with upper bound of 1.1 and lower bound of
.9. The Beta of each individual stock is in a set of defined data. May
anyone be able to help? Appreciated much.


--
View this message in context: 
http://r.789695.n4.nabble.com/fPortfolio-constraints-tp3950116p3950116.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] alternative option in skewness and kurtosis tests?

2011-10-29 Thread peter dalgaard

On Oct 25, 2011, at 18:23 , Xiang Gao wrote:

 I have a question about the D'Agostino skewness test and the Anscombe-Glynn
 kurtosis test.
 
 
 agostino.test(x, alternative = c(two.sided, less, greater))
 
 anscombe.test(x, alternative = c(two.sided, less, greater))
 
 The option alternative in those two functions seems to be the null
 hypothesis. In the output, the statement about the alternative hypothesis is
 correct, which is opposite to what you specify in command. An example
 below:

Certainly looks like a bug. You should contact the maintainers of the 
contributed package containing these tests. 

-pd


 
 
 
 skewdata =
 c(rep(44,5),rep(43,15),rep(42,10),rep(41,4),rep(40,3),rep(39,2),rep(38,1))
 
 agostino.test(skewdata, alternative = greater)
 
D'Agostino skewness test
 
 data:  skewdata
 
 skew = -1.0014, z = -1.7209, p-value = 0.04264
 
 alternative hypothesis: data have negative skewness
 
 
 anscombe.test(skewdata,  alternative=„less)
 
Anscombe-Glynn kurtosis test
 
 data:  skewdata
 
 kurt = 3.4748, z = 1.0716, p-value = 0.1419
 
 alternative hypothesis: kurtosis is greater than 3
 
 
 --
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org 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] Extracting data by row

2011-10-29 Thread Rainer Schuermann
On Friday 28 October 2011 18:04:59 Vinny Moriarty wrote:
 Thanks everyone for you help with my last question, and now I have one
 last one...

Here is what I would do, based on my understanding of your question:

# your data snippet as data frame
 x
  site  time_localtime_utc reef_type_code sensor_type
16 2006-04-09 10:20:00 2006-04-09 20:20:00BAKsb39
26 2006-04-09 10:40:00 2006-04-09 20:40:00BAKsb39
36 2006-04-09 11:00:00 2006-04-09 21:00:00BAKsb39
46 2006-04-09 11:20:00 2006-04-09 21:20:00BAKsb39
56 2006-04-09 11:40:00 2006-04-09 21:40:00BAKsb39
66 2006-04-09 12:00:00 2006-04-09 22:00:00BAKsb39
76 2006-04-09 12:20:00 2006-04-09 22:20:00BAKsb39
86 2006-04-09 12:40:00 2006-04-09 22:40:00BAKsb39
96 2006-04-09 13:00:00 2006-04-09 23:00:00BAKsb39
  sensor_depth_m temperature_c
1  2 29.63
2  2 29.56
3  2 29.51
4  2 29.53
5 10 29.57
6  2 29.60
7  2 29.66
8 10 29.68
9  2 29.68

# extracting all 10m depth sensors using subscripting
 Ten - x[x[sensor_depth_m]==10,]
 Ten
  site  time_localtime_utc reef_type_code sensor_type
56 2006-04-09 11:40:00 2006-04-09 21:40:00BAKsb39
86 2006-04-09 12:40:00 2006-04-09 22:40:00BAKsb39
  sensor_depth_m temperature_c
5 10 29.57
8 10 29.68


Does that help?

Rgds,
Rainer






On Friday 28 October 2011 18:04:59 Vinny Moriarty wrote:
 Thanks everyone for you help with my last question, and now I have one
 last one...
 
 
 Here is a sample of my data in .csv format
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temper
 ature_c 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63
 06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56
 06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51
 06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53
 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
 06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60
 06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 2, 29.68
 
 
 My goal was to extract all of the rows from a certain depth. Using the
 column sensor_depth_m to order my data by, I wanted all of the data
 from 10m. So this is what I wanted when I finished
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temper
 ature_c 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68
 
 
 
 
 To pull out all of the data from a 10m sensor depth I came up with the
 code:
 
 Ten-dataTable1[(dataTable1$sensor_depth_m==10),]
 
 
 But when I run it I just get an extra column tacked onto the end like
 this
 
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temper
 ature_c, sensor_depth_m
 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63,10
 06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56,10
 06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51,10
 06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53,10
 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57,10
 06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60,10
 06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66,10
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68,10
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68,10
 
 
 It seems pretty straight forward, I'm not sure what I am missing.
 
 
 Thanks
 
 V
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org 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@r-project.org 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] Add col in data.frame

2011-10-29 Thread Smart Guy
Hello Gurus,
I am still new to R. Here is my issue.
I was trying to add column to data frame that was populated by read.spss().
When I used cbind to add a new variable(column).

library(foreign)
mydf-read.spss(file=C:/myspss.sav,use.value.labels=FALSE,
to.data.frame=TRUE,use.missings=FALSE)
attr(mydf,variable.labels)
## it gives you all the labels

##Adding a new variable(col) to mydf
newcolm - list(frt=grapes)
mydf - cbind(mydf, newrow)

##Now checking to see labels again
attr(mydf,variable.labels)

## And you get NULL

Can anyone please help me to achieve this without loosing any default
attribute that was there?

Thanks and Regards
-- 
SmartG

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Add col in data.frame

2011-10-29 Thread Jim Lemon

On 10/29/2011 06:54 PM, Smart Guy wrote:

Hello Gurus,
 I am still new to R. Here is my issue.
I was trying to add column to data frame that was populated by read.spss().
When I used cbind to add a new variable(column).

library(foreign)
mydf-read.spss(file=C:/myspss.sav,use.value.labels=FALSE,
to.data.frame=TRUE,use.missings=FALSE)
attr(mydf,variable.labels)
## it gives you all the labels

##Adding a new variable(col) to mydf
newcolm- list(frt=grapes)
mydf- cbind(mydf, newrow)

##Now checking to see labels again
attr(mydf,variable.labels)

## And you get NULL

Can anyone please help me to achieve this without loosing any default
attribute that was there?


Hi SmartG,
I assume that the newcolm-newrow is just a typo in the example 
above. Assuming that you are managing to get your new column in mydf, 
you can add the new variable name like this:


oldvl-attr(mydf,variable.labels)
mydf-cbind(mydf,newrow)
attr(mydf,variable.labels)-c(oldvl,newvar)

Jim

__
R-help@r-project.org 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] Add col in data.frame

2011-10-29 Thread Smart Guy
Hi Jim,
   I am sorry for the typo. Thats 'newcolm' everywhere.
Thanks for the help.
I think this should work now. :)

Thanks and Regards
SmartG

On 29 October 2011 13:34, Jim Lemon j...@bitwrit.com.au wrote:

 On 10/29/2011 06:54 PM, Smart Guy wrote:

 Hello Gurus,
 I am still new to R. Here is my issue.
 I was trying to add column to data frame that was populated by
 read.spss().
 When I used cbind to add a new variable(column).

 library(foreign)
 mydf-read.spss(file=C:/**myspss.sav,use.value.labels=**FALSE,
 to.data.frame=TRUE,use.**missings=FALSE)
 attr(mydf,variable.labels)
 ## it gives you all the labels

 ##Adding a new variable(col) to mydf
 newcolm- list(frt=grapes)
 mydf- cbind(mydf, newrow)

 ##Now checking to see labels again
 attr(mydf,variable.labels)

 ## And you get NULL

 Can anyone please help me to achieve this without loosing any default
 attribute that was there?


 Hi SmartG,
 I assume that the newcolm-newrow is just a typo in the example above.
 Assuming that you are managing to get your new column in mydf, you can
 add the new variable name like this:

 oldvl-attr(mydf,variable.**labels)
 mydf-cbind(mydf,newrow)
 attr(mydf,variable.labels)-**c(oldvl,newvar)

 Jim




-- 
SmartG

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Sweave absolute path versus relative path

2011-10-29 Thread Duncan Murdoch

On 11-10-29 1:58 AM, Trevor Davies wrote:

Sorry, I should have really started a new thread with this because really it
is a new question only loosely related to the first Q.
Thanks for the assist.


I haven't looked at the Sweave sources, so I don't know why a relative 
path is needed, but I think you can probably use the LaTeX \input 
command (or possibly \include, but it sounds as though \input is better) 
rather than SweaveInput.  You would use SweaveInput if the file includes 
markup that needs to be processed by Sweave.  If it's just some .tex to 
include, let LaTeX do it.


Duncan Murdoch


As  suggested I switched over to sweave.  I have a lot of .tex tables that I

have already created that I was previously inserting into my tex document
(using \input).  The journal I plan on submitting to eventually wants the
final .tex file so I thought it would be a good idea to use Sweave, it makes
a tex doc with my tables generated and it should be all good.

I just spend a few hours trying to get the \SweaveInput commant to work
properly.  I finally determined that I couldn't put the file in as an
absolute path but it had to be a relative path.  I.e

\SweaveInput{/home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex}
gave the error:

R CMD Sweave hitmiss.Rnw
Error in SweaveReadFile(c(ifile, file), syntax, encoding = encoding) :
   no Sweave file with name
'.//home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex'
found
Calls:Anonymous  -  Sweave -  SweaveReadFile -  SweaveReadFile
Execution halted
make: *** [hitmiss.tex] Error 1

However, when i use:

\SweaveInput{../../../../../../../../home/tdavies/Dropbox/CollapseRecovery_Shared/trevor/afterAFS/writing/sweave/blah.tex}
It works fine.

What am I missing here?
Thanks.




[[alternative HTML version deleted]]

__
R-help@r-project.org 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@r-project.org 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] program never enters browser mode when I add browser()

2011-10-29 Thread Patrick Burns

I see two possibilities:

1) the call to 'browser' is inside an 'if'
clause that doesn't exectute.

2)  the call forgets the parentheses, so it is:

  browser

rather than

  browser()

On 28/10/2011 20:04, M. Tran wrote:

Dear All

I have a program that breaks at the following lines of code:

bigfunction =
{
...

object1 = myfunction(x)
object2 = strsplit(object1, ,)[[1]]

...
}

where myfunction is defined elsewhere outside of bigfunction.

The error I get is error in strsplit() -- object1 not found.

However, when I insert browser() into my code so that the above reads,

bigfunction =
{
...

browser()
object1 = myfunction(x)
object2 = strsplit(object1, ,)[[1]]

...
}

my entire program runs successfully, and oddly *never enters browser mode*.

Has anyone encountered a similar problem?  Any advice would be greatly
appreciated.

Thank you,
Michelle

--
View this message in context: 
http://r.789695.n4.nabble.com/program-never-enters-browser-mode-when-I-add-browser-tp3948920p3948920.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.



--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')

__
R-help@r-project.org 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] Graphics Reciprocal labeling

2011-10-29 Thread Hurr
Thank you both so very much.

--
View this message in context: 
http://r.789695.n4.nabble.com/Graphics-Reciprocal-labeling-tp3949054p3950480.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Contrasts with an interaction. How does one specify the dummy variables for the interaction

2011-10-29 Thread Mark Difford
John,

There is a good example of one way of doing this in multcomp-examples.pdf
of package multcomp. See pages 8 to 10.

Regards, Mark.

-
Mark Difford (Ph.D.)
Research Associate
Botany Department
Nelson Mandela Metropolitan University
Port Elizabeth, South Africa
--
View this message in context: 
http://r.789695.n4.nabble.com/Contrasts-with-an-interaction-How-does-one-specify-the-dummy-variables-for-the-interaction-tp3948792p3950225.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Split an array into arbirtary sizes

2011-10-29 Thread R. Michael Weylandt
The short answer is that you need to use the window() command with ts objects.

The (ever so slightly) longer answer is that no one really likes ts
objects and that's why a proliferation of contributed packages exist
to deal with their idiosyncracies. The most popular for finance are
zoo and xts and I heartily recommend you start using those for your
analysis if at all possible. If you use those, you can use simple
commands like x[1:250] to get the first 250 elements or you can subset
by time for xts which is very nice.

Michael

On Fri, Oct 28, 2011 at 6:59 PM, Bazman76 h_a_patie...@hotmail.com wrote:
 sorry!

 vols=read.csv(file=C:/Documents and Settings/Hugh/My
 Documents/PhD/QuickDirtyVols.csv
 +  , header=TRUE, sep=,)
 x-ts(vols[,2])
 x

 so I have an ts object of 500 elements.

 I want to be able to split the array into say two parts of 250?

 How can I do it?
 I want to keep the elements in the same order



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Split-an-array-into-arbirtary-sizes-tp3948938p3949426.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org 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@r-project.org 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] Correllogram of Daily Time Series

2011-10-29 Thread R. Michael Weylandt
I'm not an expert on these things, but I don't believe so. acf/pacf
doesn't require a ts object so it doesn't really need things to fit
the exact nuances of the ts class. You may have to be a little careful
in interpretation however depending on the nature of the irregular
spacing, but that's going to be problem dependent.

Eitherway, take a look at the packages I endorsed in your other thread
so you don't have deal with issues like lying to ts about your data.

Michael

On Thu, Oct 27, 2011 at 4:23 PM, Bazman76 h_a_patie...@hotmail.com wrote:
 I did it using the code below thank you.

 Will the fact I have used a ts object but the observations are not really
 equally spaced invalidate the results?

 vols=read.csv(file=C:/Documents and Settings/Hugh/My Documents/PhD/Swaption
 vols.csv
 + , header=TRUE, sep=,)
 x-ts(vols[,2])
 x

acf(x)

 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Correllogram-of-Daily-Time-Series-tp3944094p3945927.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org 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@r-project.org 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] R help with different combinations of vectors of different sizes

2011-10-29 Thread Suleyman K
Hi,

I am trying to get different combinations of a vector of different size and
find their sum. For example, if I have a vector (i,j) where i and j can be
anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0), (1,1),
(2,0), .. (5,5) and find sum of these as 0, 1, 1, 2, . , 10. I used
outer functions to get this and it worked. What if I have a vector (i,j,k)
where all i, j , and k can be anything from 0 to 5. I want to do the same
thing here. Get all the combinations and sum them up. (0,0,0) (0,0,1),
(0,1,0), (1,0,0),  (5,5,5) How can I get these combinations and find
their sums? Thank you very much in advance.

Uka

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] R help with different combinations of vectors of different sizes

2011-10-29 Thread R. Michael Weylandt
Just add another outer wrapper:

outer(1:5, outer(1:5, 1:5, +), +)

If you are going to arbitrarily long tuples, it may be worthwhile to
put this in a wrapper like so:

tupleSums - function(vec, n){
 stopifnot(all.equal(n, as.integer(n)))
 n - as.integer(n)
 if (n == 1L) return(vec)
 ans - outer(vec, vec, +)
 if (n == 2L) return(ans)
 else{
  for (i in 3:n) ans - outer(vec, ans, +)
  }
  return(ans)
}

Though this really could be made  much more efficient if you want:
e.g., for the n = 4 case, it would be better to take outer( outer(vec,
vec, +), outer(vec, vec, +), +).

Michael

On Sat, Oct 29, 2011 at 9:08 AM, Suleyman K s.ka...@gmail.com wrote:
 Hi,

 I am trying to get different combinations of a vector of different size and
 find their sum. For example, if I have a vector (i,j) where i and j can be
 anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0), (1,1),
 (2,0), .. (5,5) and find sum of these as 0, 1, 1, 2, . , 10. I used
 outer functions to get this and it worked. What if I have a vector (i,j,k)
 where all i, j , and k can be anything from 0 to 5. I want to do the same
 thing here. Get all the combinations and sum them up. (0,0,0) (0,0,1),
 (0,1,0), (1,0,0),  (5,5,5) How can I get these combinations and find
 their sums? Thank you very much in advance.

 Uka

        [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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@r-project.org 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] R help with different combinations of vectors of different sizes

2011-10-29 Thread William Dunlap
Another approach is to use expand.grid to create a
data.frame of all possible combinations of elements
of its input vectors:
   rowSums(expand.grid(0:5, 0:5, 0:5))

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf Of R. Michael
 Weylandt
 Sent: Saturday, October 29, 2011 7:46 AM
 To: Suleyman K
 Cc: r-help@r-project.org
 Subject: Re: [R] R help with different combinations of vectors of different 
 sizes
 
 Just add another outer wrapper:
 
 outer(1:5, outer(1:5, 1:5, +), +)
 
 If you are going to arbitrarily long tuples, it may be worthwhile to
 put this in a wrapper like so:
 
 tupleSums - function(vec, n){
  stopifnot(all.equal(n, as.integer(n)))
  n - as.integer(n)
  if (n == 1L) return(vec)
  ans - outer(vec, vec, +)
  if (n == 2L) return(ans)
  else{
   for (i in 3:n) ans - outer(vec, ans, +)
   }
   return(ans)
 }
 
 Though this really could be made  much more efficient if you want:
 e.g., for the n = 4 case, it would be better to take outer( outer(vec,
 vec, +), outer(vec, vec, +), +).
 
 Michael
 
 On Sat, Oct 29, 2011 at 9:08 AM, Suleyman K s.ka...@gmail.com wrote:
  Hi,
 
  I am trying to get different combinations of a vector of different size and
  find their sum. For example, if I have a vector (i,j) where i and j can be
  anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0), (1,1),
  (2,0), .. (5,5) and find sum of these as 0, 1, 1, 2, . , 10. I used
  outer functions to get this and it worked. What if I have a vector (i,j,k)
  where all i, j , and k can be anything from 0 to 5. I want to do the same
  thing here. Get all the combinations and sum them up. (0,0,0) (0,0,1),
  (0,1,0), (1,0,0),  (5,5,5) How can I get these combinations and find
  their sums? Thank you very much in advance.
 
  Uka
 
         [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org 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@r-project.org 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@r-project.org 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] R help with different combinations of vectors of different sizes

2011-10-29 Thread David Winsemius


On Oct 29, 2011, at 9:08 AM, Suleyman K wrote:


Hi,

I am trying to get different combinations of a vector of different  
size and
find their sum. For example, if I have a vector (i,j) where i and j  
can be
anything from 0 to 5, i get these combinations (0,0), (0,1), (1,0),  
(1,1),
(2,0), .. (5,5) and find sum of these as 0, 1, 1, 2, . , 10.  
I used
outer functions to get this and it worked. What if I have a vector  
(i,j,k)
where all i, j , and k can be anything from 0 to 5. I want to do the  
same

thing here. Get all the combinations and sum them up. (0,0,0) (0,0,1),
(0,1,0), (1,0,0),  (5,5,5) How can I get these combinations and  
find

their sums? Thank you very much in advance.


You did say combinations rather than permutations, so:

 colSums(combn(0:5, 3))
 [1]  3  4  5  6  5  6  7  7  8  9  6  7  8  8  9 10  9 10 11 12

If you instead meant permutations, then consider this:

 rowSums(expand.grid(0:5,0:5, 0:5))
  [1]  0  1  2  3  4  5  1  2  3  4  5  6  2  3  4  5  6  7  3  4  5   
6  7  8  4  5  6  7  8  9  5  6  7
 [34]  8  9 10  1  2  3  4  5  6  2  3  4  5  6  7  3  4  5  6  7  8   
4  5  6  7  8  9  5  6  7  8  9 10
 [67]  6  7  8  9 10 11  2  3  4  5  6  7  3  4  5  6  7  8  4  5  6   
7  8  9  5  6  7  8  9 10  6  7  8
[100]  9 10 11  7  8  9 10 11 12  3  4  5  6  7  8  4  5  6  7  8  9   
5  6  7  8  9 10  6  7  8  9 10 11
[133]  7  8  9 10 11 12  8  9 10 11 12 13  4  5  6  7  8  9  5  6  7   
8  9 10  6  7  8  9 10 11  7  8  9
[166] 10 11 12  8  9 10 11 12 13  9 10 11 12 13 14  5  6  7  8  9 10   
6  7  8  9 10 11  7  8  9 10 11 12

[199]  8  9 10 11 12 13  9 10 11 12 13 14 10 11 12 13 14 15

 table(rowSums(expand.grid(0:5,0:5, 0:5)))

 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 1  3  6 10 15 21 25 27 27 25 21 15 10  6  3  1

A056150 Number of combinations for each possible sum when throwing 3  
(normal) dice.

http://oeis.org/A056150




Uka

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org 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] Email out of R (code)

2011-10-29 Thread Uwe Ligges

R has packages for almost everything, so there is sendmailR 

Uwe Ligges


On 28.10.2011 20:04, MacQueen, Don wrote:

The various suggestions seem kind of complex to me, at least on a
unix-like system (including Mac OS X).
This is what I do:

   sink('tmp.txt')
   cat('This is the body of the message\n')
   sink()
   system('cat tmp.txt | mail -s A test email macque...@llnl.gov')

One could probably avoid the temporary external text file using
connections, but I haven't had that need.


For attachments, the following approach works on at least some systems
(RHEL for one):

   pdf('temp.pdf')
   ## create a plot
   dev.off()

   sink('tmp.txt')
   ## print() and cat() commands
   sink()

   cmd- '/bin/mailx -s Subject line text
  -a temp.pdf -S replyto=macque...@llnl.gov
   recipi...@some.host  tmp.txt'
   system(cmd)


It's not hard, of course, to wrap such a thing up in a function with
arguments for various elements such as the subject, the file names, the
email address(es), and then construct the cmd using paste().




__
R-help@r-project.org 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] R help with different combinations of vectors of different sizes

2011-10-29 Thread uka
Thank you very much both! That's exactly what I was trying to get. 

--
View this message in context: 
http://r.789695.n4.nabble.com/R-help-with-different-combinations-of-vectors-of-different-sizes-tp3950940p3950997.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Luis Miguel Delgado Gomez/BBK está ausente de la oficina.

2011-10-29 Thread Luis Miguel Delgado Gomez

__
R-help@r-project.org 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] lme4 + R 2.11.0 + mac unavailable

2011-10-29 Thread ADosmann
I had a similar problem installing lme4 on my mac in R 2.12.1.  The
information on this thread helped me troubleshoot the problem, but I arrived
at a different solution.

When I tried to load lme4 from the source as advised by one author, it
failed and I got an error message regarding the package 'Matrix' (see below
if you're interested).  Before diving in on some of the other suggestions to
deal with the Matrix issue, I simply got the 'Matrix' package I already had
installed going, and then installed lme4 successfully.

library(Matrix)
install.packages(lme4)

That did the trick.

Andy

* installing *source* package ‘Matrix’ ...
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ‘Matrix’
* removing ‘/Users/darwin/Library/R/2.12/library/Matrix’
* installing *source* package ‘lme4’ ...
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ‘lme4’
* removing ‘/Users/darwin/Library/R/2.12/library/lme4’

The downloaded packages are in

‘/private/var/folders/Ts/TsMLZGaEF3W3JOTfdmIGDTU/-Tmp-/RtmpAXhRpJ/downloaded_packages’
Warning messages:
1: In install.packages(lme4, type = source) :
  installation of package 'Matrix' had non-zero exit status
2: In install.packages(lme4, type = source) :
  installation of package 'lme4' had non-zero exit status

--
View this message in context: 
http://r.789695.n4.nabble.com/lme4-R-2-11-0-mac-unavailable-tp2220331p3951179.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] installing FastRWeb

2011-10-29 Thread financial engineer

hi,

I am working on Ubuntu and tried to install FastRWeb, but am getting the 
following error for installation of cairo.h. 

 install.packages(FastRWeb,dep=TRUE)
Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
also installing the dependency ‘Cairo’

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
Content type 'application/x-gzip' length 71072 bytes (69 Kb)
opened URL
==
downloaded 69 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... no
configure: CAIRO_LIBS is unset, attempting to guess it.
configure: CAIRO_CFLAGS=
checking if R was compiled with the RConn patch... no
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
configure: error: Cannot find cairo.h! Please install cairo 
(http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/Cairo’
ERROR: dependency ‘Cairo’ is not available for package ‘FastRWeb’
* removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/FastRWeb’

The downloaded packages are in
‘/tmp/Rtmpla4fs8/downloaded_packages’
Warning messages:
1: In install.packages(FastRWeb, dep = TRUE) :
  installation of package 'Cairo' had non-zero exit status
2: In install.packages(FastRWeb, dep = TRUE) :
  installation of package 'FastRWeb' had non-zero exit status

so, I tried to install Cairo, but I get the following error:

install.packages(Cairo)
Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... no
configure: CAIRO_LIBS is unset, attempting to guess it.
configure: CAIRO_CFLAGS=
checking if R was compiled with the RConn patch... no
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
configure: error: Cannot find cairo.h! Please install cairo 
(http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly.
ERROR: 

Re: [R] How to plot survival data from multiple trials (simulations)?

2011-10-29 Thread Lancaster, Robert (Orbitz)
I'm assuming you want to plot the Kaplan-Meier curves.  First, load your data 
into a data.frame, e.g. surv_data
It looks like ST is your survival time and ind is your event indicator.

The following code should get you started:  

# create your survival object:
mySurv = Surv(surv_data$ST,surv_data$ind)

# use survfit, which will generate KM curves:
survFit = survfit(mySurv~surv_data$GROUP)

# plot your curves.
plot(survFit,conf.int=TRUE,xlab=time,ylab=survival pct)

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Zheng Lu
Sent: Friday, October 28, 2011 10:30 PM
To: r-help@r-project.org
Subject: [R] How to plot survival data from multiple trials (simulations)?



 Dear all:
 
Could anyone please provide some R codes to plot the below survival data to 
compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction 
interval on the plot from these 2 trials.  I would like to simulate 1000 trials 
later. Thanks a lot for your great help and consideration!
yan
 
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
1 1 1 1 2.2636717 0.255634126 1 1 99.4 F
3 1 2 1 24.7719223 0.756458142 0 1 8.1 T
5 1 3 0 4.7685832 0.908777937 1 0 2.6 T
7 1 4 0 2.5934492 -0.231564522 1 1 7.4 T
9 1 5 0 4.7309141 -2.455991696 0 1 0.4 T
11 1 6 1 3.5904766 -0.459694803 1 1 13.1 T
13 1 7 1 4.8592495 0.983131140 1 1 17.8 T
15 1 8 1 3.1308760 -1.136462783 0 0 10.6 T
17 1 9 1 5.8127637 -0.131647588 0 1 1.2 T
19 1 10 0 4.0875668 -3.567509428 0 1 0.4 T
21 1 11 1 14.7112528 0.900416367 1 1 15.2 T
23 1 12 0 6.7290298 -0.140283251 0 0 8.5 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
25 1 13 0 6.6118789 -0.095603854 0 1 13.8 T
27 1 14 1 1.1191479 0.735691765 1 1 60.5 F
29 1 15 0 11.9169275 0.796172293 0 0 40.1 F
31 1 16 1 6.7940011 0.845746271 1 1 68.1 F
33 1 17 0 4.7380330 0.582527179 1 1 11.7 T
35 1 18 0 12.0571049 0.165637187 0 0 25.0 T
37 1 19 1 3.1922217 0.891862148 1 1 34.0 T
39 1 20 0 10.6253830 -0.747701704 0 1 7.8 T
41 1 21 0 2.0178336 -2.732716143 0 1 0.8 T
43 1 22 1 13.8066137 0.706372607 0 1 58.2 F
45 1 23 1 11.8844261 0.842735359 1 1 13.9 T
47 1 24 1 3.9546421 0.193353044 0 1 2.7 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
49 1 25 0 27.0913396 0.970400135 1 1 19.1 T
51 1 26 1 12.0249672 0.886403017 1 1 27.1 T
53 1 27 1 5.9453281 0.964694968 1 1 21.2 T
55 1 28 0 6.8084911 -1.333850454 1 0 4.1 T
57 1 29 1 8.3642227 -0.024960757 0 1 4.4 T
59 1 30 0 26.6382483 0.714020234 0 0 3.9 T
61 1 31 1 13.1107410 0.372041597 0 1 26.2 T
63 1 32 0 4.2271255 0.056569282 1 1 14.3 T
65 1 33 0 17.7269456 0.252550311 0 0 11.2 T
67 1 34 1 3.6215522 -0.282323084 0 0 0.3 T
69 1 35 1 19.3787770 0.349288143 0 1 5.2 T
71 1 36 0 8.9546567 0.945492048 1 1 15.2 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
73 1 37 0 2.7796959 -3.119155682 0 0 12.3 T
75 1 38 0 9.4029912 -0.793046460 0 1 1.2 T
77 1 39 1 7.8146429 0.888593758 1 1 8.0 T
79 1 40 0 9.6419102 0.525301532 1 1 22.4 T
81 1 41 1 3.3174969 0.915870306 1 1 24.7 T
83 1 42 1 12.4030358 0.661856980 1 1 16.4 T
85 1 43 1 24.2982862 0.710967270 0 1 5.5 T
87 1 44 0 10.4332028 0.940833126 1 0 2.9 T
89 1 45 0 4.7520799 0.897518558 1 1 32.6 T
91 1 46 0 2.7028663 -3.484128492 0 1 0.2 T
93 1 47 1 2.7572158 0.890976979 1 0 30.9 T
95 1 48 0 7.2240161 -0.377073350 0 0 3.7 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
97 1 49 0 20.6156368 0.500864314 0 1 12.2 T
99 1 50 1 12.8547093 0.982784519 1 1 54.4 F
2 2 1 1 3.0862631 0.931988949 1 1 199.2 F
4 2 2 1 18.6633707 0.540651036 0 1 8.1 T
6 2 3 0 5.5728260 -1.851336117 1 0 3.0 T
8 2 4 0 4.0740408 0.021119280 1 1 10.1 T
10 2 5 0 14.2396242 0.465013972 0 1 6.6 T
12 2 6 1 37.5234448 0.986992132 1 1 30.5 T
14 2 7 1 11.2925748 0.922905093 1 1 14.0 T
16 2 8 1 15.2298842 0.459418082 0 0 12.6 T
18 2 9 1 5.3266590 -1.487487920 0 1 0.3 T
20 2 10 0 11.7956270 0.606294774 0 1 26.9 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
22 2 11 1 26.0051377 0.823996317 1 1 8.6 T
24 2 12 0 4.7851855 -1.635216564 0 0 10.7 T
26 2 13 0 5.4896572 -1.085740446 0 1 3.8 T
28 2 14 1 15.0284557 0.981428564 1 1 56.1 F
30 2 15 0 15.3001584 -0.101949376 0 0 36.7 T
32 2 16 1 4.1838899 -0.002416447 1 1 26.0 T
34 2 17 0 1.9213881 0.678721863 1 1 15.5 T
36 2 18 0 22.0870166 0.682030393 0 0 18.8 T
38 2 19 1 7.8815644 0.938210236 1 1 25.9 T
40 2 20 0 6.8308086 -0.774314088 0 1 8.5 T
42 2 21 0 6.0056206 -0.656448295 0 1 5.4 T
44 2 22 1 11.9301049 0.137476151 0 1 32.2 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
46 2 23 1 4.4453597 0.932378925 1 1 18.3 T
48 2 24 1 7.0352655 0.142463064 0 1 2.4 T
50 2 25 0 22.1603315 0.990013687 1 1 23.5 T
52 2 26 1 1.7582992 0.041687569 1 1 13.6 T
54 2 27 1 4.0864310 0.893550143 1 1 18.7 T
56 2 28 0 3.7564158 0.149721394 1 0 3.1 T
58 2 29 1 23.7880592 0.312680371 0 1 4.0 T
60 2 30 0 7.3082204 0.084729300 0 0 3.4 T
62 2 31 1 29.8669157 0.779756301 0 1 24.3 T
64 2 32 0 6.7967624 0.228897567 1 1 15.8 T
66 2 33 0 9.0048160 -1.073334969 0 0 9.5 T
68 2 34 1 9.3920052 0.183028557 0 0 0.3 T
TRL ID ECOG BASE PTR8 GROUP POP ST ind 
70 2 35 1 

Re: [R] lme4 + R 2.11.0 + mac unavailable

2011-10-29 Thread Uwe Ligges



On 29.10.2011 18:33, ADosmann wrote:

I had a similar problem installing lme4 on my mac in R 2.12.1.  The
information on this thread helped me troubleshoot the problem, but I arrived
at a different solution.

When I tried to load lme4 from the source as advised by one author, it
failed and I got an error message regarding the package 'Matrix' (see below
if you're interested).  Before diving in on some of the other suggestions to
deal with the Matrix issue, I simply got the 'Matrix' package I already had
installed going, and then installed lme4 successfully.


library(Matrix)
install.packages(lme4)


That did the trick.



Yes, but given the output below, it looks like make is not available.

Uwe Ligges



Andy

* installing *source* package ‘Matrix’ ...
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ‘Matrix’
* removing ‘/Users/darwin/Library/R/2.12/library/Matrix’
* installing *source* package ‘lme4’ ...
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ‘lme4’
* removing ‘/Users/darwin/Library/R/2.12/library/lme4’

The downloaded packages are in

‘/private/var/folders/Ts/TsMLZGaEF3W3JOTfdmIGDTU/-Tmp-/RtmpAXhRpJ/downloaded_packages’
Warning messages:
1: In install.packages(lme4, type = source) :
   installation of package 'Matrix' had non-zero exit status
2: In install.packages(lme4, type = source) :
   installation of package 'lme4' had non-zero exit status

--
View this message in context: 
http://r.789695.n4.nabble.com/lme4-R-2-11-0-mac-unavailable-tp2220331p3951179.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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@r-project.org 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] installing FastRWeb

2011-10-29 Thread Uwe Ligges

Please do read the output, it tells you:

Please install cairo (http://www.cairographics.org/) and/or set 
CAIRO_CFLAGS/LIBS correspondingly.


And that is exactly what you need to do, it cannot be solved by 
installing R packages


Best,
Uwe Ligges


On 29.10.2011 18:24, financial engineer wrote:


hi,

I am working on Ubuntu and tried to install FastRWeb, but am getting the 
following error for installation of cairo.h.

  install.packages(FastRWeb,dep=TRUE)
Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
also installing the dependency ‘Cairo’

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
Content type 'application/x-gzip' length 71072 bytes (69 Kb)
opened URL
==
downloaded 69 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... no
configure: CAIRO_LIBS is unset, attempting to guess it.
configure: CAIRO_CFLAGS=
checking if R was compiled with the RConn patch... no
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
configure: error: Cannot find cairo.h! Please install cairo 
(http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/Cairo’
ERROR: dependency ‘Cairo’ is not available for package ‘FastRWeb’
* removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/FastRWeb’

The downloaded packages are in
 ‘/tmp/Rtmpla4fs8/downloaded_packages’
Warning messages:
1: In install.packages(FastRWeb, dep = TRUE) :
   installation of package 'Cairo' had non-zero exit status
2: In install.packages(FastRWeb, dep = TRUE) :
   installation of package 'FastRWeb' had non-zero exit status

so, I tried to install Cairo, but I get the following error:

install.packages(Cairo)
Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... no
configure: CAIRO_LIBS is unset, attempting to guess it.
configure: 

Re: [R] Graphics Reciprocal labeling

2011-10-29 Thread Hurr
I need just a little more education.
I still haven't got back into attempting R programs,
but I have appreciated your information.
The linear-in-frequency horizontal-axis scale is
natural for frequency analysis, and so labeling in
period is applicable. Also applicable for better view 
is an exponential scale like factA*pow(2,-freq*factB)
or related negative exponential properly scaled. 
Can I do similar period labeling for this situation also?
Can I even get the exponential scale? I thought of this 
scale when I thought of the 5,2,1 US money system.


--
View this message in context: 
http://r.789695.n4.nabble.com/Graphics-Reciprocal-labeling-tp3949054p3951313.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] installing FastRWeb

2011-10-29 Thread Uwe Ligges
A missing X11/Intrinsic.h: suggests you also have to install some X11 
header files that are still missing ...


Uwe Ligges




On 29.10.2011 19:44, financial engineer wrote:






hi Uwe,

thanks for your response.

I ran the following as per the instructions on the Cairo website:


sudo apt-get install libcairo2-dev

following which I tried to install FastRWeb again (hopefully I have not missed 
any steps in between)can you pls. tell me how I can fix this error..



install.packages(FastRWeb,dep=TRUE)

Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
also installing the dependency ‘Cairo’

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
Content type 'application/x-gzip' length 71072 bytes (69 Kb)
opened URL
==
downloaded 69 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png 
cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/usr/lib/i386-linux-gnu -lfreetype -lpng12 -lz 
-lXrender -lcairo -lX11
checking for library containing deflate... none required
checking whether Cairo programs can be compiled... yes
checking whether cairo_image_surface_get_format is declared... no
checking for FreeType support in cairo... yes
checking whether FreeType needs additional flags... no
checking wheter libjpeg works... yes
checking wheter libtiff works... no
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/cconfig.h
** libs
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairobem.c -o cairobem.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairogd.c -o cairogd.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairotalk.c -o cairotalk.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
img-backend.c -o img-backend.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 

Re: [R] installing FastRWeb

2011-10-29 Thread Uwe Ligges



On 29.10.2011 19:48, financial engineer wrote:


I understand... can you please tell me where I can locate those to be able to 
install them. I am not familiar with X11.


Depends on the OS, if this is Ubuntu, probably in libxt-dev

So go ahead with

apt-get install libxt-dev

and please do not bother the list with basic sysadmin questions anymore, 
but ask for local advice on how to set up your system.



Best,
Uwe Ligges





Date: Sat, 29 Oct 2011 19:46:16 +0200
From: lig...@statistik.tu-dortmund.de
To: fin_e...@hotmail.com
CC: r-help@r-project.org
Subject: Re: [R] installing FastRWeb

A missing X11/Intrinsic.h: suggests you also have to install some X11
header files that are still missing ...

Uwe Ligges




On 29.10.2011 19:44, financial engineer wrote:






hi Uwe,

thanks for your response.

I ran the following as per the instructions on the Cairo website:


sudo apt-get install libcairo2-dev

following which I tried to install FastRWeb again (hopefully I have not missed 
any steps in between)can you pls. tell me how I can fix this error..



install.packages(FastRWeb,dep=TRUE)

Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
also installing the dependency ‘Cairo’

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
Content type 'application/x-gzip' length 71072 bytes (69 Kb)
opened URL
==
downloaded 69 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png 
cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/usr/lib/i386-linux-gnu -lfreetype -lpng12 -lz 
-lXrender -lcairo -lX11
checking for library containing deflate... none required
checking whether Cairo programs can be compiled... yes
checking whether cairo_image_surface_get_format is declared... no
checking for FreeType support in cairo... yes
checking whether FreeType needs additional flags... no
checking wheter libjpeg works... yes
checking wheter libtiff works... no
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/cconfig.h
** libs
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairobem.c -o cairobem.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairogd.c -o cairogd.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairotalk.c -o cairotalk.o
gcc 

Re: [R] installing FastRWeb

2011-10-29 Thread financial engineer





hi Uwe,

thanks for your response.

I ran the following as per the instructions on the Cairo website:


sudo apt-get install libcairo2-dev

following which I tried to install FastRWeb again (hopefully I have not missed 
any steps in between)can you pls. tell me how I can fix this error..


 install.packages(FastRWeb,dep=TRUE)
Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
also installing the dependency ‘Cairo’

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
Content type 'application/x-gzip' length 81214 bytes (79 Kb)
opened URL
==
downloaded 79 Kb

trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
Content type 'application/x-gzip' length 71072 bytes (69 Kb)
opened URL
==
downloaded 69 Kb

* installing *source* package ‘Cairo’ ...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png 
cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1  
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/usr/lib/i386-linux-gnu -lfreetype -lpng12 -lz 
-lXrender -lcairo -lX11  
checking for library containing deflate... none required
checking whether Cairo programs can be compiled... yes
checking whether cairo_image_surface_get_format is declared... no
checking for FreeType support in cairo... yes
checking whether FreeType needs additional flags... no
checking wheter libjpeg works... yes
checking wheter libtiff works... no
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/cconfig.h
** libs
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairobem.c -o cairobem.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairogd.c -o cairogd.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
cairotalk.c -o cairotalk.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
img-backend.c -o img-backend.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
-Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
img-jpeg.c -o img-jpeg.o
gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
-I/usr/include/libpng12 

Re: [R] installing FastRWeb

2011-10-29 Thread financial engineer

I understand... can you please tell me where I can locate those to be able to 
install them. I am not familiar with X11.

 Date: Sat, 29 Oct 2011 19:46:16 +0200
 From: lig...@statistik.tu-dortmund.de
 To: fin_e...@hotmail.com
 CC: r-help@r-project.org
 Subject: Re: [R] installing FastRWeb
 
 A missing X11/Intrinsic.h: suggests you also have to install some X11 
 header files that are still missing ...
 
 Uwe Ligges
 
 
 
 
 On 29.10.2011 19:44, financial engineer wrote:
 
 
 
 
 
  hi Uwe,
 
  thanks for your response.
 
  I ran the following as per the instructions on the Cairo website:
 
 
  sudo apt-get install libcairo2-dev
 
  following which I tried to install FastRWeb again (hopefully I have not 
  missed any steps in between)can you pls. tell me how I can fix this 
  error..
 
 
  install.packages(FastRWeb,dep=TRUE)
  Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
  (as ‘lib’ is unspecified)
  also installing the dependency ‘Cairo’
 
  trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
  Content type 'application/x-gzip' length 81214 bytes (79 Kb)
  opened URL
  ==
  downloaded 79 Kb
 
  trying URL 
  'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
  Content type 'application/x-gzip' length 71072 bytes (69 Kb)
  opened URL
  ==
  downloaded 69 Kb
 
  * installing *source* package ‘Cairo’ ...
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking how to run the C preprocessor... gcc -E
  checking for grep that handles long lines and -e... /bin/grep
  checking for egrep... /bin/grep -E
  checking for ANSI C header files... yes
  checking for sys/wait.h that is POSIX.1 compatible... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking for string.h... (cached) yes
  checking sys/time.h usability... yes
  checking sys/time.h presence... yes
  checking for sys/time.h... yes
  checking for unistd.h... (cached) yes
  checking for an ANSI C-conforming const... yes
  checking for pkg-config... /usr/bin/pkg-config
  checking whether pkg-config knows about cairo... yes
  checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png 
  cairo-ps cairo-xlib cairo-xlib-xrender
  configure: CAIRO_CFLAGS=-pthread -I/usr/include/glib-2.0 
  -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
  -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1
  checking if R was compiled with the RConn patch... no
  checking cairo.h usability... yes
  checking cairo.h presence... yes
  checking for cairo.h... yes
  checking for PNG support in Cairo... yes
  checking for ATS font support in Cairo... no
  configure: CAIRO_LIBS=-L/usr/lib/i386-linux-gnu -lfreetype -lpng12 -lz 
  -lXrender -lcairo -lX11
  checking for library containing deflate... none required
  checking whether Cairo programs can be compiled... yes
  checking whether cairo_image_surface_get_format is declared... no
  checking for FreeType support in cairo... yes
  checking whether FreeType needs additional flags... no
  checking wheter libjpeg works... yes
  checking wheter libtiff works... no
  configure: creating ./config.status
  config.status: creating src/Makevars
  config.status: creating src/cconfig.h
  ** libs
  gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
  -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
  -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
  -Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
  cairobem.c -o cairobem.o
  gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
  -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
  -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
  -Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
  cairogd.c -o cairogd.o
  gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
  -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 
  -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/pixman-1-I. 
  -Iinclude-std=gnu99 -O3 -pipe -g -fpic  -std=gnu99 -O3 -pipe  -g -c 
  cairotalk.c -o cairotalk.o
  gcc -I/usr/share/R/include -pthread -I/usr/include/glib-2.0 
  

Re: [R] installing FastRWeb

2011-10-29 Thread Ranjan Maitra
Hi,

I don't know what FastRWeb does, but it appears to me that you need the
developmental files for Cairo installed. I don't use ubuntu, but
perhaps installing cairo-dev might help?

HTH,
Ranjan

On Sat, 29 Oct 2011 11:24:04 -0500 financial engineer
fin_e...@hotmail.com wrote:

 
 hi,
 
 I am working on Ubuntu and tried to install FastRWeb, but am getting the 
 following error for installation of cairo.h. 
 
  install.packages(FastRWeb,dep=TRUE)
 Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
 (as ‘lib’ is unspecified)
 also installing the dependency ‘Cairo’
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
 Content type 'application/x-gzip' length 81214 bytes (79 Kb)
 opened URL
 ==
 downloaded 79 Kb
 
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/FastRWeb_1.0-0.tar.gz'
 Content type 'application/x-gzip' length 71072 bytes (69 Kb)
 opened URL
 ==
 downloaded 69 Kb
 
 * installing *source* package ‘Cairo’ ...
 checking for gcc... gcc
 checking whether the C compiler works... yes
 checking for C compiler default output file name... a.out
 checking for suffix of executables... 
 checking whether we are cross compiling... no
 checking for suffix of object files... o
 checking whether we are using the GNU C compiler... yes
 checking whether gcc accepts -g... yes
 checking for gcc option to accept ISO C89... none needed
 checking how to run the C preprocessor... gcc -E
 checking for grep that handles long lines and -e... /bin/grep
 checking for egrep... /bin/grep -E
 checking for ANSI C header files... yes
 checking for sys/wait.h that is POSIX.1 compatible... yes
 checking for sys/types.h... yes
 checking for sys/stat.h... yes
 checking for stdlib.h... yes
 checking for string.h... yes
 checking for memory.h... yes
 checking for strings.h... yes
 checking for inttypes.h... yes
 checking for stdint.h... yes
 checking for unistd.h... yes
 checking for string.h... (cached) yes
 checking sys/time.h usability... yes
 checking sys/time.h presence... yes
 checking for sys/time.h... yes
 checking for unistd.h... (cached) yes
 checking for an ANSI C-conforming const... yes
 checking for pkg-config... /usr/bin/pkg-config
 checking whether pkg-config knows about cairo... no
 configure: CAIRO_LIBS is unset, attempting to guess it.
 configure: CAIRO_CFLAGS=
 checking if R was compiled with the RConn patch... no
 checking cairo.h usability... no
 checking cairo.h presence... no
 checking for cairo.h... no
 configure: error: Cannot find cairo.h! Please install cairo 
 (http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly.
 ERROR: configuration failed for package ‘Cairo’
 * removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/Cairo’
 ERROR: dependency ‘Cairo’ is not available for package ‘FastRWeb’
 * removing ‘/home/ba/R/i686-pc-linux-gnu-library/2.12/FastRWeb’
 
 The downloaded packages are in
 ‘/tmp/Rtmpla4fs8/downloaded_packages’
 Warning messages:
 1: In install.packages(FastRWeb, dep = TRUE) :
   installation of package 'Cairo' had non-zero exit status
 2: In install.packages(FastRWeb, dep = TRUE) :
   installation of package 'FastRWeb' had non-zero exit status
 
 so, I tried to install Cairo, but I get the following error:
 
 install.packages(Cairo)
 Installing package(s) into ‘/home/ba/R/i686-pc-linux-gnu-library/2.12’
 (as ‘lib’ is unspecified)
 trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/Cairo_1.5-0.tar.gz'
 Content type 'application/x-gzip' length 81214 bytes (79 Kb)
 opened URL
 ==
 downloaded 79 Kb
 
 * installing *source* package ‘Cairo’ ...
 checking for gcc... gcc
 checking whether the C compiler works... yes
 checking for C compiler default output file name... a.out
 checking for suffix of executables... 
 checking whether we are cross compiling... no
 checking for suffix of object files... o
 checking whether we are using the GNU C compiler... yes
 checking whether gcc accepts -g... yes
 checking for gcc option to accept ISO C89... none needed
 checking how to run the C preprocessor... gcc -E
 checking for grep that handles long lines and -e... /bin/grep
 checking for egrep... /bin/grep -E
 checking for ANSI C header files... yes
 checking for sys/wait.h that is POSIX.1 compatible... yes
 checking for sys/types.h... yes
 checking for sys/stat.h... yes
 checking for stdlib.h... yes
 checking for string.h... yes
 checking for memory.h... yes
 checking for strings.h... yes
 checking for inttypes.h... yes
 checking for stdint.h... yes
 checking for unistd.h... yes
 checking for string.h... (cached) yes
 checking sys/time.h usability... yes
 checking sys/time.h presence... yes
 checking for sys/time.h... yes
 checking for unistd.h... (cached) yes
 checking for an ANSI C-conforming const... yes
 checking for pkg-config... /usr/bin/pkg-config
 checking whether pkg-config 

Re: [R] How to plot survival data from multiple trials (simulations)?

2011-10-29 Thread Zheng Lu

Thank you very much for your consideration and response. you are right and the 
codes you provided was the one I am using now. But my question is if I simulate 
1000 trials (due to limited space, I only provide the results here from 2 
trials), TRL is from 1 to 1000 in the dataset, how can I creat KM curve with 
95% prediction interval instead of confidence interval. Thanks again.
 

 From: robert.lancas...@orbitz.com
 To: luy...@hotmail.com; r-help@r-project.org
 Date: Sat, 29 Oct 2011 11:49:25 -0500
 Subject: RE: [R] How to plot survival data from multiple trials (simulations)?
 
 I'm assuming you want to plot the Kaplan-Meier curves. First, load your data 
 into a data.frame, e.g. surv_data
 It looks like ST is your survival time and ind is your event indicator.
 
 The following code should get you started: 
 
 # create your survival object:
 mySurv = Surv(surv_data$ST,surv_data$ind)
 
 # use survfit, which will generate KM curves:
 survFit = survfit(mySurv~surv_data$GROUP)
 
 # plot your curves.
 plot(survFit,conf.int=TRUE,xlab=time,ylab=survival pct)
 
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf Of Zheng Lu
 Sent: Friday, October 28, 2011 10:30 PM
 To: r-help@r-project.org
 Subject: [R] How to plot survival data from multiple trials (simulations)?
 
 
 
 Dear all:
 
 Could anyone please provide some R codes to plot the below survival data to 
 compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction 
 interval on the plot from these 2 trials. I would like to simulate 1000 
 trials later. Thanks a lot for your great help and consideration!
 yan
 
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 1 1 1 1 2.2636717 0.255634126 1 1 99.4 F
 3 1 2 1 24.7719223 0.756458142 0 1 8.1 T
 5 1 3 0 4.7685832 0.908777937 1 0 2.6 T
 7 1 4 0 2.5934492 -0.231564522 1 1 7.4 T
 9 1 5 0 4.7309141 -2.455991696 0 1 0.4 T
 11 1 6 1 3.5904766 -0.459694803 1 1 13.1 T
 13 1 7 1 4.8592495 0.983131140 1 1 17.8 T
 15 1 8 1 3.1308760 -1.136462783 0 0 10.6 T
 17 1 9 1 5.8127637 -0.131647588 0 1 1.2 T
 19 1 10 0 4.0875668 -3.567509428 0 1 0.4 T
 21 1 11 1 14.7112528 0.900416367 1 1 15.2 T
 23 1 12 0 6.7290298 -0.140283251 0 0 8.5 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 25 1 13 0 6.6118789 -0.095603854 0 1 13.8 T
 27 1 14 1 1.1191479 0.735691765 1 1 60.5 F
 29 1 15 0 11.9169275 0.796172293 0 0 40.1 F
 31 1 16 1 6.7940011 0.845746271 1 1 68.1 F
 33 1 17 0 4.7380330 0.582527179 1 1 11.7 T
 35 1 18 0 12.0571049 0.165637187 0 0 25.0 T
 37 1 19 1 3.1922217 0.891862148 1 1 34.0 T
 39 1 20 0 10.6253830 -0.747701704 0 1 7.8 T
 41 1 21 0 2.0178336 -2.732716143 0 1 0.8 T
 43 1 22 1 13.8066137 0.706372607 0 1 58.2 F
 45 1 23 1 11.8844261 0.842735359 1 1 13.9 T
 47 1 24 1 3.9546421 0.193353044 0 1 2.7 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 49 1 25 0 27.0913396 0.970400135 1 1 19.1 T
 51 1 26 1 12.0249672 0.886403017 1 1 27.1 T
 53 1 27 1 5.9453281 0.964694968 1 1 21.2 T
 55 1 28 0 6.8084911 -1.333850454 1 0 4.1 T
 57 1 29 1 8.3642227 -0.024960757 0 1 4.4 T
 59 1 30 0 26.6382483 0.714020234 0 0 3.9 T
 61 1 31 1 13.1107410 0.372041597 0 1 26.2 T
 63 1 32 0 4.2271255 0.056569282 1 1 14.3 T
 65 1 33 0 17.7269456 0.252550311 0 0 11.2 T
 67 1 34 1 3.6215522 -0.282323084 0 0 0.3 T
 69 1 35 1 19.3787770 0.349288143 0 1 5.2 T
 71 1 36 0 8.9546567 0.945492048 1 1 15.2 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 73 1 37 0 2.7796959 -3.119155682 0 0 12.3 T
 75 1 38 0 9.4029912 -0.793046460 0 1 1.2 T
 77 1 39 1 7.8146429 0.888593758 1 1 8.0 T
 79 1 40 0 9.6419102 0.525301532 1 1 22.4 T
 81 1 41 1 3.3174969 0.915870306 1 1 24.7 T
 83 1 42 1 12.4030358 0.661856980 1 1 16.4 T
 85 1 43 1 24.2982862 0.710967270 0 1 5.5 T
 87 1 44 0 10.4332028 0.940833126 1 0 2.9 T
 89 1 45 0 4.7520799 0.897518558 1 1 32.6 T
 91 1 46 0 2.7028663 -3.484128492 0 1 0.2 T
 93 1 47 1 2.7572158 0.890976979 1 0 30.9 T
 95 1 48 0 7.2240161 -0.377073350 0 0 3.7 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 97 1 49 0 20.6156368 0.500864314 0 1 12.2 T
 99 1 50 1 12.8547093 0.982784519 1 1 54.4 F
 2 2 1 1 3.0862631 0.931988949 1 1 199.2 F
 4 2 2 1 18.6633707 0.540651036 0 1 8.1 T
 6 2 3 0 5.5728260 -1.851336117 1 0 3.0 T
 8 2 4 0 4.0740408 0.021119280 1 1 10.1 T
 10 2 5 0 14.2396242 0.465013972 0 1 6.6 T
 12 2 6 1 37.5234448 0.986992132 1 1 30.5 T
 14 2 7 1 11.2925748 0.922905093 1 1 14.0 T
 16 2 8 1 15.2298842 0.459418082 0 0 12.6 T
 18 2 9 1 5.3266590 -1.487487920 0 1 0.3 T
 20 2 10 0 11.7956270 0.606294774 0 1 26.9 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind 
 22 2 11 1 26.0051377 0.823996317 1 1 8.6 T
 24 2 12 0 4.7851855 -1.635216564 0 0 10.7 T
 26 2 13 0 5.4896572 -1.085740446 0 1 3.8 T
 28 2 14 1 15.0284557 0.981428564 1 1 56.1 F
 30 2 15 0 15.3001584 -0.101949376 0 0 36.7 T
 32 2 16 1 4.1838899 -0.002416447 1 1 26.0 T
 34 2 17 0 1.9213881 0.678721863 1 1 15.5 T
 36 2 18 0 22.0870166 0.682030393 0 0 18.8 T
 38 2 19 1 7.8815644 0.938210236 1 1 25.9 T
 40 2 20 0 6.8308086 -0.774314088 0 1 8.5 T
 42 2 21 

Re: [R] Matching

2011-10-29 Thread Daniel Malter
Your post is unlikely to solicit a helpful response. As you do not adhere to
the posting guide, it is quite impossible for us to figure out from your
description what is going wrong. Please provide a self-contained example
that reproduces the problem (i.e., code with simulated or actual data that
we can copy paste to the R-prompt). Moreover, chances are that when you try
to reproduce the error with simulated code, you will figure out what your
mistake is.

Best,
Daniel


shish matt wrote:
 
 I have a spatial weight file in csv that I want as listw object in R.
 The file has the following 3 variables (left to right in the file) --
 OID_, NID and WEIGHTS. NID stands for the neighbors and OID_ as the
 origins. There are 217 origins with 4 neighbors each.
 
 
 I have been able to read the csv file as a data frame (test.csv). Then I
 tried to check whether the OID_ variable is in the right place in the
 dataframe. I used match for that using:
 o
 - match(OID_, OID_)
 I am not sure whether this is the right way to match. Please advice.
 
 Anyway, next I created a matrix object (m) using:
 
 m
 - as.matrix(test.csv[, -1])
 
 Then I created object m1, using:
 
 m1
 - m[o, o]
 
 Finally, I tried creating listw object using:
 mat2listw(m1)
 Here I get an error that x is not a square matrix.
 
 Not sure what to do now. Any helo appreciated!
 
 Thanks,
 Shishm
 
 __
 R-help@ 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.
 


--
View this message in context: 
http://r.789695.n4.nabble.com/Matching-tp3950158p3951527.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Extracting data by row

2011-10-29 Thread William Dunlap
You didn't show the details of what you did before
   Ten-dataTable1[(dataTable1$sensor_depth_m==10),]
but that line makes me suspicious that you did some
experimentation with syntax before coming up with that
line.  In particular, why did you use parentheses around
   (dataTable1$sensor_depth_m==10)
and why did you use quotes around the 10?

Here is an example of why you might have started using
the unnecessary (and misleading) parentheses.  I'll
use a narrow dataset so its R printout does not get
line-wrapped by a rogue mailer.

   d - data.frame(one=c(3,1,1,2), ten=c(3,1,1,2)*10)
   # first, use = instead of == for comparison
   d[ d$one = 1, ]
  Error: unexpected '=' in d[ d$one =
   # react to error message by adding parentheses
   d[ (d$one = 1), ]
one ten
  1   3  30
   # That is definitely the wrong answer.
   # The parentheses hid that problem that you were using =
   # instead of == and did d$one-1, then d[1,] returned row 1.
   # Note that now d has been changed!
   d
one ten
  1   1  30
  2   1  10
  3   1  10
  4   1  20

That may explain how you got a column of 10's (after a ...=10),
but I don't know what you may have done to get a second column
called sensor_depth_m.  Nor do I have a guess as to why you
put quotes around the number 10.

This is why R-help asks to see exactly what you did in R,
not just a synopsis.  (When I copied what you showed into
R, adding a read.csv(header=TRUE, textConnection(...data...)),
I got the correct 2 lines of output, not the incorrect 3 lines you
indicated that you wanted.)

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf Of Vinny Moriarty
 Sent: Friday, October 28, 2011 6:05 PM
 To: r-help@r-project.org
 Subject: [R] Extracting data by row
 
 Thanks everyone for you help with my last question, and now I have one last
 one...
 
 
 Here is a sample of my data in .csv format
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63
 06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56
 06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51
 06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53
 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
 06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60
 06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 2, 29.68
 
 
 My goal was to extract all of the rows from a certain depth. Using the
 column sensor_depth_m to order my data by, I wanted all of the data from
 10m. So this is what I wanted when I finished
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68
 
 
 
 
 To pull out all of the data from a 10m sensor depth I came up with the code:
 
 Ten-dataTable1[(dataTable1$sensor_depth_m==10),]
 
 
 But when I run it I just get an extra column tacked onto the end like this
 
 
 site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c,
 sensor_depth_m
 06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63,10
 06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56,10
 06,2006-04-09 11:00:00,2006-04-09 21:00:00,BAK,sb39, 2, 29.51,10
 06,2006-04-09 11:20:00,2006-04-09 21:20:00,BAK,sb39, 2, 29.53,10
 06,2006-04-09 11:40:00,2006-04-09 21:40:00,BAK,sb39, 10, 29.57,10
 06,2006-04-09 12:00:00,2006-04-09 22:00:00,BAK,sb39, 2, 29.60,10
 06,2006-04-09 12:20:00,2006-04-09 22:20:00,BAK,sb39, 2, 29.66,10
 06,2006-04-09 12:40:00,2006-04-09 22:40:00,BAK,sb39, 10, 29.68,10
 06,2006-04-09 13:00:00,2006-04-09 23:00:00,BAK,sb39, 10, 29.68,10
 
 
 It seems pretty straight forward, I'm not sure what I am missing.
 
 
 Thanks
 
 V
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org 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@r-project.org 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] Plot genes on chr locations

2011-10-29 Thread lumos
Hello,

I have a list of genes in a txt file and the chromosome locations where they
occur. I want to make a plot that will show all the chromosomes (1-22,X,Y)
and the genes which occur in that chr position. 
Does anyone know if it can be done in R?

--
View this message in context: 
http://r.789695.n4.nabble.com/Plot-genes-on-chr-locations-tp3951479p3951479.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] How to plot survival data from multiple trials (simulations)?

2011-10-29 Thread Lancaster, Robert (Orbitz)
Oh sorry, I misread.  You'll only be able to get the confidence interval out of 
the object returned by survfit.

From: Zheng Lu [mailto:luy...@hotmail.com]
Sent: Saturday, October 29, 2011 1:04 PM
To: Lancaster, Robert (Orbitz); r-help@r-project.org
Subject: RE: [R] How to plot survival data from multiple trials (simulations)?

Thank you very much for your consideration and response. you are right and the 
codes you provided was the one I am using now. But my question is if I simulate 
1000 trials (due to limited space, I only provide the results here from 2 
trials), TRL is from 1 to 1000 in the dataset, how can I creat KM curve with 
95% prediction interval instead of confidence interval. Thanks again.

 From: robert.lancas...@orbitz.com
 To: luy...@hotmail.com; r-help@r-project.org
 Date: Sat, 29 Oct 2011 11:49:25 -0500
 Subject: RE: [R] How to plot survival data from multiple trials (simulations)?

 I'm assuming you want to plot the Kaplan-Meier curves. First, load your data 
 into a data.frame, e.g. surv_data
 It looks like ST is your survival time and ind is your event indicator.

 The following code should get you started:

 # create your survival object:
 mySurv = Surv(surv_data$ST,surv_data$ind)

 # use survfit, which will generate KM curves:
 survFit = survfit(mySurv~surv_data$GROUP)

 # plot your curves.
 plot(survFit,conf.int=TRUE,xlab=time,ylab=survival pct)

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf Of Zheng Lu
 Sent: Friday, October 28, 2011 10:30 PM
 To: r-help@r-project.org
 Subject: [R] How to plot survival data from multiple trials (simulations)?



 Dear all:

 Could anyone please provide some R codes to plot the below survival data to 
 compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction 
 interval on the plot from these 2 trials. I would like to simulate 1000 
 trials later. Thanks a lot for your great help and consideration!
 yan

 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 1 1 1 1 2.2636717 0.255634126 1 1 99.4 F
 3 1 2 1 24.7719223 0.756458142 0 1 8.1 T
 5 1 3 0 4.7685832 0.908777937 1 0 2.6 T
 7 1 4 0 2.5934492 -0.231564522 1 1 7.4 T
 9 1 5 0 4.7309141 -2.455991696 0 1 0.4 T
 11 1 6 1 3.5904766 -0.459694803 1 1 13.1 T
 13 1 7 1 4.8592495 0.983131140 1 1 17.8 T
 15 1 8 1 3.1308760 -1.136462783 0 0 10.6 T
 17 1 9 1 5.8127637 -0.131647588 0 1 1.2 T
 19 1 10 0 4.0875668 -3.567509428 0 1 0.4 T
 21 1 11 1 14.7112528 0.900416367 1 1 15.2 T
 23 1 12 0 6.7290298 -0.140283251 0 0 8.5 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 25 1 13 0 6.6118789 -0.095603854 0 1 13.8 T
 27 1 14 1 1.1191479 0.735691765 1 1 60.5 F
 29 1 15 0 11.9169275 0.796172293 0 0 40.1 F
 31 1 16 1 6.7940011 0.845746271 1 1 68.1 F
 33 1 17 0 4.7380330 0.582527179 1 1 11.7 T
 35 1 18 0 12.0571049 0.165637187 0 0 25.0 T
 37 1 19 1 3.1922217 0.891862148 1 1 34.0 T
 39 1 20 0 10.6253830 -0.747701704 0 1 7.8 T
 41 1 21 0 2.0178336 -2.732716143 0 1 0.8 T
 43 1 22 1 13.8066137 0.706372607 0 1 58.2 F
 45 1 23 1 11.8844261 0.842735359 1 1 13.9 T
 47 1 24 1 3.9546421 0.193353044 0 1 2.7 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 49 1 25 0 27.0913396 0.970400135 1 1 19.1 T
 51 1 26 1 12.0249672 0.886403017 1 1 27.1 T
 53 1 27 1 5.9453281 0.964694968 1 1 21.2 T
 55 1 28 0 6.8084911 -1.333850454 1 0 4.1 T
 57 1 29 1 8.3642227 -0.024960757 0 1 4.4 T
 59 1 30 0 26.6382483 0.714020234 0 0 3.9 T
 61 1 31 1 13.1107410 0.372041597 0 1 26.2 T
 63 1 32 0 4.2271255 0.056569282 1 1 14.3 T
 65 1 33 0 17.7269456 0.252550311 0 0 11.2 T
 67 1 34 1 3.6215522 -0.282323084 0 0 0.3 T
 69 1 35 1 19.3787770 0.349288143 0 1 5.2 T
 71 1 36 0 8.9546567 0.945492048 1 1 15.2 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 73 1 37 0 2.7796959 -3.119155682 0 0 12.3 T
 75 1 38 0 9.4029912 -0.793046460 0 1 1.2 T
 77 1 39 1 7.8146429 0.888593758 1 1 8.0 T
 79 1 40 0 9.6419102 0.525301532 1 1 22.4 T
 81 1 41 1 3.3174969 0.915870306 1 1 24.7 T
 83 1 42 1 12.4030358 0.661856980 1 1 16.4 T
 85 1 43 1 24.2982862 0.710967270 0 1 5.5 T
 87 1 44 0 10.4332028 0.940833126 1 0 2.9 T
 89 1 45 0 4.7520799 0.897518558 1 1 32.6 T
 91 1 46 0 2.7028663 -3.484128492 0 1 0.2 T
 93 1 47 1 2.7572158 0.890976979 1 0 30.9 T
 95 1 48 0 7.2240161 -0.377073350 0 0 3.7 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 97 1 49 0 20.6156368 0.500864314 0 1 12.2 T
 99 1 50 1 12.8547093 0.982784519 1 1 54.4 F
 2 2 1 1 3.0862631 0.931988949 1 1 199.2 F
 4 2 2 1 18.6633707 0.540651036 0 1 8.1 T
 6 2 3 0 5.5728260 -1.851336117 1 0 3.0 T
 8 2 4 0 4.0740408 0.021119280 1 1 10.1 T
 10 2 5 0 14.2396242 0.465013972 0 1 6.6 T
 12 2 6 1 37.5234448 0.986992132 1 1 30.5 T
 14 2 7 1 11.2925748 0.922905093 1 1 14.0 T
 16 2 8 1 15.2298842 0.459418082 0 0 12.6 T
 18 2 9 1 5.3266590 -1.487487920 0 1 0.3 T
 20 2 10 0 11.7956270 0.606294774 0 1 26.9 T
 TRL ID ECOG BASE PTR8 GROUP POP ST ind
 22 2 11 1 26.0051377 0.823996317 1 1 8.6 T
 24 2 12 0 4.7851855 -1.635216564 0 0 10.7 T
 26 2 13 0 5.4896572 -1.085740446 0 1 3.8 T
 28 2 14 1 

[R] Redundancy canonical analysis plot problem in 3D using VEGAN

2011-10-29 Thread Thomas . Rousseaubeaumier


  Hi Guys,

First, English is not my native language so sorry if the question is

too difficult to understand. I can rephrase it if necessary.

I have 32-bit Windows Xp SP3, i use R version 2.12.0 (2010-10-15),
and
the question is about Redundancy canonical analysis  plot problem in

3D using VEGAN, RGL, SCATTERPLOT3D and SFSMISC.

I noticed the following  code to explain as clearly as possible the
problems encountered.

I am not able to add  species scores  from RDA results in 3D plot
like i can in 2D plot.

With the code i used , i get errors like ;

ERROR dans t$sites : $ operator is invalid for atomic vectors,

Erreur dans match.arg (display, items) : 'arg' should be one of
“xyz.convert”, “points3d”, “plane3d”, “box3d”, “points”, “arrows”

I saw that I can use other functions, but it is impossible to extract

the 3D scores ( and add species to 3d plot ), Other fonctions works
but, add elements in a 2D space.

How can I add the species scores (sites and arrows are added
correctly) to the 3D plot as with the 2D plot.

Thank you for your help,

Sincerely,

Thomas
University of Quebec at Trois-Rivieres , Canada
Environmental science MSC student.
rouss...@uqtr.ca, thomasbeaum...@hotmail.com

Here is the noticed code I used;

- CODE 

# Load library

library(vegan)
library(rgl)
library(scatterplot3d)
library(sfsmisc)

# Import data
ALLMAS - read.table(C:/data.txt, header=TRUE, sep=,
na.strings=NA, dec=., strip.white=TRUE

# Define var.

X -ALLMAS[,c(10,14,15,16,18,19,22)] # env. (7) var.

Y -ALLMAS[,c(9,3:6)]       # y. (4) var

Z -ALLMAS[,c(25)]     # Z.  (1) var covariate

ENVIESRDA -rda(Y,X,Z)     # Redundancy canonical analysis

pl - ordiplot3d(ENVIESRDA, angle=15, type=n) # Get $Points (1:2) ,

get $arrows (1:2)

text(pl, arrows, col=blue, pos=3, cex = 1) # Text env. var in
plot
text(pl, points, col=red, pos=1, cex = 0.5) # Point sites
(y.var) in plot

text(pl, species, col=blue, cex=0.8) # Text  species  in plot ,

#     I get the following error message:
#    Erreur dans match.arg(display, items) :
#     'arg' should be one of “xyz.convert”, “points3d”, “plane3d”,
“box3d”, “points”, “arrows”
#    I saw that I can use other functions, but it is impossible to
extract the 3D scores. Other features add elements in a 2D space.
#     Then I try the following code, which works well in 2D when I
extract the summary of the results of the RDA.

t -summary(ENVIESRDA,scal=2) # t -summary(pl,scal=2) 

# I get ;

# Length Class  Mode   
# xyz.convert    1 -none- function
# points3d            1 -none- function
# plane3d              1 -none- function
# box3d            1 -none- function
# points          48 -none- numeric
# arrows     14 -none- numeric

# Points = sites but where is  species scores  ?

X =t$sites[,1] # ERROR dans t$sites : $ operator is invalid for
atomic vectors
Y =t$sites[,2]
t$sites

summary(ENVIESRDA, step=1000, perm.max=1000) # Summary

anova(ENVIESRDA, step=1000, perm.max=1000) # Anova

# Draw arrows to connect the sites with each other before / after
study.

# But I can't get the new coordinates of 3D graphics using the
function summary.

stn2= p.arrows(X[1],Y[1], X[13],Y[13],fill=red,width=1)
stn3= p.arrows(X[2],Y[2], X[14],Y[14],fill=yellow,width=1)
stn4= p.arrows(X[3],Y[3], X[15],Y[15],fill=yellow,width=1)
stn5= p.arrows(X[4],Y[4], X[16],Y[16],fill=red,width=1)
stn6= p.arrows(X[5],Y[5], X[17],Y[17],fill=yellow,width=1)
stn7= p.arrows(X[6],Y[6], X[18],Y[18],fill=red,width=1)
stn9= p.arrows(X[7],Y[7], X[19],Y[19],fill=yellow,width=1)
stn10= p.arrows(X[8],Y[8], X[20],Y[20],fill=yellow,width=1)
stn11= p.arrows(X[9],Y[9], X[21],Y[21],fill=red,width=1)
stn12= p.arrows(X[10],Y[10], X[22],Y[22],fill=yellow,width=1)
stn13= p.arrows(X[11],Y[11], X[23],Y[23],fill=red,width=1)
stn18= p.arrows(X[12],Y[12], X[24],Y[24],fill=red,width=1)  
stn19= p.arrows(X[13],Y[13], X[25],Y[25],fill=red,width=1)

#     END

-
Courriel expédié via https://courriel.uqtr.ca

__
R-help@r-project.org 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] Unscribe me please!

2011-10-29 Thread Mahesh Krishnan
-- 
Hello,

Kindly unsubscribe me from R emailing list
And confirm me by email

I do not want any further email

Regards





Mahesh Krishnan
__
The information of this email is strictly confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any copying, distribution or any other use of this email
is prohibited and may be unlawful. In such case, you should notify us
immediately and destroy this email.

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Plot genes on chr locations

2011-10-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Perhaps this question is better suited for the bioconductor list: they can 
probably get you an answer quickly. 

Michael

On Oct 29, 2011, at 3:10 PM, lumos lumos.lumos.lu...@gmail.com wrote:

 Hello,
 
 I have a list of genes in a txt file and the chromosome locations where they
 occur. I want to make a plot that will show all the chromosomes (1-22,X,Y)
 and the genes which occur in that chr position. 
 Does anyone know if it can be done in R?
 
 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Plot-genes-on-chr-locations-tp3951479p3951479.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org 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@r-project.org 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] Unscribe me please!

2011-10-29 Thread Joshua Wiley
Dear Mahesh,

What you have done is the social equivalent of walking into a large
retail store, getting on the store intercom, and saying, so that
thousands of customers can hear you, Kindly get me out of this
store.  There are two problems with this:

1) It is inconsiderate to bother thousands of bystanders with your
request which is really directed at management
2) It is actually a task you perform yourself---you presumably
subscribed yourself in the first place and when you went through that
process you would have learned how to unsubscribe.  But supposing you
forgot or lost that email, the truly trivial step of searching on
google for: unsubscribe from R help list gives tons of pages, the
very first one of which links you to a page with clear, simple, easy,
instructions for how to unsubscribe.  It is not asking for help that
is a problem, it is the implicit, 3 minutes of my time to search and
do it myself is too much to spend, I want someone else to do it for
me.  Indeed, since you use gmail, you would not even have to point
your browser to www.google.com, you would just have to use the built
in search and click the 'search the web' button, but evidently, you
would rather have someone else do that for you and then send you an
email stating as much.

That's where I come in.  I offer a specialized service, and for only
20 USD, I will gladly submit anyone's email to be unsubscribed from
this list, and send you a follow up email to alert you of as much.  If
you are interested in this service, please email me off list and let
me know when you have transferred the funds to my paypal account (same
email address as I am using here).

I look forward to doing business with you,

Josh

On Sat, Oct 29, 2011 at 3:14 PM, Mahesh Krishnan
bhangisoluti...@gmail.com wrote:
 --
 Hello,

 Kindly unsubscribe me from R emailing list
 And confirm me by email

 I do not want any further email

 Regards





 Mahesh Krishnan
 __
 The information of this email is strictly confidential and may be legally
 privileged. It is intended solely for the addressee. If you are not the
 intended recipient, any copying, distribution or any other use of this email
 is prohibited and may be unlawful. In such case, you should notify us
 immediately and destroy this email.

        [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.




-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

__
R-help@r-project.org 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] Matching

2011-10-29 Thread Joshua Wiley
Hi Shishm,

Part of what you do seems reasonable.  My guess is that:

o - match(OID_, OID_)

is not doing what you want/think.  What happens when you look at the
results?  e.g.,:

print(o)

You use that later on as row and column indices to extract from m, to
create m1.  The fact taht mat2listw complains that m1 is not square,
makes me guess the indices used to create m1 are not working
correctly, which points back to o - match().

With a more detailed example we can give more detailed suggestions

Hope this helps some,

Josh

On Fri, Oct 28, 2011 at 3:22 PM, shish matt shi...@yahoo.com wrote:
 I have a spatial weight file in csv that I want as listw object in R.
 The file has the following 3 variables (left to right in the file) -- OID_, 
 NID and WEIGHTS. NID stands for the neighbors and OID_ as the origins. There 
 are 217 origins with 4 neighbors each.


 I have been able to read the csv file as a data frame (test.csv). Then I 
 tried to check whether the OID_ variable is in the right place in the 
 dataframe. I used match for that using:
 o
 - match(OID_, OID_)
 I am not sure whether this is the right way to match. Please advice.

 Anyway, next I created a matrix object (m) using:

 m
 - as.matrix(test.csv[, -1])

 Then I created object m1, using:

 m1
 - m[o, o]

 Finally, I tried creating listw object using:
 mat2listw(m1)
 Here I get an error that x is not a square matrix.

 Not sure what to do now. Any helo appreciated!

 Thanks,
 Shishm

 __
 R-help@r-project.org 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.




-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

__
R-help@r-project.org 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] Parametric tests

2011-10-29 Thread Cem Girit
Hello, 

I am interested in parametric multi comparison tests such as
Dunnett, Duncan, Tukey, Newman-Keuls, Bonferonni, Scheffe, and
non-parametric tests such as Kruskal-Wallis, and Mann-Whitney U.  Are there
packages that include most of these tests in each category? Many packages
exist for an individual test but their outputs vary in great detail (test
statistics, p-values, etc.) formats.  It is desirable to have one that
allows comparison of different test results  such as Tukey versus Duncan.

 

Cem

 

Cem Girit

 


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.