Hi
I'd like to remove a leading "3" if my number is 7 digits long, if it is
only 6 I don't want to anything.
I think this should be possible with a 1-liner using sub() but I am not
sure how to define the number of characters following the leading one.
For example my vector:
a <- c(3593857,384723
Dear R-User!
This is a question to all of you that are familiar with the 'dismo'
package, in particular we are interested in the gbm.step() function to
create a boosted regression tree model in R. From the model output object we
can use the $cv.statistics to get information on the cross-validation
On Sat, Mar 21, 2015 at 3:41 PM, Prof Brian Ripley
wrote:
> On 21/03/2015 14:27, Johannes Radinger wrote:
>
>> Thanks for the fast response. The fitdistr() function works well for the
>> predefined density functions. However, what is the recommended approach
>> to optimiz
ion:
>
> library(MASS)
> ?fitdistr
>
> No optimization is needed to fit a normal distribution, though.
>
>
> On 21/03/2015 13:05, Johannes Radinger wrote:
>
>> Hi,
>>
>> I am looking for a way to fit data (vector of values) to a density
>> functi
Hi,
I am looking for a way to fit data (vector of values) to a density function
using an optimization (ordinary least squares or maximum likelihood fit).
For example if I have a vector of 100 values generated with rnorm:
rnorm(n=100,mean=500,sd=50)
How can I fit these data to a Gaussian density
Hi,
I'd like to arrange two wireframe plots (library "lattice") next to each
other using the grid.arrange function of the library "gridExtra". However
the two wireframe plots should be closer to each other and the outer 2D box
should be removed (to save space).
To remove the outer box for a single
Hi,
I'd like to match the beginning and the end of a string. E.g. I want to
extract all strings from a vector that beginn with "12" and end with
"Apples":
a <- "2 green Apples"
b <- "12 green Apples"
c <- "12 Apples and 2 green Bananas"
d <- "12 yellow Bananas"
fruitlist <- c(a,b,c,d)
# This is
Hi,
I am wondering if it is possible to set the path to the output file of the
function
BIOMOD_Modeling() from the 'Biomod2' package. I can see the option
SaveObj to state if the output should be save to the hard disk. When this is
enabled, all files are printed to the working directory. So is Bio
y the resulting dendrograms can
> have so called inversions (which are hard to interpret)."
>
> The cutree manual page:
>
> "Cutting trees at a given height is only possible for ultrametric trees
> (with monotone clustering heights)."
>
> Use a different method
ven height is only possible for ultrametric trees
> (with monotone clustering heights)."
>
> Use a different method (but not median).
>
> -
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77840-4352
>
> -Original
Hi,
I'd like to cut a hierachical cluster tree calculated with hclust at a
specific height.
However ever get following error message:
"Error in cutree(hc, h = 60) :
the 'height' component of 'tree' is not sorted (increasingly)"
Here is a working example to show that when specifing a height in
Hi,
I have data in a dataframe in following structure
var1 <- c("a","b","c","a","b","c","a","b","c")
var2 <- c("X","X","X","Y","Y","Y","Z","Z","Z")
var3 <- c(1,2,2,5,2,6,7,4,4)
df <- data.frame(var1,var2,var3)
Now I'd like to calculate relative values of var3. This values
should be relative to th
ion(x)pnorm(q=x,sd=sd1)*r+pnorm(q=x,sd=sd2)*(1-r)-X,c(-1e6,1e6))
>
>
> Cheers
>
> Am 12.12.2013 15:58, schrieb Johannes Radinger:
> > Thanks for the fast response. Of course I totally overlooked qnorm as I
> had
> > a more complex task in my head.
> >
> > I
gt; Feladó: r-help-boun...@r-project.org [r-help-boun...@r-project.org] ;
> meghatalmazó: Johannes Radinger [johannesradin...@gmail.com]
> Küldve: 2013. december 12. 14:56
> To: R help
> Tárgy: [R] Solving a normal distribution pnorm for q
>
> Hi,
>
>
>
> I found follwowin
Hi,
I found follwowing example of pnorm here:
http://www.r-tutor.com/elementary-statistics/probability-distributions/normal-distribution
Problem
Assume that the test scores of a college entrance exam fits a normal
distribution. Furthermore, the mean test score is 72, and the standard
deviat
n Tue, Nov 19, 2013 at 4:43 AM, Johannes Radinger <
> johannesradin...@gmail.com> wrote:
>
>> Hi,
>>
>> I'd like to plot a boxplot and use a scatter.smooth line plot as an
>> overlay
>> for this plot.
>> This works except for the problem that
Hi,
I'd like to plot a boxplot and use a scatter.smooth line plot as an overlay
for this plot.
This works except for the problem that the x-axis ticks for both plots are
differently spaced:
The boxplot ticks are closer and the space between the outer most boxplots
and the plot region (box) is larg
Hi,
I'd like to follow up an older discussion on adding significance stars to
boxplots.
(
http://r.789695.n4.nabble.com/indicating-significant-differences-in-boxplots-td862335.html
)
As suggested by Jim Lemon, there is following solution for a single boxplot:
boxplot(count ~ spray, data = InsectS
Hi,
I'd like to use Latin Hypercube Sampling (LHC) in the the context of
uncertainty / sensitivity analysis of a complex model with approximately 10
input variables. With the LHC approach I'd like to generate parameter
combinations for my model input variables.
Therefore I came across an simple ex
Hi,
I am trying to calculated various summary statistics using the dcast
function
of reshape2. This works perfectly for getting the mean, sum, length, sd. But
when I want to calculate the median I get an error. I tried it with and
without removing
NAs:
my_median <- function(x) median(x, na.rm =
Hi,
I'd like to get mean values for the margins of my casted data.frame.
For the casting I am using dcast() from reshape2. However, when I set
the margins parameter (margins=c("grand\_row")) I get following error
concerning
an unrecognized escape character '\_'. So what is the correct command
to
iverse to [0,1], so the fuzzy inference
> returns empty sets for those entries in your df with values larger than 1
> ...
>
> David
>
>
> On 2013-05-08 14:53, Johannes Radinger wrote:
>
>> This email has already been sent to the R-mailing list,
>> but maybe y
Hi,
I am trying to use the fuzzy_inference system on multiple input values.
Basically I combine two variables (depth, velocity) into the variable
suitability.
Both depth and velocity have 3 trapezoid classes (verylow,medium,high) each.
The consequent (suitability) has 4 fuzzy levels (none,low,medi
Following my last mail, I found a simple solution using eval(parse)):
df <-
data.frame(depth=c("low","medium","high"),velocity=c("medium","medium","low"),suitability=c("low","medium","low"))
df$rule <- paste("fuzzy_rule(depth %is% ",df[,"depth"]," && ","velocity
%is% ",df[,"velocity"],", ","suitab
Hi,
I just discovered the package "sets" and its ability to perform fuzzy
systems calculations.
The example in the manual of fuzzyinference() gives an overview how to
develop rules.
However my "rules" are already available as data.frame and I'd like to
convert them into the format
that is needed
x
> [1] "a1b1" "a2b2" "a1b2"
>> substr(x, 1, 2)
> [1] "a1" "a2" "a1"
>> substr(x, 3, 4)
> [1] "b1" "b2" "b2"
>
> HTH,
> Jorge.-
>
>
> On Wed, Mar 13, 2013 at 7:37 PM, Johann
Hi,
I have a vector of strings like:
c("a1b1","a2b2","a1b2") which I want to spilt into two parts like:
c("a1","a2","a2") and c("b1","b2,"b2"). So there is
always a first part with a+number and a second part with b+number.
Unfortunately there is no separator I could use to directly split
the vecto
Hi,
is there a way to color the branches or text label of the branches of
dendrograms e.g. from hclust() according to a grouping variable. Here
I have something in mind like:
http://www.sigmaaldrich.com/content/dam/sigma-aldrich/life-science/biowire/biowire-fall-2010/proteome-figure-1.Par.0001.Ima
Hi,
I am running an ANCOVA model like:
aov(Y ~ Var1 + Var2 + Var3 + Var4 + CoVar1 + CoVar2)
where Y is the response (metric, 1.0-1000.0), VarX are all
metric predictors, and CoVarX are two Covariates each a
factor of 4-5 levels.
So far as I can remember results of an ANCOVA for a Covariate
of i
Hi,
I would like to split dataframe based on one colum and want
to connect the two dataframes by rows (like rbind). Here a small example:
# The orgininal dataframe
df1 <- data.frame(col1 = c("A","A","B","B"),col2 = c(1:4), col3 = c(1:4))
# The datafame how it could look like
df2 <- data.frame(A.
.x=TRUE, all.y=TRUE)
>
>
> Contact the package maintainer for more info.
>
> maintainer('reshape')
> [1] "Hadley Wickham "
>
>
> Hope this helps,
>
> Rui Barradas
>
> Em 11-01-2013 10:08, Johannes Radinger escreveu:
>>
>> Hi,
>>
Hi,
I'd like to merge mutliple dataframes from a list of dataframes by some common
columns. The approach for simply merging 2 dataframes is working with:
merge(df1,df2,by=c("col1","col2","col3"),all=TRUE)
For mutliple dataframes in a list I try to use the merge_all command
from the package resha
Hi Ray,
thank you very much. That one-line approach is what I was looking for.
A very simple but very efficient way without loading any other packages.
/j
On Tue, Dec 18, 2012 at 11:17 AM, Ray Brownrigg
wrote:
> On 18/12/2012 10:56 p.m., Johannes Radinger wrote:
>>
>> Hi,
Hi,
I have a dataframe containing 3 columns:
data.frame(X=c(100,102,104,102,103),Y=c(12,14,14,13,16),Time=c(1,2,3,4,5))
where X and Y are coordinates and "Time" refers to an index of a timestep.
Now I would like to get the distance between the consecutive timesteps.
This should actually provide
A","Col
> B","Col D","Col E","Col C"))
>
> names(df)<-df_names$name[match(names(df),df_names$code)]
>
>
> A.K.
>
> - Original Message -
> From: Johannes Radinger
> To: r-help@r-project.org
> Cc:
> Sent: Tue
Hi,
I've got a dataframe having a code as column name.
Addtionally I have another dataframe with a two columns (and lots of
rows), the first
containing the code and the second some Text (real name).
Now I'd like to use the information (pairs of code and name) of the
second dataframe to rename all
Y=runif(n), Z=rchisq(n, df=3))
>
> apply(dat, 2, function(x) apply(dat, 2, function(y) f(x, y)))
>
> Hope this helps,
>
> Rui Barradas
> Em 28-09-2012 11:10, Johannes Radinger escreveu:
>>
>> Hi,
>>
>> I have a dataframe with multiple (appr. 20) columns co
Hi,
I have a dataframe with multiple (appr. 20) columns containing
vectors of different values (different distributions).
Now I'd like to create a crosstable
where I compare the distribution of each vector (df-column) with
each other. For the comparison I want to use the ks.test().
The result sho
Thank you,
this works perfectly...
best regards,
Johannes
On Thu, Sep 27, 2012 at 1:43 PM, Ista Zahn wrote:
> Hi Johannes,
>
> On Thu, Sep 27, 2012 at 7:25 AM, Johannes Radinger
> wrote:
>> Hi,
>>
>> I am using colsplit (package = reshape) to split all strings
&
Hi,
I am using colsplit (package = reshape) to split all strings
in a column according to the same patterns. Here
an example:
library(reshape2)
df1 <- data.frame(x=c("str1_name2", "str3_name5"))
df2 <- data.frame(df1, colsplit(df1$x, pattern = "_", names=c("str","name")))
This is nearly what I
Hi,
I used to use reshape and moved to reshape2 (R 2.15.1). Now I tried some of my
older scripts and was surprised that my cast function wasn't working like
before.
What I did/want to do:
1) Melt a dataframe based on a vector specifying column names as measure.vars.
Thats working so far:
dfm <-
ew packages are not available for
> it. Please do as the posting guide suggests and update to R 2.15.1 (or
> R-patched).
>
>
> On 25/07/2012 09:47, Johannes Radinger wrote:
> > Hi,
> >
> > I just recently changed my OS to Ubuntu 12.04 (32bit). Now I tried to
> insta
Hi,
I just recently changed my OS to Ubuntu 12.04 (32bit). Now I tried to install
some packages required by my old and working scripts. Unfortunately I fail when
trying to install the package "xslx". Maybe it is related to the 32bit version
of my R (its not possible to install a 64 bit version)
Hi,
I've kind of a tricky question, which I don't know how to solve yet:
I get multiple dataframes loaded (readRDS) in a loop function. Each loaded
dataframe contains two columns one with a var-name and one with a value. The
rownumber (order) is very important as it is a value of the rank (1:x
Hi Achim,
thank you for your good explanation and the solution to my
question...
cheers,
/j
Original-Nachricht
> Datum: Fri, 8 Jun 2012 09:30:42 +0200 (CEST)
> Von: Achim Zeileis
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] Sort 1-c
Hi,
I have a 1-column dataframe with rownames and I want to sort it
based on the single column. The typical procedure that is recommended
in diverse posts is to use order in the index. But that "destroys" my
dataframe structure. Probabaly it is a very simple solution. Here is a
short reproducable
Hi,
I have a dataframe with around 100 columns. Now I want
to redefine some of the columns as factors (using as.factor).
Luckily all the names of the columns I want to redefine start with
"crast". Thus I thought I can use grep() for that purpose...
...I found an example for redefining a single co
exept for column with name "B".
I have to think about this
/Johannes
Original-Nachricht
> Datum: Thu, 31 May 2012 09:20:27 -0500
> Von: J Toll
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] Remove columns from dataframe based on their
Hi,
I have a dataframe and want to remove columns from it
that are populated with a similar value (for the total
column) (the variation of that column is 0). Is there an
easier way than to calculate the statistics and then
remove them by hand?
A <- runif(100)
B <- rep(1,100)
C <- rep(2.42,100)
D
Original-Nachricht
> Datum: Thu, 31 May 2012 11:16:32 +
> Von: "ONKELINX, Thierry"
> An: Johannes Radinger , "R-help@r-project.org"
>
> Betreff: RE: [R] Transform counts into presence/absence
> Just use the logical operators.
Hi,
I am looking for a very easy way to transform
a column in a dataframe from counts (eg. c(1,0,21,2,0,0,234,2,0))
into a binary form to get presence/absence values
e.g. c(1,0,1,1,0,0,1,1,0). Is there a simple built-in function?
or do I have do to it with a replaceement funciton using IF x > 0
TH
Hi,
I would like to plot some extra text in my plot.
This should be a two line text including a special character (sigma).
I tried so far a to use expression in combination with paste and "\n"...
but I can't get the line break...
Here what I've done so far:
plot(1,type="n", xaxt='n', yaxt='n', a
Hi,
I am using ggplot2 and arrange differnet plots into
one viewport by dividing it into rows and columns:
pushViewport(viewport(layout = grid.layout(nrow=2,ncol=2,widths = unit(c(50,
50), "mm"),heights = unit(c(50, 50), "mm"
with following function I can extract the legend of a previously
Hi,
I am really confused how ddply work, so maybe you can help me.
I created a function that sorts a vector etc.
fn <- function(x){
x1 <- sort(x)
x2 <- seq(length(x))
x3 <- x2/max(x2)
df <- data.frame(x1,x2,x3)
df
}
Probably this is not the best form of t
Hi,
it is easiest to explain what I want to do by an example:
lets assume there are two factors/variables:
A <- c(1,2,3)
B <- c(1,3,3)
Now I would like to generate a list of strings that should look like
("A1_B1","A1_B2","A2_B1","A2_B2"). So actually the string
contains all possible combinations
Hi,
I have two variables ranging both from 0 to 1 (n=500 each).
Now I am interested in plotting them both in one plot (using ggplot2).
So far I used ecdf() (from an example I found with google) to get
values for the cumulatice distribution function which gives a relative
curve. I also want to do
Thank you Steve,
thats the thing I was looking for
/Johannes
Original-Nachricht
> Datum: Thu, 3 May 2012 08:20:51 -0400
> Von: "Steven Wolf"
> An: "\'David Winsemius\'" , "\'Johannes Radinger\'"
>
> CC:
Hi,
i want to plot empirical cumulative density functions for two variables in
one plot. For better visualizing the differences in the two cumulative curves
I'd like to log-scale the axis.
So far I found 3 possible functions to plot ecdf:
1) ecdf() from the package 'stats'. I don't know how to
Hi,
I am wondering if anybody has experience with
scatterplot matrices where some (but NOT all) axis
are transformed and the labels are nicely plotted.
So far I looked into
1) pairs()
2) scatterplotMatrix() from package 'car'
3) splom() from packagae 'lattice'
4) plotmatrix() from 'ggplot2'
I ca
Hi,
I try my first time to write a summary method for my function. The result of my
function is a list of two objects (2 arrays). In my summary both objects should
be displayed but with a some introductory text like:
ls <- list(A="A123",B="B123")
summaryout=function(x,...){
cat("This i
Hi,
I want to create a pdf of my Man-pages from my package.
Therefore I run in the terminal Rd2pdf on the package and
a pdf of all the pages is created.
After the titlepage there is the general package page, which includes
"Description" and "Details" etc. Unfortunately after the Subtitle "Details
Hello,
I already posted that on stackoverflow[1], but although it's crossposting,
I think this question can probably easier to be answered by other R-users on
this list, which maintain packages etc.
I would like to make a package out of a function. The function
is working in a script, but when I
Hi,
I am trying to do plot a scatterplot matrix using pairs() from
the package graphics. There are now a few things I'd like to improve
for a better understanding.
1) My scatterplot uses two log-scaled axis...as I
don't know how to set them in pairs() I calculated the log before but now
the label
Original-Nachricht
> Datum: Thu, 08 Mar 2012 09:51:01 -0500
> Von: Duncan Murdoch
> An: "R. Michael Weylandt"
> CC: Johannes Radinger , R-help@r-project.org
> Betreff: Re: [R] Save/Load function()-result to file in a loop
> On 08/03/2012 8:42 A
Hi,
I am looking for a way to save the result of a function, e.g the lm()-function
to a file and reload it afterwards again. I'd like to do that in order to
minimize the used memory when running the function in a loop. The actual
function I want to store is the evaluate() from the dismo package
Original-Nachricht
> Datum: Tue, 14 Feb 2012 10:18:33 -0500
> Von: Sarah Goslee
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] Wildcard for indexing?
> Hi,
>
> You should probably do a bit of reading about regular expressio
Hi,
Original-Nachricht
> Datum: Tue, 14 Feb 2012 09:59:39 -0500
> Von: "R. Michael Weylandt"
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] Wildcard for indexing?
> I think the grep()-family (regular expressions) will be
Hi,
I'd like to know if it is possible to use wildcards * for indexing...
E.g. I have a vector of strings. Now I'd like to select all elements
which start with A_*? I'd also need to combine that with logical operators:
"Select all elements of a vector that start with A (A*) OR that start with B
Am 08.02.2012 um 23:47 schrieb David Winsemius:
>
> On Feb 8, 2012, at 5:06 PM, Johannes Radinger wrote:
>
>>
>> Am 08.02.2012 um 22:19 schrieb David Winsemius:
>>
>>>
>>> On Feb 8, 2012, at 4:11 PM, Johannes Radinger wrote:
>>>
>
Am 08.02.2012 um 22:19 schrieb David Winsemius:
>
> On Feb 8, 2012, at 4:11 PM, Johannes Radinger wrote:
>
>> Hi,
>>
>> I want to split a dataframe based on a grouping variable (in one column).
>> The resulting new
>> dataframes should be stored
Hi,
I want to split a dataframe based on a grouping variable (in one column). The
resulting new
dataframes should be stored in a new variable. I tried to split the dataframe
using split() and
to store it using a FOR loop, but thats not working so far:
df <- data.frame(A=c("A1","A1","A2","A2"),B
s
used for the rownames. I'd like to have them as an own column and no row
names...
like for the list:
list <- list(A=1:4, B=1:6, C=1:9)
t(sapply(list, function(x) c(length(x), sum(x > 5), sum(x < 5
/Johannes
> HTH,
> Jorge.-
>
>
> On Wed, Feb 8, 2012 at 8:5
Hi,
I want to "melt" my list and get certain deskriptive factors (length of a
vector etc.) into a dataframe. Best to describe it with an example:
A <- seq(4)
B <- seq(6)
C <- seq(9)
ls <- list(A,B,C) # this is my list with vectors of different length
# thats the dataframe how it should look lik
Hi,
lapply(df, function (x) x[!is.na(x)])
thats is really great!
Thank you!
Original-Nachricht
> Datum: Wed, 08 Feb 2012 12:01:17 +0100
> Von: Dimitris Rizopoulos
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] remove NAs from list coll
Hi,
I am importing dataframe from an Excel file (xlsx package).
The columns contain acutally measurements for single species and
the column-length is of variable. As it is imported as a dataframe the
difference to the "longest" column is filled with NA.
To explain it with an example, my dataframe
hi,
Original-Nachricht
> Datum: Fri, 3 Feb 2012 09:04:19 -0500
> Von: Steve Lianoglou
> An: Johannes Radinger
> CC: Joshua Wiley , r-help@r-project.org
> Betreff: Re: [R] Assigning objects to variable and variable to list in a for
> loop
> Hi,
>
&g
n
#one variable.
Thank you very much,
best regards,
Johannes
Original-Nachricht
> Datum: Fri, 3 Feb 2012 02:22:30 -0800
> Von: Joshua Wiley
> An: Johannes Radinger
> CC: r-help@r-project.org
> Betreff: Re: [R] Assigning objects to variable and variable to list in a f
inside the loop
to assign values. But here it is about assigning ojects to variables and
coercing these to a list.
Any suggestions are mostly welcomme.
Thank you,
best regards,
Johannes Radinger
--
__
R-help@r-project.org mailing list
https://sta
>
> On 25.01.2012 13:42, Johannes Radinger wrote:
> >
> >>
> >> On 25.01.2012 12:45, Johannes Radinger wrote:
> >>> Hello,
> >>>
> >>> I am wondering about the X11() graphic device on Windows.
> >>> I try to plot a
>
> On 25.01.2012 12:45, Johannes Radinger wrote:
> > Hello,
> >
> > I am wondering about the X11() graphic device on Windows.
> > I try to plot a raster image but nothing gets displayed. I
> > found some pages where it is mentioned that x11() not
> >
Hello,
I am wondering about the X11() graphic device on Windows.
I try to plot a raster image but nothing gets displayed. I
found some pages where it is mentioned that x11() not
always supports raster rendering.
Is there any add on for x11, any update or any R-package
which solves that displaying
> An: Johannes Radinger
> CC: "r-help@r-project.org"
> Betreff: Re: [R] reshape dataframe to array (pivot table)
> Hi,
>
> I wouldn't know how to fill the data into the array form you want, but
> you can get the aggregated data with
>
> dfm <-
Hello,
I would like to reshape a dataframe into an array. This is kind a similar task
as Excel performs with a Pivot table. To illustrate it:
LOC <- factor(c(1,2,2,3,1,1))
SPEC1 <- c(0,0,23,0,12,11)
SPEC2 <- c(1,2,0,0,0,4)
df <- data.frame(LOC,SPEC1,SPEC2) # original dataframe
a <-
array(NA,d
("01","02","03","04")) {
x[i,paste("var3_",column,sep="")]<-
as.numeric(value)
} else print("Problem with category")
}
}
}
(paste("x$var3_",column,sep=""))[i]<-
as.numeric(value)
} else print("Problem with category")
}
}
}
I think there is a problme with (paste("x$var3_",column,sep=""))[i]
which is not recognized co
Hi,
thank you very much... %in% is the operator I was looking for.
cheers,
johannes
Original-Nachricht
> Datum: Fri, 20 Jan 2012 13:01:54 +0100
> Von: Rainer M Krug
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] test if text is
Hello,
this is a very simple question:
How can I find out if a word is part of a list of words
like:
a <- "word1"
b <- "word4"
vector <- c("word1","word2","word3")
I tried it with match(a,vector)
but this gives the position of the word.
I am not sure if and how that can be
done with a logical
on't know how this can be handled
best regards,
johannes
Original-Nachricht
> Datum: Thu, 19 Jan 2012 13:42:24 +0100 (MET)
> Von: Gerrit Eichner
> An: Johannes Radinger
> CC: R-help@r-project.org
> Betreff: Re: [R] Split values in vector
>
Hello,
I have a vector which looks like
x$ART
...
[35415] 0001-1;02-1;05-1;
[35417] 01-1; 01-1;02-1;
[35419] 01-1; 00
[35421] 01-1;04-1;05-1;
[35
Dear Jean,
Thank you, expand.grid was the function I needed.
/johannes
>
> See
> ?expand.grid
>
> For example,
> df <- expand.grid(L=L, AR=AR, SO=SO, T=T)
> df$y <- fun(df$L, df$AR, df$SO, df$T)
>
> Jean
>
>
> Johanne
Hello,
probably it is quite easy but I can get it: I have
mulitple numeric vectors and a function using
all of them to calculate a new value:
L <- c(200,400,600)
AR <- c(1.5)
SO <- c(1,3,5)
T <- c(30,365)
fun <- function(L,AR,SO,T){
exp(L*AR+sqrt(SO)*log(T))
}
How can I get an array or
Original-Nachricht
> Datum: Mon, 2 Jan 2012 14:29:07 +0100
> Von: Petr PIKAL
> An: "Johannes Radinger"
> CC: r-help@r-project.org
> Betreff: Re: [R] summary per group
> Hi
>
> >
> > Hello,
> >
> > I know that it
Hello,
I know that it'll be quite easy to do what I want but somehow I am lost as I am
new to R. I want to get summary results arranged by groups. In detail
I'd like get the number (levels) of Species per Family like for this dataset:
SPEC <- factor(c("a","a","b","b","c","c","c","d","e","e","e",
Am 10.12.2011 um 16:50 schrieb Uwe Ligges:
>
>
> On 09.12.2011 14:15, Johannes Radinger wrote:
>> Hi,
>>
>> I am trying to get write my first own package.
>> I followed the instructions in "Creating R Packages: A Tutorial"
>> and "Writing
Hi,
I am trying to get write my first own package.
I followed the instructions in "Creating R Packages: A Tutorial"
and "Writing R Extensions". So far everything works really
fine, the script works and even the man-pages don't show
any problems during the check process.
During "check" there is al
the function call not outside
the function or before etc.
/Johannes
Original-Nachricht
> Datum: Tue, 6 Dec 2011 07:57:44 -0500
> Von: "R. Michael Weylandt"
> An: r-help , Johannes Radinger
> Betreff: Re: [R] Argument validation within functions
> Use the ! (n
ric(a)) stop("a is not numeric")
if(0 > a && a > 1) stop("a must be a value between 0 and 1")
a
}
/Johannes
Original-Nachricht
> Datum: Tue, 6 Dec 2011 07:04:59 -0500
> Von: "R. Michael Weylandt"
> An: Joh
Hi,
I just started with writing functions in R and so some questions popped up.
I provide some values as argument to my function such as:
function(a,b,c){}
Now i want that the function first checks if the arguments are valid for the
function. E.g argument "a" has to be a number in the range 0-1
t; Datum: Thu, 24 Nov 2011 09:12:57 -0500
> Von: Gabor Grothendieck
> An: Johannes Radinger
> CC: r-help@r-project.org
> Betreff: Re: [R] dataframe indexing by number of cases per group
> On Thu, Nov 24, 2011 at 7:02 AM, Johannes Radinger
> wrote:
> > Hello,
> >
&g
Hello,
I'd like to add custom labels to my pair() plot. These
labels include math expression but they aren't correctly
displayed...
Further, I want that the boxes for the text.panel (diagonal)
have an other background color (grey80). Is that generally
possible? If yes how do I have to set it?
W
1 - 100 of 130 matches
Mail list logo