Displaying 20 results from an estimated 800 matches similar to: "Applying 'lm' in each group"
2009 Jan 09
3
Matrix: Problem with the code
Hi,
Can any one please explain why the following code doesn't work? Or can anyone suggest an alternative.
Suppose
x<-c(23,67,2,87,9,63,8,2,35,6,91,41,22,3)
mat<-0;
for(j in 1:length(x))
{
for(i in 1:p)
mat[i,j]<-x[j]^i;
}
Actually I want to have a matrix with p columns such that each column will have the
2017 Mar 19
2
outer not applying a constant function
Hi,
the function outer can not apply a constant function as in the last line of the following example:
> xg <- 1:4
> yg <- 1:4
> fxyg <- outer(xg, yg, function(x,y) x*y)
> fconstg <- outer(xg, yg, function(x,y) 1.0)
Error in outer(xg, yg, function(x, y) 1) :
dims [product 16] do not match the length of object [1]
Of course there are simpler ways to construct a constant
2017 Mar 20
1
outer not applying a constant function
> Or is this a bad idea?
I don't like the proposal. I have seen code like the following (in
fact, I have written such code, where I had forgotten a function was
not vectorized) where the error would have been discovered much later
if outer() didn't catch it.
> outer(1:3, 11:13, sum)
Error in outer(1:3, 11:13, sum) :
dims [product 9] do not match the length of object [1]
2009 Jan 15
2
Interface to open source Reporting tools
Hi,
I am a new user of R 2.8.1. I use Tinn-R for code editing. I use a windows
2003 system with 1 GB RAM.
I am interested to generate dashboard and reports based on data from MS
Access. These reports need to be posted on a weekly basis to the web. The
reporting interface should provide facilities for "what if" scenarios.
Is it possible to interface R analysis results to good open
2009 Jan 10
1
Setting a contingency table
Hi,
I want to set a make a contingency table which will look like this.. The problem is that I can't set the table like the following.
col1 col2 Total
row1 a b n10
rp1 rp2 100
cp1 cp2 rtp1
---------------------------------------------
row2
2009 Jan 25
1
Gibbs sampler...did it work?
I am writing a Gibbs sampler. I think it is outputting some of what I want,
in that I am getting vector of several thousand values (but not 10,000) in a
txt file at the end.
My question is, is the error message (see below) telling me that it can't
output 10,000 values (draws) because of a limitation in my memory, file
size, shape etc, or that there is an error in the sampler itself?
>
2003 Jul 14
2
Multipanel weighted regression lines.
Dear R-users,
I am trying to create a multipanel scatter plot which displays weighted
regression lines for each subgroup. I am having diffuculty figuring out
how the Trellis multipanel plotting functions work, in general. Does
someone know where there are some beginners examples on how to create
and use panel.xxx functions in conjunction with the xyplot functions?
Back to the matter at hand
2009 Jun 11
1
Integrate function in R
Hi!
Can anyone please let me know what numerical integration procedure does the integrate function in package stats follow?
Thank you in advance
Shant
[[alternative HTML version deleted]]
2017 Mar 20
0
outer not applying a constant function
>>>>> Gebhardt, Albrecht <Albrecht.Gebhardt at aau.at>
>>>>> on Sun, 19 Mar 2017 09:14:56 +0000 writes:
> Hi,
> the function outer can not apply a constant function as in the last line of the following example:
>> xg <- 1:4
>> yg <- 1:4
>> fxyg <- outer(xg, yg, function(x,y) x*y)
>> fconstg
2011 Jun 17
4
combining strings
Dear R People:
Suppose I have the following two character vectors:
xf
[1] "W" NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> xg
[1] NA "k" "h" NA "g" "r" "j" NA "v" "d" NA "v" NA "z" "r" "r" "i"
>
I want to end up with
"W"
2010 Feb 26
1
split function
Hi,
I am using split function and wonder how to add the factor to the splitted
results.
#Example
n <- 3; nn <- 10
g <- factor(round(n * stats::runif(n * nn))) #factor
x <- rnorm(n * nn) + sqrt(as.numeric(g)) #value
xg <- split(x, g)
xg
$`0`
[1] 0.82513702 -0.03911584 2.32955347 0.36745335 1.75572642 2.65461438
0.41675829
$`1`
[1] 0.8583493 2.4264804 -0.3622378
2018 May 22
3
Cannot delete folder
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 21 May 2018, Yves Goergen wrote:
>> May 21 10:36:14 mond2 dovecot: imap(yg@****.de): Debug: Namespace :
>> /var/mail/virtual/****.de/yg/.Test doesn't exist yet, using default
>> permissions
>> May 21 10:36:14 mond2 dovecot: imap(yg@****.de): Debug: Namespace : Using
>> permissions from
2018 May 20
3
Cannot delete folder
Assuming '8' = mail, i cannot see anything wrong here...
Can you turn on 'mail_debug=yes' and attempt folder deletion, and check logs after that?
Aki
> On 20 May 2018 at 16:19 Yves Goergen <nospam.list at unclassified.de> wrote:
>
>
> Here's the output of 'doveconf -n':
>
> # 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
> # Pigeonhole
2007 Jun 24
1
errors in compiling R-2.5.0 and R-2.4.0[sec=unclassified]
Dear all,
I have encountered errors in compiling R-2.5.0 and R-2.4.0 in a linux
machine (power-pc). I can successfully build it from the source code if
I do not use the '--enable-R-shlib' option while executing the
'./configure' command as mentioned in rpy documentation. Using the
`--enable-R-shlib' option the configure step is executed properly but
the `make' crashes
2007 Feb 19
2
Using OLE DB Connections from Wine
Hi,
I'm trying to use Enterprise Architect under wine. According to their documentation it runs on "Codeweavers Crossover" so I believe it should also run under wine (it's listed as basically working in the application DB http://appdb.winehq.org/appview.php?iVersionId=6018 ( http://appdb.winehq.org/appview.php?iVersionId=6018 ) ).
I'm trying to get an OLE connection to a
2006 Apr 13
1
Working directory
Hi,
I am a new user of "R", I am trying to read my data in.. "Cervixhc.dat" used
to be in a different directory, now it has been moved to "O:\E&s\APC cervix
FINAL (YG,MC,MD)\Manuscript\Data", but when I ran the following program (in
red) I got an error message "Error in setwd(dir) : cannot change working
directory", and "Error in file(file,
2018 May 21
2
Cannot delete folder
I guess you have had different version(s) or setting(s) in the past, and
you can probably fix this by setting perms to same as the new folders.
Aki
On 21.05.2018 11:46, Yves Goergen wrote:
> I couldn't find anything relevant between all the debug log lines. Is
> that in /var/log/mail.log?
>
> Here's the lines I think are related to creating and deleting the folder:
>
2001 Aug 31
3
mp3-wav-cd-audio "acoustically equivalent" to wav-cd-audio ?
A friend of mine made the following comment in a discussion I had with
him that on a website we adminster we should offer
a) WAV or maybe shorten files
b) Ogg as a decent reference lossy encoded version
He's been trying to convince me that we should offer MP3 (in lieu of
WAV) and possibly Ogg.
The audio files are primarily vocals
I am not a physics guy but his statements don't
2017 Aug 23
2
Scaling Matrix in qda() function in MASS package
Hello,
I am Souradeep Chattopadhyay and I am a graduate student at Iowa
State University Department of Statistics.
Can anyone please explain the mathematical formulation behind the scaling
matrix returned by the qda function in MASS package. I want to understand
how this scaling matrix is derived from the inputs given to the qda
function.
Example Code
The following example is using
2010 May 12
1
exact the variables used in tree construction
> fit.dimer <- rpart(as.factor(out) ~ ., method="class", data=p_df)
>
> fit.dimer$frame[, "var"]
[1] NE WC <leaf> TA <leaf> <leaf> WG WD WW WC
[11] <leaf> <leaf> <leaf> CT <leaf> FC <leaf> YG QT <leaf>
[21] <leaf> <leaf> NW DP DY <leaf> SK