Displaying 20 results from an estimated 10000 matches similar to: "numerical or not?"
2010 Jan 09
3
string functions
Hi!
Does anybody know a string function that would calculate how many
characters two strings share? I.e. ("Hello World","Hello Peter") would
be 7.
Thanks.
Laetitia
2010 Jan 11
1
apply a function down each column
Hello World,
I have a function that makes pairwise comparisons between two strings. I would like to apply this function to my data (which consists of columns with different strings) in the way that it compares the first with the second entry, and then the third with the fourth, and then the fifth with the sixth, and so on down each column...
So (2x-1) and (2x) would be the different entries to be
2010 Mar 08
1
compare tables
Hi!
I need some help to finish my script.
I have two tables that I combine randomly to produce a third table.
This I do for hundreds of iterations. In the output file I get all the
simulated tables after each other. It looks like this (in this case 3
iterations):
output file:
[[1]]
[,1] [,2] [,3]
[1,] "GM030005" "WI920024" "CCCC"
[2,]
2010 Aug 20
3
if-else function
Hi R people!
I am looking for some suggestions writing an if-else function.
The idea is to characterize different plots containing counts of
variables (here parasites). If a plot has a count equal or higher than
4 for any parasite the function should return a 1 else a 0. Later I
can loop the function over all plots.
Here I have a little subset of my data:
VariablePAR Plot1
2010 Aug 28
2
extracting columns
Hi,
Can anybody show me how to extract all columns in my dataset that are
polymorphic? Or phrased in another way I would like to delete all
columns that have no more than one letter in it (that are monomorphic).
Thank you.
Laetitia
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: seqCol.txt
URL:
2010 May 19
1
sample and rearrange
Dear Wu Gong and Peter Ehlers,
thank you very much for your help debugging my script.
Now I have a general following up question:
Is there a straightforward way to rearrange the following dataset so
that all first letters of each column will be combined in one column,
all the second letters in a second column, all the third ones in a
third column and so on, resulting in 7 columns,
i.e. for
2005 Jun 04
2
glm with a distribution free family
Dear R users,
I am trying to fit a glm with a distribution free family, link = log and variance = constant*mu. I guess I have to use the quasi family but the choices of variance are restricted to constant or mu or mu^2..., I don't know the way to choose the variance that I need, i.e. constant*mu.
If you have any ideas or advice, please tell me.
Thanks,
Laetitia Mestdagh
Laetitia Mestdagh
2003 Apr 28
2
Algorithm did not converge
Help! Being a bit of a novice, please bear with me if this is a stupid
question!
I am trying to fit a saturated model to some count data that I have:
model<-glm(COUNT~SP*LOC*COL*TIME*TREAT,poisson)
but R keeps on crashing and coming up with (occasionally before crashing) an
error that states:
Algorithm did not converge in: (if(is.empty.model(mt)) glm.fit.null else
glm.fit)(x = X, y = Y,
2006 Feb 15
2
Setting intial path under windows to MyComputer in Interactive file browser
Hello everyone,
How can I specify in tcltk file browser the initial directory to
"MyComputer" in Windows where Drives and Partition are accessible?
And just a little question if anyone knows, is there a way to use the
function choose.files under windows to select a directory?
Thanks a lot for your help.
Laetitia.
2004 Feb 03
2
Prompt / Console problem
Hi,
I have R installed under a Mandrake linux system and I don't have shell
utilities any more under my R console such as completion when writing a
file path, back and forth in the history, bindkeys... Moreover when I
quit R by saving, no .Rhistory file is created while the .Rdata is. I
don't get how this work, I thought it was based on the user unix shell
but it does not seem.
Any
2006 Jan 24
9
Number of replications of a term
Hello,
Is there a simple and fast function that returns a vector of the number
of replications for each object of a vector ?
For example :
I have a vector of IDs :
ids <- c( "ID1", "ID2", "ID2", "ID3", "ID3","ID3", "ID5")
I want the function returns the following vector where each term is the
number of replicates for the
2008 Jul 29
1
Bug in sd() and var() in handling vectors of NA (R version 2.7.1)?
In the previous versions of R (2.6.1), when a vector of NA was given to the functions 'sd' or 'var' with parameter na.rm = TRUE, it used to return NA. Now (2.7.1) it returns an ERROR :
Example in 2.6.1:
> sd(c(NA, NA, NA, NA), na.rm = TRUE)
[1] NA
Example in 2.7.1:
> sd(c(NA, NA, NA, NA), na.rm = TRUE)
Error in var(x, na.rm = na.rm) : paires d'éléments
2005 May 31
1
GLM question
I am unfamiliar with R and I’m trying to do few statistical things like GLM and GAM with it. I hope my following questions will be clear enough:
My datas ( y(i,j ))are run off triangles for example :
J=1
J=2
J=3
I=1
1
2
3
I=2
4
5
I=3
6
My model is :
E[y(i,j)] =m(i,j)
Var[y(i,j)] =constant *m(i,j)
Log(m(i,j)) = eta (i,j)
eta (i,j) = c + alpha(i)
2013 Apr 23
1
Extract part of a numer
Hi,
May be this helps:
set.seed(25)
dat1<- data.frame(ID=c("1001#01","1001#02","1001#03","1002#01","1002#02"),val=rnorm(5),stringsAsFactors=FALSE)
?dat1$ID<-as.numeric(gsub("#.*","",dat1$ID))
?dat1
#??? ID??????? val
#1 1001 -0.2118336
#2 1001 -1.0415911
#3 1001 -1.1533076
#4 1002? 0.3215315
#5 1002 -1.5001299
A.K.
2003 Aug 29
3
R and pointer
Hi everyone,
I want to write a function that modify directly variables passed as
parameters (the equivalent in C language of *ptr/&ptr) so that I don't
have to return a list and to reaffect all my variables.
Is it possible to do so in R?
Thanks a lot.
Laetitia Marisa.
2004 Jul 27
1
Display on Windows console from script
Hello,
When I launch a script under windows it does not display sequentially
my cat calls or maybe the console is not refreshed at every line of my
script.
For instance with that code
cat("\n\n================== IMPORT DATA FROM FILE
===================\n\n")
fileschosen <- choose.files(caption="Select gpr files", filters =
matrix(c("genepix
2013 Aug 26
1
Loop for converting character columns to Numeric
Hi,
Suppose you created a dataframe like this:
set.seed(28)
?dat1<-as.data.frame(simplify2array(list(letters[1:5],sample(1:20,5,replace=TRUE),6:10)),stringsAsFactors=FALSE)
?str(dat1)
#'data.frame':??? 5 obs. of? 3 variables:
# $ V1: chr? "a" "b" "c" "d" ...
# $ V2: chr? "1" "2" "10" "18" ...
# $ V3: chr?
2011 Dec 26
4
Summary tables of large datasets including character and numerical variables
Hello !
I am attempting to switch from being a long time SAS user to R, and would
really appreciate a bit of help ! The first thing I do in getting a large
dataset (thousands of obervations and hundreds of variables) is to run a SAS
command PROC CONTENTS VARNUM command - this provides me a table with the
name of each variable, its type and length; then I run a PROC MEANS - for
numerical
2018 May 11
0
add one variable to a data frame
Sarah's solutions are good, and here's another, even more basic:
tmp1 <- unique(dat1$B)
tmp2 <- seq_along(tmp1)
dat1$C <- tmp2[ match( dat1$B, tmp1) ]
> dat1
N B C
1 1 29_log 1
2 2 29_log 1
3 3 29_log 1
4 4 27_cat 2
5 5 27_cat 2
6 6 1_log 3
7 7 1_log 3
8 8 1_log 3
9 9 1_log 3
10 10 1_log 3
11 11 3_cat 4
12 12 3_cat 4
As a single line
2010 Mar 30
2
Need help to split a given matrix is a "sequential" way
I need to split a given matrix in a sequential order. Let my matrix is :
> dat <- cbind(sample(c(100,200), 10, T), sample(c(50,100, 150, 180), 10,
> T), sample(seq(20, 200, by=20), 10, T)); dat
[,1] [,2] [,3]
[1,] 200 100 80
[2,] 100 180 80
[3,] 200 150 180
[4,] 200 50 140
[5,] 100 150 60
[6,] 100 50 60
[7,] 100 100 100
[8,] 200 150 100
[9,]