Hello,
To the OP:
The dollar sign is a meta character, so it must be escaped, that is what
was wrong with your code. The right regular expression would be
grepl("\\$", x)
When a regular expression doesn't work, try reading the help page ?regex.
Another good source you can try is
https://reg
Try this:
result <- lapply(71:75, function(x){
# use 'paste0' to add the number to the file name
input <-
read.csv(paste0("C:/Awork/geneAssociation/removed8samples/neuhausen",
x,
"/seg.pr3.csv")
, head=TRUE
)
inpu
Your message came through all messed up because you did not tell your email
program to use plain text format. This at best delays a responds and at worst
prevents us from understanding your question as you intended.
1) The columns became factors when you created the data frame because you did
n
Hi Farnoosh,
Perhaps this will help:
drop_dollar<-function(x) return(as.numeric(as.character(gsub("\\$","",x
sapply(My.Data,drop_dollar)
Jim
On Thu, Apr 19, 2018 at 7:23 AM, Farnoosh Sheikhi via R-help
wrote:
> Hello,
> I have a data frame with 400 columns and wanted to filter character col
Hello,
I have a data frame with 400 columns and wanted to filter character columns
with "$" in it.For example: > x <- c("$5", "$89", "$10", "$34") > y <-
c(1:4)> My.Data <- data.frame (x,y)> My.Data x y1 $5 12 $89 23 $10 34 $34 4
I want to detect the columns with $ and remove the $ from t
HI All,
I found that other R users experienced the same problem when using sqldf
package. An expert provided solution, adding "method="raw" at the end as below,
one or more of the columns in my data.frame are of class "AsIs" ( I don't know
what it is) . When sqldf retrieves the result from SQL
Hi David and Jeff,
Both ways worked for my table. it helped me a lot (I was really struggling
on it to change the values and thinking to do manually). You are great.
Thank you
On Wed, Apr 18, 2018 at 11:13 AM, David L Carlson wrote:
> The simplest would be to convert precip to character and then
The simplest would be to convert precip to character and then back to a factor
if you really want it to be a factor. This will also remove the levels that no
longer exist.
str(dat)
# 'data.frame': 5 obs. of 3 variables:
# $ Sites : Factor w/ 5 levels "Site1","Site2",..: 1 2 3 4 5
# $ temp
I would recommend that you avoid converting (or letting R convert for you) your
textual data values into factors until you have finished doing this kind of
modification.
You can restore the column to character data type either re-reading it with the
stringsAsFactors=FALSE option to read.table/r
Hi R user,
Would you mind to help me on how I can change a value in a specific column
and row in a big table? but the column of the table is a factor (not
numeric).
Here is an example. I want to change dat[4:5,3]<-"20" but it generated NA>
do you have any suggestions for me?
dat<-structure(list(Si
Dear R users,
I need to merge two data frames based on both equal and unequal comparisons.
The "sqldf" package used to work well , but today, I cannot resolve the
following error by reinstallation of the sqldf package. Can anyone suggest a
different way to perform this kind of merge function
> On Apr 18, 2018, at 1:04 AM, Hannah Meredith wrote:
>
> Hello,
>
> I am solving a set of ODEs using deSolve and have run into a problem I
> would appreciate some advice on. One of the parameters (m) in the ODEs
> changes between two states when one of the variables (D) crosses a
> threshold (
Hi Gerrit!
Thank you so much! I mistakenly reversed the order of the variables of the
regression. Actually what I meant to write was: lm(BloodPressure ~ Age).
Best,
Anne
-Message d'origine-
De : Gerrit Eichner [mailto:gerrit.eich...@math.uni-giessen.de]
Envoyé : mercredi 18 avril 2018 16
To expand on Eik Vettorazzi's answer:
Don't use html emails. When the mailing list converts it to plain text, it
often re-wraps lines so that your code becomes jumbled.
First, you did not define coeff. You need to add
coeff <- coef(SimpleLinearReg1)
Second, you should use the formula you used
Hi Anne,
I would suggest to change the linear model to lm(BloodPressure~Age), as
this model makes more sense in biological means (you would assume that
age influences pressure, not vice versa) and also obeys the statistical
assumption of weak exogeneity, that age can be measured without error,
at l
Courses are good for people who are motivated to learn. It sounds like you need
to generate the motivation first. Why not develop 4 - 5 case study examples?
Kinds of analyses currently performed on Excel that would be easier to
replicate and repeat using simple R scripts so that you are showing
Hi, Anne,
assign Age and Bloodpressure in the correct order
to the axes in your call to plot as in:
plot(y = Age, x = BloodPressure)
abline(SimpleLinearReg1)
Hth -- Gerrit
-
Dr. Gerrit Eichner Mathematica
Not necessarily. The R-help archives are publicly accessible,
with a "sort by date" option. So if someone sets up a web=page
monitor which reports back when new messages appear there
(at the bpottom end), then their email addresses are readily
copied (subject to " at " --> "@".
Once they have the
I'm not sure how you are incorporating time period into your data structure.
Typically we are looking at plots or assemblages as the rows and taxa as the
columns. Time period adds a third dimension that could be added as blocks of
rows. For example, depending on the resolution of your data, one
Dear All,
Ages ago I posted to this mailing list asking for advice about to
evangelize the use of R in an international public
administration where the fact that R is free is not a decisive factor
(actually its being "freeware" may even be seen negatively). After a
long time, I think it is worthwh
Hello,
I am trying to graph a regression line using the followings:
Age <- c(39, 47, 45, 47, 65, 46, 67, 42, 67, 56, 64, 56, 59, 34, 42, 48, 45,
17, 20, 19, 36, 50, 39, 21, 44, 53, 63, 29, 25, 69)
BloodPressure <- c(144, 220, 138, 145, 162, 142, 170, 124, 158, 154, 162,
150, 140, 110, 128, 130, 1
I am having difficulty fitting a mgcv::gamm model that includes both a random
smooth term (i.e. 'fs' smooth) and autoregressive errors. Standard smooth
terms with a factor interaction using the 'by=' option work fine. Both on my
actual data and a toy example (below) I am getting the same error
Dear Jeff and Eric,
Okay and many thanks.
Best Regards,
Ashim
On Wed, Apr 18, 2018 at 4:56 PM, Jeff Newmiller
wrote:
> Look at
>
> which(x>100)
>
> This is a zero-length vector. The negative of nothing is nothing, not a
> list of all possible index values.
>
> Do you want
>
> x[ !( x > 100 ) ]
Look at
which(x>100)
This is a zero-length vector. The negative of nothing is nothing, not a list of
all possible index values.
Do you want
x[ !( x > 100 ) ]
?
On April 18, 2018 6:13:30 AM CDT, Ashim Kapoor wrote:
>Dear All,
>
>Here is a reprex:
>
>> x<- 1:100
>> x[-which(x>100)]
>integer(0
Here's a hint:
> y <- which(x>100)
> identical(y,y)
# TRUE
> identical(y,-y)
# TRUE
The '-' is misleading - it is absorbed into the empty y, leaving the
request x[y] to be x for an empty set of indices.
HTH,
Eric
On Wed, Apr 18, 2018 at 2:13 PM, Ashim Kapoor wrote:
> Dear All,
>
> Here is a
Dear All,
Here is a reprex:
> x<- 1:100
> x[-which(x>100)]
integer(0)
In words, I am finding out which indices correspond to values in x which
are greater than 100 ( there are no such items ) . Then I remove those
indices. I should get back the x that I started with since there are no
items in
Seems it must be the R-list. A horde of ‘solicitation’ emails began arriving
about 27 minutes after I posted about not seeing any! Had left work by that
time, so did not encounter them until now.
From: Mark Leeds [mailto:marklee...@gmail.com]
Sent: April 18, 2018 12:33 AM
To: Rui Barradas
Cc: Di
Hello,
I am solving a set of ODEs using deSolve and have run into a problem I
would appreciate some advice on. One of the parameters (m) in the ODEs
changes between two states when one of the variables (D) crosses a
threshold (D_T) for the first time in either direction. Additionally, when
the var
28 matches
Mail list logo