Displaying 20 results from an estimated 13000 matches similar to: "回复: R-help Digest, Vol 73, Issue 32"
2009 Mar 30
3
Calculating First Occurance by a factor
I'm having difficulty finding a solution to my problem that without using a
for loop. For the amount of data I (will) have, the for loop will probably
be too slow. I tried searching around before posting and couldn't find
anything, hopefully it's not embarrassingly easy.  
Consider the data.frame, Data,  below
Data
Sub Tr  IA   FixInx  FixTime
p1   t1  1    1        200
p1   t1  2   
2013 Nov 15
0
getting the results of tapply into a single matrix
Hi,
Try:
example <- read.table(text="ID Sex Location CL
1?? F??? lake1?? 40
1?? F??? lake1??? 
1?? F??? lake1???? 43
2?? M??? lake1??? 30
3?? M??? lake2??? 22
4?? F??? lake2???? 25
4?? F??? lake2???? 27",sep="",header=TRUE,stringsAsFactors=FALSE,fill=TRUE) 
aggregate(CL~.,example,mean,na.rm=TRUE)
#or
library(plyr)
2009 Mar 30
2
ggplot2-geom_text()
Hi: I need help with geom_text().
 I would like to count the number of Locations
 and put the sum of it right above each bar.
x <- "Location Lake_dens Fish Pred
Lake1		1.132	1	0.115
Lake1		0.627	1	0.148
Lake1		1.324	1	0.104
Lake1		1.265	1	0.107
Lake2		1.074	0	0.096
Lake2		0.851	0	0.108
Lake2		1.098	0	0.095
Lake2		0.418	0	0.135
Lake2		1.256	1	0.088
Lake2		0.554	1	0.126
Lake2		1.247	1	0.088
2006 Oct 24
0
plot(all.effects)
Dear r-helpers,
plot(all.effects()) uses trellis for its output, and often produces  
several effect plots in a layout. Can anyone tell me how to set the  
arguments to plot.effect which default to
row=1, col=1, nrow=1, ncol=1, more=FALSE
so that I can plot multiple effect plots on one layout?
I was hoping that a call like
last <- rep(c(TRUE, FALSE), c(3, 1))
lay <-matrix(c(1:4,), 2, 2,
2018 May 22
0
Using tryCatch in a for loop
No. If your ouput is a numeric "matrix", it cannot include alpha. Columns
in a data frame can be of different classes, but each column must be single
class.
and finally, of course, see ?cat -- I think you are misusing it. If you
simply want to return "somestuff", your function should be:
function(w) {"somestuff"}
not
function(w) {cat("somestuff")}
As
2010 Sep 10
4
for loop help please!
Hi Everyone, 
I have a 2-dim data.matrix(e.g., table1) in which row1 specifies a range of
values. row2 - rown specify the number of times I want to replicate each
corresponding value in row1. I can do this with the following function: 
rep(c(table1[1,]),c(table1[X,])) #where X would go from 2 - n. 
Now, I can do this manually by changing the values of X and save each
resulting array/vector in
2007 Nov 12
1
update matrix with subset of it where only row names match
I guess this has a simple solution:
I have matrix 'mat1' which has row and column names, e.g.:
	A	B	C
row1	0	0	0
row2	0	0	0
....
rown	0	0	0
I have a another matrix 'mat2', essentially a subset of 'mat1' where the 
rownames are all in 'mat1' e.g.:
	B
row3	5
row8	6
row54	7
I want to insert the values of matrix mat2 for column B (in reality it 
could be some or
2018 May 22
2
Using tryCatch in a for loop
Data and code as promised:
#Creating a test dataset
Year<- c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014)
Lake1<- c(2, 4, 5, 2, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2)
Lake2<- c(1, 3, -1, 4, -2, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2)
Lake3<- c(1, 2, 5, -3, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2)
Lake4<- c(1, 1, 1, 1, 1, 1, 1, 250, 240, 240, 240, 240, 240, 239,
2006 Apr 18
2
questioin about cluster in R
Hi,All.Sorry for the group mail.
I recently met a question and I have struggled on that for a while but 
failed to found the solution.
I have a distance matrix as below.
---
0    35    33    9    36
35    0    10    32    51
33    10    0    30    49
9    32    30    0    35
36    51    49    35    0
-------------------
I want to do cluster with average method.
----
rown<-c("A",
2023 May 02
1
Reg: Help regarding ggplot2
It's not clear what you want but ...
On 02/05/2023 10:57, Upananda Pani wrote:
> Dear All,
>
> I have a dataset which contains date and 12 other countries data. I
> have extracted the data as xts object.
>
> I am not able to recall all the series in the Y axis. My data set
> looks like this
>
> index crepub finland france germany italy netherlands norway poland
>
2018 May 22
3
Using tryCatch in a for loop
Hello All, 
I have been trying to use a for loop to run segmented regressions (from?R package segmented)?on many columns  of data in a data frame with the end goal of writing a new file with the following columns: column title, breakpoint year, slope, and difference in slope. Unfortunately, when one of the columns doesn't have a breakpoint the code stops and provides?an error or warning. I
2018 May 22
0
Using tryCatch in a for loop
Others may have greater insight, but my response is: Exactly what did or
didn't happen that makes you say the code didn't work? That is, what did or
didn't you get when you ran it compared to your expectations?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in
2018 May 22
0
Using tryCatch in a for loop
(practically) ALWAYS respond to the list. I have cc'ed them here.
Others may (almost always do!) have greater insight/better answers than I.
In this case, I have no clue, but presumably your call is wrong, but as I
have no experience with the segmented.lm function, I don't care to track
down how exactly. Your tryCatch call seems to be fine, however.
-- Bert
Bert Gunter
"The
2013 Mar 25
3
nested 'while' loops
Hi everyone,
I'm using the following code to go over every element of a data frame (row
wise). The problem I am facing is that the outer 'x' variable is not
incrementing itself, thus, only one row of values is obtained, and the
program does not proceed to the next row.
This is the code:
 while(x<=coln)
 {
   while(y<=rown)
   {
     n<-as.numeric(df[[y]][x]);
     
2008 Sep 18
4
Strange ! characters inserted into emails
I have never encountered anything like this before, so thought I'd post here
and see if anyone can help.
We have a java application that sends out notification emails to end-users.
The body of the email is some boilerplate text and HTML that is pulled from
a database.  When the emails are received there are random instances of " !"
(that's a space and a bang symbol) inserted
2018 May 22
0
Using tryCatch in a for loop
On 5/22/2018 11:32 AM, Bailey Hewitt wrote:
> Hi Bert,
> 
> Thank you for the quick response!
> 
> In its current?state?the code?prints three lines that say "warning". What I was expecting is that I would?get?a matrix with 4 columns, 1. column names (from the original data, ex. Lake1) 2. breakpoint year 3. slope 4. slope difference from the first to the?second segment of
2009 Mar 29
4
Constrined dependent optimization.
I have an optimization question that I was hoping to get some suggestions on how best to go about sovling it. I would think there is probably a package that addresses this problem.
This is an ordering optimzation problem. Best to describe it with a simple example. Say I have 100 "bins" each with a ball in it numbered from 1 to 100. Each bin can only hold one ball. This optimization is
2018 May 22
4
Using tryCatch in a for loop
Hi Bert,
Thank you for the quick response!?
In its current?state?the code?prints three lines that say "warning". What I was expecting is that I would?get?a matrix with 4 columns, 1. column names (from the original data, ex. Lake1) 2. breakpoint year 3. slope 4. slope difference from the first to the?second segment of the segmented regression. Each row in the matrix would be the results
2008 Jul 16
0
[LLVMdev] GEP::getIndexValid() with other iterators
Hi all,
once more with the patch inline for easy review. I did not include the
argpromotion pass here, since it's not the main topic of this post.
Gr.
Matthijs
Index: lib/VMCore/Instructions.cpp
===================================================================
--- lib/VMCore/Instructions.cpp	(revision 53672)
+++ lib/VMCore/Instructions.cpp	(working copy)
@@ -1068,41 +1068,6 @@
  
2006 Jan 20
1
Samba printing
I have a Red Hat 9 Linux box running Samba 
version:2.2.7a-8.9.0-security-rollup-fix and Hylafax acting as a fax 
server.  I print from my Windows XP machine to the Samba shared printer 
hoping the file name would be passed to Hylafax to use as the outbound 
phone number but Samba is submitting the job to Hylafax with a job name 
like:
smbprn.000117.JrVPBv
Hylafax can't process the job since