Re: [R] for loop with multiple conditions in R (e.g. for(i in x j in y)

2014-02-22 Thread arun
Hi,
May be this helps:
res.i - NULL
 for(i in seq_along(x)){ res.i - c(res.i,x[i]-y[i])}

#or using your nested loop: 
res.ij - NULL
 for(i in seq_along(x)){
 for(j in seq_along(y)){
 if(i==j){
 res.ij - c(res.ij,x[i]-y[j])
 }
 }}

identical(x-y,res.i)
#[1] TRUE

identical(res.i,res.ij)
#[1] TRUE
A.K.

I need a for loop that pulls data from two different vectors. For example, 
suppose that my vectors were 
x - c(1,2,3) 
y - c(4,5,6) 
and I wanted a loop that woul take i in x and subtract it from j in y
 how would I do it? (i.e. 1-4,2-5,3-6). Note: I realize that for this 
silly example there are much better ways to do this than using a for 
loop, but the actual script that I am working with is much more 
complicated and really does needs to be a for loop, so if you would 
humor me and tell me how to write a loop for this example rather than 
recommending a better way to solve the example, I would appreciate it. 

I've tried the following line of code, but, as expected, it 
subtract each value of i from each value of j, which is not what I want,
 I want the first value of i subtracted from the first value of j, the 
second value of i from the second value of j, etc. 
res.i - c(NULL) 
for(i in x){ 
  for(j in y){ 
  sol.i - i-j 
  res.i - c(res.i,sol.i)} 
  print(res.i)} 

thanks!

__
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: Split-Split model nested in a nested structure

2014-02-22 Thread Zia Ahmed
Dear list members.
We are trying see effect of N on yield of three wheat genotypes under late
and early planting conditions in saline and non-saline environments. Our
experimental structure as follows:

Districts (2: DIST01 and DIST02) - Not randomly selected

ENV (Saline and Non-Saline) - One  saline and non-saline environment (eg.
village) were selected in each district (not random).

*SOWING Time  (Late and Early):* 8 farmers' fields were selected randomly
in each environment or village.  These are spatially distributed in a
village. Among them, 4 were grouped as early and 4 were grouped as a late
sowing group.

*N_TREAT  (N0 and N100)* - Then, each farmer field was splitted  into
two  main
plots where two N-treatment were assigned randomly.

*GENOTYPE ( G1,  G2, G3*) - Then, N-main plots were further splited into
three subplots here 3 wheat varieties were  assigned  randomly.

This experiment was repeated for two years. Farmers' fields in Year 1 and
Year 2 were not same. We are not interested to see the District effect on
wheat yield here. Rather, we like to see the effect of saline environment,
sowing time, N  and genotype and their interaction  on wheat yield for year
1 and year 2 separately.
We are using the following ANOVA model. We do not know whether we are
missing something here.  Help will be highly arreciated.
Regards
Zia Ahmed, CIMMYT

model-aov(YIELD~ENV*SOWING*N_RATE*GEN+Error(FARMERS/N_RATE/GEN),
data=mydata)

summary(model)



# District: two

DIST-as.factor(rep(c(DIST01,DIST02),each=96))

# ENV: Saline and Non-saline environment

ENV-as.factor(rep(rep(c(Saline,Non-saline),each=48),2))

# Farmers 16

FARMERS-as.factor(rep(c(F1,F2,F3,F4,F5,F6,F7,F8,

 F9,F10,F11,
F12,F13,F14,F15,F16),each=12))

# Showing Date: two

SOWING-as.factor(rep(rep(c(Early,Late),each=6),16))

# Nitrogen treatments: N0 and N100

N_RATE-as.factor(rep(rep(c(N0,N100),each=3),32))

# Genotype

GEN-as.factor(rep(rep(c(V1,V2,V3),each=1),64))

# Response: Wheat Yield

set.seed(1234)

YIELD - rnorm(n=192, mean=3.0, sd=0.5)

# Create Data Frame

mydata-data.frame(DIST,ENV, FARMERS,SOWING,N_RATE,GEN,YIELD)

mydata




[[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] shapiro.test

2014-02-22 Thread Rui Barradas

Hello,

Inline

Em 21-02-2014 23:13, Rolf Turner escreveu:

On 22/02/14 11:04, Rui Barradas wrote:

Hello,

Not answering directly to your question, if the sample size is a
documented problem with shapiro.test and you want a normality test, why
don't you use ?ks.test?

m - mean(HP_TrinityK25$V2)
s - sd(HP_TrinityK25$V2)

ks.test(HP_TrinityK25$V2, pnorm, m, s)


Strictly speaking this is not a valid test.  The KS test is used for
testing against a *completely specified* distribution.  If there are
parameters to be estimated, the null distribution is no longer
applicable.  This may not be a real problem if the parameters are
*well* estimated, as they would be in this instance (given that the
sample size is over-large).  I'm not sure about this.


Yes, you're right. I hesitated before posting my answer precisely 
because of this, the parameters must be pre-determined constants, not 
computed from the data. Like Greg pointed out in his reply, the help 
page for ?ks.test also explicitly refers to it (which I had missed).


The chi-squared gof test seems to be a good choice, given the sample size.

Rui Barradas


The Lilliefors test is theoretically available in this context when
mu and sigma are estimated, but according to the Wikipedia article, the
Lilliefors distribution is not known analytically and the critical
values must be determined by Monte Carlo methods.  There is a
LillieTest function in the DescTools package which makes use of some
approximations to get p-values.

However I think that a better approach would be to use a chi-squared
goodness of fit test whereby you can adjust for estimated parameters
simply by reducing the degrees of freedom.  I believe that the
chi-squared test is somewhat low in power, but with a very large sample
this should not be a problem.

The difficulty with the chi-squared test is that the choice of bins is
somewhat arbitrary.  I believe the best approach is to take the bin
boundaries to be the quantiles of the normal distribution (with
parameters m and s) corresponding to equispaced probabilities on
[0,1], with the number of such probabilities being k+1 where
k = floor(n/5), n being the sample size.  This makes the expected counts
all equal to n/k = 5 so that the chi-squared test is valid.  The
degrees of freedom are then k-3 (k - 1 - #estimated parameters).

One last comment:  I believe that it is generally considered that
testing for normality is a waste of time and a pseudo-intellectual
exercise of academic interest at best.

cheers,

Rolf Turner




Hope this helps,

Rui Barradas

Em 21-02-2014 15:59, Gonzalo Villarino Pizarro escreveu:

Dear R users,
Please help with with this maybe basic question. I am trying to see
if my
data is normal but is a large file and the test does not work.
I keep getting the message : Error in shapiro.test(x =
HP_TrinityK25$V2)
:  sample size must be between 3 and 5000
thanks!

  shapiro.test(x=HP_TrinityK25$V2)
Error in shapiro.test(x = HP_TrinityK25$V2) : sample size must be
between 3
and 5000

##Note:
HP_TrinityK25= my file
HP_TrinityK25$V2= data in my file

[[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] shapiro.test

2014-02-22 Thread Rui Barradas

Second.

Rui Barradas

Em 21-02-2014 23:44, Rolf Turner escreveu:

On 22/02/14 11:53, Greg Snow wrote:

SNIP



Why are you testing your data for normality?  For large sample sizes
the normality tests often give a meaningful answer to a meaningless
question (for small samples they give a meaningless answer to a
meaningful question).


SNIP

Fortune!!!

cheers,

Rolf

__
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] Math symbols in ggplot facets

2014-02-22 Thread Lars Bishop
Hello,

I would like to show in my facet labels the equivalent in LaTex of
$\sigma_{0}= \sqrt{2}$. I think I'm close below, but not yet as it shows
$(\sigma_{0}, \sqrt{2})$

m - mpg
levels(m$drv) - c(sigma[0]=sqrt(2), sigma[0]=2 * sqrt(2), sigma[0]= 3
* sqrt(2))

ggplot(m, aes(x = displ, y = cty)) + geom_point() +
  facet_grid(. ~ drv, labeller = label_parsed)


Thanks,
Lars.

[[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] dependent column(s) in data frame

2014-02-22 Thread PQuery
Many thanks David,

I will have a look on logistic regression for my case.
Do you know about a good example regarding logistic regression ?
I was thinking also of using Multiple Factor Analysis too (MFA - like in
FactoMineR). However I am not sure how successful this is going to be.

Best,
P.




--
View this message in context: 
http://r.789695.n4.nabble.com/dependent-column-s-in-data-frame-tp4685561p4685684.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] Exposures in bernoulli glm()

2014-02-22 Thread Marco Inacio

Hi, is it possible to add exposures to a glm with family=binomial()?

It's easy to do it for a Poisson/negative binomial: just multiply the 
mean by the exposure, that is, offset(log(exposure)): but this obviously 
wrong for a binomial/Bernoulli since the mean must be no bigger than 1.


My goal was do it it with pscl::zeroinfl and pscl::hurdle, but answering 
for binomial/Bernoulli would already help.


__
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] Learn R in a Day - new ebook

2014-02-22 Thread Steve Murray
Dear all,
 
I'd like to make you aware of my new ebook - Learn R in a Day - which
provides the reader with key programming skills through an examples-oriented
approach and is ideally suited for academics, scientists, mathematicians and
engineers.
 
Amazon.com: 
http://www.amazon.com/Learn-R-Day-Steven-Murray-ebook/dp/B00GC2LKOK/ref=sr_1_1?s=digital-textie=UTF8qid=1393005750sr=1-1keywords=learn+r+in+a+day
 
Amazon UK: 
http://www.amazon.co.uk/Learn-R-Day-Steven-Murray-ebook/dp/B00GC2LKOK

 
The book assumes no prior knowledge of computer programming and
progressively covers all the essential steps needed to become confident and
proficient in using R within a day. Topics include how to input, manipulate,
format, iterate (loop), query, perform basic statistics on, and plot data,
via a step-by-step technique and demonstrations using in-built datasets
which the reader is encouraged to replicate on their computer. Each chapter
also includes exercises (with solutions) to practice key skills and empower
the reader to build on the essentials gained during this introductory
course.
 
Steve Murray
  
[[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] Hi everybody, your help would be very appreciate, thanks !

2014-02-22 Thread varin sacha
Hi everybody,

I have realized a multiple linear regression. 
To know how well my model does in terms of prediction, I can compute prediction 
intervals bands and decide if they are narrow enough to be of use. If they are 
too wide, then they probably are not useful.

Using R, I have written these R codes.

LinearModel.1 - lm(GDP.per.head ~ Competitivness.score + Quality.score, 
  data=Dataset)
summary(LinearModel.1)
predict(LinearModel.1, se.fit = FALSE, scale = NULL, df = Inf,interval = 
c(none, confidence, prediction),level = 0.95, type = c(response, 
terms),terms = NULL)

Now, I am trying to draw one graph / plot, where I can have the straight 
regression line and the prediction interval bands in the same graph / plot to 
see if the bands are narrow enough to be of use.

Could you please help me with my R codes ?

Thanks for your precious help,

[[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] hist: argument '...' is not made use of

2014-02-22 Thread Jennifer Lyon
Hi:

When converting some code to use plot = F in a call to hist(), I received
the following warning (with a much simplified example).

moo-1:10
hist(moo, las=1, plot=F)

Warning message:
In hist.default(moo, las = 1, plot = F) : argument '...' is not made use of

From the help page, I was able to figure out that it was the las=1
argument, which is not needed with plot = F that was my issue. My question
is whether this was the intended warning (instead of mentioning las = 1
explicitly, which might be hard to implement) and if so if there might be
some more direct way to figure out what was wrong from say args(hist),
since I initially thought I'd in some way unintentionally passed ... as an
argument?

sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


Thanks!

Jen

[[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] create video?

2014-02-22 Thread Spencer Graves

Hello:


  Might someone have experience with video production?  The 
animation package in R can produce video clips.  These could 
presumably be merged and synced with audio using something like 
Avidemux.  I have not done this, but it looks like it might be a 
relatively easy way for an R user to create a video from audio and slides.



  I'd like something that would give me more control than 
screencasting.  For this, I'm thinking of recording the audio, then 
measuring each phrase with something like Audacity.  I'd then use that 
with R and Avidemux as outlined above.



  Can anyone suggest something different or provide details on ways 
to make this easy?



  Thanks,
  Spencer Graves

__
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 a logarithmic regression line

2014-02-22 Thread arun
HI,
Try ?curve

fit - lm(Mean_Percent_of_Range~log(No.ofPoints))
 coef(fit)
 #    (Intercept) log(No.ofPoints) 
  #     -74.52645 46.14392 



 plot(Mean_Percent_of_Range ~ No.ofPoints) 
curve(coef(fit)[[1]]+coef(fit)[[2]]*log(x),add=TRUE,col=2)


A.K.



I realize this is a stupid question, and I have honestly tried to find 
the answer online, but nothing I have tried has worked. I have two 
vectors of data: 

Mean_percent_of_range 
10.9  17.5  21.86667  25.0  25.4  26.76667  29.5
  32.36667  43.1  41.8 50.56667  49.26667  50.36667  51.9 
 59.7  63.96667  62.5  60.8  64.2  66.0 74.0 
 70.4  77.06667  76.46667  78.1  89.46667  88.9  90.0 
 91.6  94.3 95.5  96.2  96.5  91.4  98.2 
 96.6  97.4  99.0 100.0 

and 
No.ofPoints 
5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 
32 33 34 35 36 37 38 
39 40 41 42 43 

When I plot these, I get a logarithmic curve (as I should for this type of 
data) 
 plot(Mean_Percent_of_Range ~ No.ofPoints) 

All that I want to do is plot best fit regression line for that 
curve. From what I have read online, it seems like the code to do that 
should be 
 abline(lm(log(Mean_Percent_of_Range) ~ log(No.ofPoints))) 
but that gives me a straight line that isn't even close to fitting the data 

How do I plot the line and get the equation of that line and a correlation 
coefficient? 
Thanks

__
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] dependent column(s) in data frame

2014-02-22 Thread David Winsemius

On Feb 22, 2014, at 4:28 AM, PQuery wrote:

 Many thanks David,
 
 I will have a look on logistic regression for my case.
 Do you know about a good example regarding logistic regression ?
 I was thinking also of using Multiple Factor Analysis too (MFA - like in
 FactoMineR). However I am not sure how successful this is going to be.

Your data (exclusively 0/1 values) did not look like it would be suitable for 
factor analysis. Perhaps you mean to use that package's correspondence analysis 
methods?

-- 

David Winsemius
Alameda, CA, USA

__
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 a logarithmic regression line

2014-02-22 Thread David Winsemius

On Feb 22, 2014, at 1:06 PM, arun wrote:

 HI,
 Try ?curve
 
 fit - lm(Mean_Percent_of_Range~log(No.ofPoints))
  coef(fit)
  #(Intercept) log(No.ofPoints) 
   # -74.52645 46.14392 
 
 
 
  plot(Mean_Percent_of_Range ~ No.ofPoints) 
 curve(coef(fit)[[1]]+coef(fit)[[2]]*log(x),add=TRUE,col=2)
 
 
 A.K.
 
 
 
 I realize this is a stupid question, and I have honestly tried to find 
 the answer online, but nothing I have tried has worked. I have two 
 vectors of data: 
 
 Mean_percent_of_range 
 10.9  17.5  21.86667  25.0  25.4  26.76667  29.5
  32.36667  43.1  41.8 50.56667  49.26667  50.36667  51.9 
  59.7  63.96667  62.5  60.8  64.2  66.0 74.0 
  70.4  77.06667  76.46667  78.1  89.46667  88.9  90.0 
  91.6  94.3 95.5  96.2  96.5  91.4  98.2 
  96.6  97.4  99.0 100.0 
 
 and 
 No.ofPoints 
 5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
 31 32 33 34 35 36 37 38 
 39 40 41 42 43 
 
 When I plot these, I get a logarithmic curve (as I should for this type of 
 data) 
 plot(Mean_Percent_of_Range ~ No.ofPoints) 
 
 All that I want to do is plot best fit regression line for that 
 curve. From what I have read online, it seems like the code to do that 
 should be 
 abline(lm(log(Mean_Percent_of_Range) ~ log(No.ofPoints))) 
 but that gives me a straight line that isn't even close to fitting the data 
 
 How do I plot the line and get the equation of that line and a correlation 
 coefficient? 

The 'abline' function is not what you want. Use 'lines' to plot multiple 
points. 

Perhaps:

mod - lm(log(Mean_percent_of_range) ~ log(No.ofPoints))
 plot(log(Mean_percent_of_range), log(No.ofPoints))
lines( log(No.ofPoints), predict(mod))
#
 summary(mod)

Call:
lm(formula = log(Mean_percent_of_range) ~ log(No.ofPoints))

Residuals:
 Min   1Q   Median   3Q  Max 
-0.32617 -0.04839  0.00962  0.05316  0.17316 

Coefficients:
 Estimate Std. Error t value Pr(|t|)
(Intercept)   1.198400.08060   14.87   2e-16 ***
log(No.ofPoints)  0.942280.02609   36.12   2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.09455 on 37 degrees of freedom
Multiple R-squared:  0.9724,Adjusted R-squared:  0.9717 
F-statistic:  1305 on 1 and 37 DF,  p-value:  2.2e-16



David Winsemius
Alameda, CA, USA

__
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] Math symbols in ggplot facets

2014-02-22 Thread Dennis Murphy
Hi:

You were close...

library(ggplot2)
m - mpg

# Set the factor labels with plotmath code (note the ==)
m$drv - factor(m$drv, labels = c(sigma[0] == sqrt(2),
  sigma[0] == 2 * sqrt(2),
  sigma[0] == 3 * sqrt(2)))

ggplot(m, aes(x = displ, y = cty)) + geom_point() +
  facet_grid(. ~ drv, labeller = label_parsed)

Dennis

On Sat, Feb 22, 2014 at 3:24 AM, Lars Bishop lars...@gmail.com wrote:
 Hello,

 I would like to show in my facet labels the equivalent in LaTex of
 $\sigma_{0}= \sqrt{2}$. I think I'm close below, but not yet as it shows
 $(\sigma_{0}, \sqrt{2})$

 m - mpg
 levels(m$drv) - c(sigma[0]=sqrt(2), sigma[0]=2 * sqrt(2), sigma[0]= 3
 * sqrt(2))

 ggplot(m, aes(x = displ, y = cty)) + geom_point() +
   facet_grid(. ~ drv, labeller = label_parsed)


 Thanks,
 Lars.

 [[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] equivalent of $\check Y$ in plotmath

2014-02-22 Thread Ranjan Maitra
Hi,

I am trying to put the expression which in LaTeX would be $\check Y$  as
a label on the axis of a plot.

How does one get the \check part of the above to produce a similar
symbol in plotmath in R? I looked around plotmath's help but could not
see this in the documentation.

Many thanks for any suggestions, and best wishes,
Ranjan

-- 
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. Please respond to the mailing list if appropriate.
For those needing to send personal or professional e-mail, please use
appropriate addresses.


FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks  orcas on your 
desktop!

__
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] seeking alternative method to copy a large section of my R program

2014-02-22 Thread Julie Royster
Is there any way I can insert markers at the beginning and end of a large
section of R statements and then copy all text in between to clipboard?

I have trouble scrolling to select long sections, so if there is another way
I would like to know it!

Julie (for husband Larry)

[[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] seeking alternative method to copy a large section of my R program

2014-02-22 Thread Jeff Newmiller
This is a function of the editor you use and the operating system you use, 
neither of which is on topic here. That said, many popular GUI editors allow 
you to select by holding the shift key down while moving the cursor with arrow 
keys. Note that in the long run using the source function to have R process a 
whole file is much easier to remember how to do later than remembering which 
chunks of code to copy and paste. In addition, sometimes the amount of text 
that the clipboard can hold will be less than you want to run, leading to 
mysterious error messages from R.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On February 22, 2014 1:57:14 PM PST, Julie Royster jsdroys...@nc.rr.com wrote:
Is there any way I can insert markers at the beginning and end of a
large
section of R statements and then copy all text in between to clipboard?

I have trouble scrolling to select long sections, so if there is
another way
I would like to know it!

Julie (for husband Larry)

   [[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] seeking alternative method to copy a large section of my R program

2014-02-22 Thread David Winsemius

On Feb 22, 2014, at 1:57 PM, Julie Royster wrote:

 Is there any way I can insert markers at the beginning and end of a large
 section of R statements and then copy all text in between to clipboard?
 
 I have trouble scrolling to select long sections, so if there is another way
 I would like to know it!

Each interface is going to be a bit different, but on both the Mac and Windoze 
I can position the cursor at one end , hold down the shift-key, scroll to the 
other end and release the shift-key and I will have the target ready for either 
an Edit/Cut or a cmd-C/ctrl-C.
-- 

David Winsemius
Alameda, CA, USA

__
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.