Displaying 20 results from an estimated 60 matches for "jvadams".
2013 Nov 04
3
Reading data from Excel file in r
Hi experts,
I want to read data from an excel data like this:
for the fifth column, from first row until 140 but only 1,3,5,7,.....139
(only 70 values),
How can I do it in R?
thanks
[[alternative HTML version deleted]]
2013 Oct 21
3
Error in heatmap
Hi,
Could you please help?
Heatmap doesn't work with:
> heatmap(as.matrix(SPIV2),na.rm = T)
Error in hclustfun(distfun(x)) :
NA/NaN/Inf in foreign function call (arg 11)
There are no 0 data rows or column
Thanks a lot
Regards
---------------------------------------
David
2012 Dec 13
2
replace parenthetical phrases in a string
R-helpers,
I have a vector of character strings in which I would like to replace each
parenthetical phrase with a single space, " ". For example if I start with
x, I would like to end up with y.
x <- c("My toast=bog(keep=3 no=4) and eggs(er34)omit=32",
"dogs have ears",
"cats have tails (and ears, too!)")
y <- c("My toast=bog and eggs
2012 Nov 28
7
zeros in double matrix rather than character matrix
Hi, how are you?
I have 1000 total columns with 100 rows and I have shown 4 columns of 100
rows below. I want the zeros to be read in as numerical or integer values
rather than a character. Right now I have a 100x0 character matrix rather
than a 100x1000 double matrix.
What do I need to do to read in a .csv spreadsheet with counting the zeros
as a numerical or integer value?
Thank-you.
Irucka
2009 Jul 28
3
selecting vector elements using matrices and combining the results
...`·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º>
Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
223 East Steinfest Road
Antigo, WI 54409 USA
phone: 715-623-4190, ext. 3125
FAX: 715-623-6773
GLSC web site: http://www.glsc.usgs.gov
e-mail: jvadams@usgs.gov
[[alternative HTML version deleted]]
2016 Apr 23
1
subset by multiple letters condition
Thanks Jean, Does anyone know how to set these [hast1] and [hast2] as the colors of a plot?
On Friday, April 22, 2016 7:39 AM, "Adams, Jean" <jvadams at usgs.gov> wrote:
You can use the grepl() function to give you logicals for each criterion, then combine them as needed. For example:
# example version of Command
Command <- paste0("_localize_", c("PD","t2","t1_seq", "abc", "xyz&qu...
2013 Aug 26
1
plot categorical variable with percentage infomation
Dear All,
Suppose I have a categorical variable
a=as.factor(sample(1:3,10,replace=T))
plot(a) and hist(as.numeric(a),freq=F) would give the histogram of it.
But I do not know how to add the counts or percentage information for
plot.factor().
hist() can do it but as a numeric variable, the x-axis is not 3
categories in this case.
Thank you for any suggestion.
Best wishes,
Jie
2012 Dec 20
4
comparison of large data set
Hi, how are you?
I have the following truncated R code:
fileobs <- "MaxFloodDepth_Observed.txt"
file1 <- "MaxFloodDepth_1.txt"
file2 <- "MaxFloodDepth_2.txt"
...
file54 <- "MaxFloodDepth_54.txt"
observeddepth = as.matrix(read.ascii.grid(fileobs)$data)
observeddepth[observeddepth!=0]<-1
modeldepth1 =
2011 Aug 02
2
Data frame to matrix - revisited
Hi,
I've tried to look through all the previous related Threads/posts but can't find a solution to what's probably a simple question.
?
I have a data frame comprised of three columns e.g.:
?
ID1?ID2?Value
a?b?1
b?d?1
c?a?2
c?e?1
d?a?1
e?d?2
?
I'd like to convert the data to a matrix i.e.:
?
?a b c d e
a n/a 1 2 1 n/a
b 1 n/a n/a 1 n/a?
c 2 n/a n/a n/a 1
d 1 1 n/a n/a 2
e n/a n/a 1
2011 Aug 04
3
R loop problem
I have run into a speed issue, and given the size of the problem it feels
like there should be an easy solution. Here is the problem statement with
some arbitrary numbers added.
#p,q: vector with length(q)==length(p)==10000 and length(levels(p))==3000
#y,z: vectors with length(levels(y))=length(y)==length(z)==5000
for (i in levels(p)){
q[i==p]<-z[i==y]}
At first i used two for loops which
2010 Aug 05
2
colour of label points on a boxplot
Hi all,
I have 6 datasets(dataframes Assem_ContigsLen7 through all_ContigsLen12)
containing 3 columns (contig_id, contig_length, read_count).
Each dataset is composed of 3 types of contigs (assemblies of genomic
fragments), 1- all Bacterial fragments, 2 - all Viral fragments, 3 -
mixed fragments.
I identified the type of contig through a merge with another table with
just contig_id and
2013 Apr 03
4
Better way of writing R code
Dear R forum,
(Pl note this is not a finance problem)
I have two data.frames as
currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2012 Nov 08
1
Extract cell of many values from dataframe cells and sample from them.
...rection, would have different numbers of rows - different numbers of effectors. This may be easier to work on, but I've not worked with multidimensional arrays, I'm used to data in dataframes (usually from spreadsheets from experiments).
________________________________
From: Jean V Adams [jvadams@usgs.gov]
Sent: 08 November 2012 13:35
To: Benjamin Ward (ENV)
Cc: r-help@r-project.org
Subject: RE: [R] sample from list
Ben,
You have still not supplied reproducible code for me (and any other r-help reader) to run, which makes it very difficult to help you. I can run your first 5 lines of cod...
2017 Aug 11
1
EOF within quoted string
...st(lapply(data, function(x) !all(is.na(x))))]
munged <- munged[-1,]
munged$text <- apply( munged[ , c(3:ncol(munged)) ] , 1 , paste0 , collapse = " ")
munged <- munged[,c("V1","V2","text")]
print(head(munged$text))
Mohan
From: Adams, Jean [mailto:jvadams at usgs.gov]
Sent: Thursday, August 10, 2017 8:03 PM
To: Radhakrishnan, Mohan (Cognizant) <Mohan.Radhakrishnan at cognizant.com>
Cc: R help <r-help at r-project.org>
Subject: Re: [R] EOF within quoted string
You might want to try some of the suggestions mentioned in this post: https://...
2013 Jul 09
3
fitting log function: errors using nls and nlxb
Hi-
I am trying to fit a log function to my data, with the ultimate goal of
finding the second derivative of the function. However, I am stalled on
the first step of fitting a curve.
When I use the following code:
FG2.model<-(nls((CO2~log(a*Time)+b), start=setNames(coef(lm(CO2 ~
log(Time), data=FG2)), c("a", "b")),data=FG2))
I get the following error:
Error in
2011 Jun 15
0
specifying interactions in a gam model with "by"
...sion 1.7-6 on Windows
XP.
Thanks for your help.
Jean
`·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º>
Jean V. Adams
Statistician
U.S. Geological Survey
Great Lakes Science Center
223 East Steinfest Road
Antigo, WI 54409 USA
http://www.glsc.usgs.gov (GLSC web site)
jvadams@usgs.gov (E-mail)
[[alternative HTML version deleted]]
2011 Dec 13
2
Plotting a date variable after GAM
Dear All,
I am fitting a simple GAM model using the "gam" function in the "mgcv"
package. The only independent variable is a continuous variable
representing the time of the event (in year and month) coded so that
"0" represents January 1960, "1" represents February 1960, etc. Now
when I try to plot the results, my x-axis ranges from "-200" to
2012 Jul 20
0
[External] Re: Speeding up a loop
...24 hours right now.
>
> Optimizing a program is not my thing.
>
> Sent from my Verizon Wireless 4GLTE smartphone
It's not mine either.
Better to ask the group.
I'm ccing R-help on this message.
Jean
> ----- Reply message -----
> From: "Jean V Adams" <jvadams@usgs.gov>
> To: "Reith, William [USA]" <reith_william@bah.com>
> Cc: "r-help@r-project.org" <r-help@r-project.org>
> Subject: [External] Re: [R] Speeding up a loop
> Date: Fri, Jul 20, 2012 10:05 am
>
>
> I've had to do something simila...
2013 Jun 20
0
R-help Digest, Vol 124, Issue 21
...hat you should try nlmrt or minpack.lm.
I don't think you were at my talk in Jena May 23 -- might have been very
helpful to you.
JN
On 13-06-20 06:00 AM, r-help-request at r-project.org wrote:
> Message: 47
> Date: Wed, 19 Jun 2013 13:17:29 -0500
> From: "Adams, Jean"<jvadams at usgs.gov>
> To: pakoun<pkount at bgc-jena.mpg.de>
> Cc: R help<r-help at r-project.org>
> Subject: Re: [R] nls singular gradient ..as always..
> Message-ID:
> <CAN5YmCEF9Ut5J-Zqh6URYOn0bfH=M=cUGMgDmtzy9OwWkrw24A at mail.gmail.com>
> Content-Type: text/plai...
2017 Jun 02
0
subletting an array according to dimnames
Have you tried P2["20", "10", "0"] ?
Jean
On Thu, Jun 1, 2017 at 3:10 PM, li li <hannah.hlx at gmail.com> wrote:
> Hi all,
> I have a three dimensional array with the corresponding dimension names.
> I would like to subset the array according to the dimension names. For
> example,
> suppose I want to extract the values corresponding to A=20,