Displaying 20 results from an estimated 20 matches for "junk1".
Did you mean:
junk
2008 Jun 16
1
aggregate() function, strange behavior for augmented data
...ovide a reproducible code example since it only
seems to occur with this data. I've checked and re-checked the of both the
original and augmented data but nothing appears inconsistent. Any
suggestions much appreciated. See below for specifics.
Cheers,
David
# original data
> dim(junk1)
[1] 96 3
> junk1[1,]
Hour Drug Aldo
1 0 P 9
> junk1$Hour
[1] 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3
5 0 3
[39] 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0
3 5 0
[77] 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 0 3 5 ### Not coded...
2017 Jun 01
5
Reversing one dimension of an array, in a generalized case
...way to do the following, but haven't found it, I have never had a good understanding of any of the "apply" functions.
A simplified idea is I have an array, say:
junk(5, 10, 3)
where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do:
junk1 <- junk[, rev(seq_len(10), ]
but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the function can not assume the number of dimensions of the array nor which dim...
2010 Aug 10
4
Function to Define a Function
...lChooser <- function(type=c("one","two")) {
type <- match.arg(type)
switch(type,
one={ m <- function(x,N0,r) N0*exp(x*r) },
two={ m <- function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) },
)
m
}
## define time steps
t <- 0:10
## create a function -- junk1 -- that produces exponential growth
junk1 <- mdlChooser("one")
junk1
res1 <- junk1(t,500,0.2)
res1
## create a function -- junk2 -- that produces logistic growth
junk2 <- mdlChooser("two")
junk2
res2 <- junk2(t,500,0.2,1000)
res2
[[alternative HTML version delet...
2010 Jan 21
1
Retrieving an evaluated gradient value (UNCLASSIFIED)
Classification: UNCLASSIFIED
Caveats: NONE
Dear R users,
How can I retrieve an evaluated gradient value from "deriv" function
provided below? I want to retrieve b0 value. Appreciate your help.
Kyong
junk1<-deriv(~(1/b1)*k-b0/b1,"b0",c("k","b0","b1"),formal=T)
junk1(k=0,b0=-14.0236,b1=2.44031)
[1] 5.746647
attr(, "gradient"):
b0
[1,] -0.409784
Classification: UNCLASSIFIED
Caveats: NONE
[[alternative HTML version deleted]]
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
...'t found it, I have never had a good understanding of any of the "apply" functions.
>
> A simplified idea is I have an array, say:
>
> junk(5, 10, 3)
>
> where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do:
>
> junk1 <- junk[, rev(seq_len(10), ]
>
> but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the function can not assume the number of dimensions of the array nor...
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>>> junk1 <- junk[, rev(seq_len(10), ]
so that
junk[1,1,1 ] = junk1[1,10,1]
junk[1,2,1] = junk1[1,9,1]
etc.
The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all the coordinates are not always there, and sometime the lati...
2017 Jun 01
2
Reversing one dimension of an array, in a generalized case
...ad a good understanding of any of the "apply" functions.
>>
>> A simplified idea is I have an array, say:
>>
>> junk(5, 10, 3)
>>
>> where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do:
>>
>> junk1 <- junk[, rev(seq_len(10), ]
>>
>> but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the function can not assume the number of dimensions of the ar...
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
> On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote:
>
> Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>
>>>> junk1 <- junk[, rev(seq_len(10), ]
>
>
> so that
>
> junk[1,1,1 ] = junk1[1,10,1]
> junk[1,2,1] = junk1[1,9,1]
>
> etc.
>
> The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all the coord...
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
...'t found it, I have never had a good understanding of any of the "apply" functions.
>
> A simplified idea is I have an array, say:
>
> junk(5, 10, 3)
>
> where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do:
>
> junk1 <- junk[, rev(seq_len(10), ]
>
> but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the function can not assume the number of dimensions of the array nor...
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
...versing one dimension of an array, in a generalized case
On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote:
Thanks to all for responses/. ?There was a question of exactly what was wanted. ?It is the generalization of the obvious example I gave, ?
junk1 <- junk[, rev(seq_len(10), ]
so that
junk[1,1,1 ] = junk1[1,10,1]
junk[1,2,1] ?= junk1[1,9,1]
etc.
The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, ?but all the coordinates are not always there, and sometime the lati...
2017 Jun 01
1
Reversing one dimension of an array, in a generalized case
...generalized case
>
>
> On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote:
>
> Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>
>
> junk1 <- junk[, rev(seq_len(10), ]
>
>
> so that
>
> junk[1,1,1 ] = junk1[1,10,1]
> junk[1,2,1] = junk1[1,9,1]
>
> etc.
>
> The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all the coord...
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
...ad a good understanding of any of the "apply" functions.
>>
>> A simplified idea is I have an array, say:
>>
>> junk(5, 10, 3)
>>
>> where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do:
>>
>> junk1 <- junk[, rev(seq_len(10), ]
>>
>> but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the function can not assume the number of dimensions of the ar...
2005 Jul 27
2
Returning positions of a vector
Hi,
I'd like to return the rows of sampled values of a vector. Can't figure
out how to do it.
For example: I start with [3, 1, 7, 4, 10] that have position
[1,2,3,4,5]. I sample [10,1,4] and I want to return [5,2,4].
I'm sure there's a simple way to do that but haven't been able to figure
it out or locate it.
Thanks in advance...mj
[[alternative HTML version
2007 Jul 03
0
(no subject)
...ws downloads a file with that name and
with the correct size. A cmp on the two files says there are
differences, and using a hex editor confirms this. The file produces
a simple error when using "open.ncdf" and in fact the ncdump utility
produces:
rmendels% /sw/bin/ncdump -h junk1.nc
/sw/bin/ncdump: junk1.nc: Invalid argument
There is clearly something corrupted in the Wndows version, and yet
it works perfectly on my Mac. I have produced this error on two
different Windows machines with two different versions of R.
Any help appreciated
-Roy M.
*********************...
2013 Oct 14
0
how to prevent default argument values from being found
Here is a problem I ran across in RStudio, which uses masks a number of standard R functions with versions that do a bit more than the original does. The RStudio people have figured out a way to prevent default values of arguments from being found when an argument is missing from a call!
junk1 <- function(...) {
fun <- function(pkgs, lib = NULL)
{
list(missing=missing(lib),
lib=try(lib, silent = TRUE),
pkgs = pkgs)
}
hook <- function(FUN, pkgs, lib, ...)
{
FUN(pkgs, lib, ...)
}
hook(fun, ...)
}
When we run t...
2011 Jun 29
1
Possible new bug in 3.1.5 discovered
...olume mounted on a native client using version 3.1.5 results in a hang at the command line, which I can only break out of by killing my ssh session into the client. Upon logging back into the same client, I see a zombie process from the attempt to write:
21172 ? D 0:00 touch /pfs1/test/junk1
Anybody else run into this situation?
Client mount log (/var/log/glusterfs/pfs2.log) below:
[2011-06-29 10:28:07.860519] E [afr-self-heal-metadata.c:522:afr_sh_metadata_fix] 0-pfs-ro1-replicate-6: Unable to self-heal permissions/ownership of '/' (possible split-brain). Please fix the fil...
2011 Jan 01
3
Retrieving Factors with Levels Ordered
Hello (and Happy New Year),
When I create a factor with labels in the order I want, write the data as a text file, and then retrieve them, the factor levels are no longer in the proper order.
Here is what I do (I tried many variations):
# educ is a numeric vector with 1,001 observations.
# There is one NA
# Use educ to create a factor
feducord <- factor(educ, labels = c('Elem',
2006 Jan 27
3
paging agi
...idle sip phones
@sips = grep(/^\s+\d+\s.*/, `asterisk -rx "show hints"`);
# Now check each sip phone to see if it's in use and also
# against our exclude list. If it passes both, it's
# added to our array of calls to make
foreach $sipline (@sips) {
my ($junk0, $exten, $junk1, $chan, $state, $junk2) = split(/ +/,
$sipline,6);
unless (($state ne "State:Idle") || (grep(/$exten/i, @bypass))) {
push (@mypage, "$exten");
}
}
$page= join ("&SIP/", @mypage);
print "$page";{
# Open connection to AGI...
2011 Mar 09
4
Help with read.csv
Hello,
I have a file that looks like this:
Date,Hour,DA_DMD,DMD,DA_RTP,RTP,,
1/1/2006,1,3393.9,3412,76.65,105.04,,
1/1/2006,2,3173.3,3202,69.20,67.67,,
1/1/2006,3,3040.0,3051,69.20,77.67,,
1/1/2006,4,2998.2,2979,67.32,69.10,,
1/1/2006,5,3005.8,2958,65.20,68.34,,
where the ',' is the separator and I tried to read it into R, but...
> y <- read.csv("Data/Data_tmp.csv",
2009 Dec 24
2
Column naming issues using read.table
Hi, this is my first post so please be gentle.
I quite new to R and using it for my biology degree.
My problem is. Im trying to import data from a .csv file using the
read.table command. The .csv file header starts on row 2 but is contained in
column 1, i have 600 data files and for future ease would rather not edit
each file seperatly. The data starts on row three and I only need the first
381