t;
> Cheers,
> Bert
>
>
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> H. Gilbert Welch
>
>
>
>
>> On S
R Users,
I have a data frame which I split using 2 factors using the split function:
split(datframe, list(f=factor1, f2=factor2));
I then used lapply to get some summary statistics grouped by factor1 and
factor2.
I now want to change the appearance of this output. I want to get a 2
dimensional
I used the by() function on a data.frame to get sums of the data grouped by 2
factors. The function worked however the output is in a class called 'by'. Not
familiar with this class. How can I turn the output into a nice table where
columns represent values of factor1, row represent values of fa
Just wrap the above in a function with whatever options you want to
> use. If you need the functions to return vectors (of the same length)
> then you can still use sapply, but use rowSums, colSums, or apply on
> the result instead of sum.
>
>> On Thu, Dec 19, 2013 at 12:05 PM,
Dear R Users
I have a list of functions. Each function in the list is a function of single
variable. I would like to create a function (of one variable) which represents
the sum of all the functions in the list. So, if the functions in my list are
f1(x),..,f5(x) then I would like a new functio
Dear R community,
My question is not a quick fix one but it would be helpful if you have any
advice for me.
I have a large data set of many locations in the US and all of these
locations are expressed in coordinates (longitudes and latitudes). I need a
tool which returns the state that each locat
Small typo in dataframe representation. It should have been the below
one. Apologies.
mylist
$first
[1] 4
$second
[1] 6
On Mon, Jul 2, 2012 at 7:02 AM, Onur Uncu wrote:
> Hi All
>
> I have a dataframe:
>
> myframe<-data.frame(ID=c("first","second"
Hi All
I have a dataframe:
myframe<-data.frame(ID=c("first","second"),x=c(1,2),y=c(3,4))
And I have a function myfun:
myfun<-function(x,y) x+y
I would like to write a function myfun2 that takes myframe and myfun
as parameters and returns a list as below:
mylist
$first
[1] 4
$second
[2] 6
Co
bedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
>
>
>
>
>
>
> Onur Uncu wrote:
>
>>Thank you. But isn't a data frame already a list? What is wrong with
>>adding a column to the existing
e a list. or create new class which is a list
>
> On Jun 16, 2012 8:52 AM, "Onur Uncu" wrote:
>>
>> Hello R Community,
>>
>> I have the following design question. I have a data set that looks
>> like this (shortened for the sake of example).
>&g
Hello R Community,
I have the following design question. I have a data set that looks
like this (shortened for the sake of example).
Gender Age
M 70
F 65
M 70
Each row represents a person with an age/gender combination. We could
put this data into a data frame.
N
tion to return vectors in order to do further
> computations, you'll access those vectors by varying the list index,
>
>
> testframe$newcolumn[[1]][[1]] # first list, it's only vector
> testframe$newcolumn[[2]][[1]] # second list, it's only vector
>
>
> Etc.
the following error:
Error in `$<-.data.frame`(`*tmp*`, "vecss", value = c(2, 3, 4, 3, 4, 5
: replacement has 3 rows, data has 2
Thanks for the help.
On Sun, Jun 10, 2012 at 12:02 PM, Duncan Murdoch
wrote:
> On 12-06-10 6:41 AM, Onur Uncu wrote:
>>
>> R-Help com
R-Help community,
I understand that data.frames can hold elements of type double, string
etc but NOT objects (such as a matrix etc). This is not convenient for
me in the following situation. I have a function that takes 2 inputs
and returns a vector:
testfun <- function (x,y) seq(x,y,1)
I have a
or recursive/state-dependent
> simulations.
>
> Best,
> Michael
>
> On Sat, Jun 9, 2012 at 9:12 AM, Onur Uncu wrote:
>> Apologees the novice question. Currently climbing up the learning curve of R.
>>
>> Suppose I have the following function and the data.frame:
&g
Apologees the novice question. Currently climbing up the learning curve of R.
Suppose I have the following function and the data.frame:
testfun<-function(x=1,y=2) x+y
testframe=data.frame(col1=c(1,2),col2=c(3,4))
When evaluating testfun, I want to use the default value for y (which
is 2) and fo
16 matches
Mail list logo