Dear Sir
I am using label_bquote() for labeling facet plots in ggplot(). I need to
write the expression a_[12], a_[13] etc for each plot. I am writing as
ggplot() + facet_grid(..., labeller=label_bquote(rows = a[1, 2:3])
The above exemplary code writes only a_[12] for each facet plot.
Could any
On 10/28/19 2:17 PM, varin sacha via R-help wrote:
Dear R-experts,
My reproducible example here below is not working because of an error message :
Erreur : vecteurs de mémoire épuisés (limite atteinte ?)
My code perfectly works when n=3000 or n=5000 but as soon as n=1 my code
does not wo
Dear R-experts,
My reproducible example here below is not working because of an error message :
Erreur : vecteurs de mémoire épuisés (limite atteinte ?)
My code perfectly works when n=3000 or n=5000 but as soon as n=1 my code
does not work anymore. By the way, my code takes a very long time
You are describing an awkward way of doing this (and your example is unreadable
because you are not following posting instructions for the list) ... but the
following contains the essence of what I think is needed: parse() and eval().
v <- character()
v[1] <- sprintf("%d ^ %s", 2, "duck")
v[2]
I believe it is possible, but R is not really a full-fledged symbolic algebra
system so it wouldn't be an intuitive tool to use and what would you do with it
once you had it? It is much more useful in R to do something like
f1 <- function( M, A, B, C ) {
M %*% c( A, B, C )
}
m <- matrix( c(
Is
there a way to multiply a matrix
times
a vector of symbols?
For
instance, could I do this:
1
0 0 a
01
0 times b
-1 2
1 c
which
should result in :
Have you read any R tutorials?? This is about as basic as it gets.
?rep
-- Bert
P.S. Due to vectorized operations, there is probably no need to do this anyway!
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On T
Hi, Thanoon!
I want to simulate a vector of constants values with dimention = 200x2 and
all values of this vector are 1.
You mean "I want to _construct_ a _matrix_ of dimension 200 x 2 with all
entries equal to 1", don't you?
Homework? Take a look at
?matrix
Hth -- Gerrit
Any help
If you mean you need a matrix of that size,
matrix(1, nrow=200, ncol=2)
On Thu, Oct 29, 2015 at 1:07 PM, thanoon younis
wrote:
> Dear Members,
>
> I want to simulate a vector of constants values with dimention = 200x2 and
> all values of this vector are 1.
>
> Any help please.
>
>
> Regards
>
_
Dear Members,
I want to simulate a vector of constants values with dimention = 200x2 and
all values of this vector are 1.
Any help please.
Regards
--
Thanoon Y. Thanoon
PhD Candidate
Department of Mathematical Sciences
Faculty of Science
University Technology Malaysia, UTM
E.Mail: thanoon.you
For the record, it seems that devEMF::emf() works fine on the Windows
Vista SP2 machine with R3.2.2 and Illustrator CS4: the text is
recognized as text and every point/line can be dissociated.
Ivan
--
Ivan Calandra, PhD
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade
Thanks Jean for the tip.
I'll try postscript() and devEMF::emf() and see if it works.
Still, it's very complicated to export vector graphics in R...
Ivan
--
Ivan Calandra, PhD
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26
Perhaps the discussion at this link will be helpful ...
http://stackoverflow.com/questions/9555889/producing-a-vector-graphics-image-i-e-metafile-in-r-suitable-for-printing-in
Jean
On Tue, Oct 6, 2015 at 9:42 AM, Ivan Calandra
wrote:
> Dear useRs,
>
> A colleague of mine is having a problem wit
Dear useRs,
A colleague of mine is having a problem with graphic devices. The goal
is to save into a vector graphic format that can be edited with
Illustrator CS4.
On my Mac (Snow Leopard), I use RSvgDevice::devSVG() and it works fine.
But on her Windows Vista computer, I cannot find an alter
And if we want to use the approach of William Dunlap for sequence.optimization
, then we can write:
rev( xr[ seq_len(sum(vec)) - rep.int(cumsum(c(0L, vec[-length(vec)])), vec)] -
rep.int( xr[ -1], vec))
Regards.
On 2015-09-22 23:43:10, Frank Schwidom wrote:
> Hi,
>
> xr <- rev( x)
> vec <- 1:
Hi,
xr <- rev( x)
vec <- 1:(length( x) - 1)
rev( xr[ sequence( vec)] - rep.int( xr[ -1], vec))
On 2015-09-21 14:17:40, Dan D wrote:
> I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x
> as:
>
> c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1])
>
> x is incre
Use ?mappy and ?rep.int
> x[unlist(mapply(":",2:4,4))] - x[rep.int(1:3,3:1)]
[1] 3 7 20 4 17 13
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Mon, Sep 21, 2015 at 2:17 PM, Dan D wrote:
> I
I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x
as:
c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1])
x is increasing with x[1] = 0.
The following works but is not the greatest:
junk<-outer(x, x, '-')
junk[junk>0]
e.g.,
given
x<-c(0, 3, 7, 20)
junk<-outer
On 20/07/2014, 5:46 PM, David Winsemius wrote:
>
> On Jul 20, 2014, at 6:30 AM, Duncan Murdoch wrote:
>
>> On 17/07/2014, 10:00 PM, Dario Strbenac wrote:
>>> The example in the question was not inside a user function.
>>
>> The explanations you were given were slightly inaccurate. The usual
>> r
On Jul 20, 2014, at 6:30 AM, Duncan Murdoch wrote:
> On 17/07/2014, 10:00 PM, Dario Strbenac wrote:
>> The example in the question was not inside a user function.
>
> The explanations you were given were slightly inaccurate. The usual
> rule is that results returned at the top level are printed
On 17/07/2014, 10:00 PM, Dario Strbenac wrote:
> The example in the question was not inside a user function.
The explanations you were given were slightly inaccurate. The usual
rule is that results returned at the top level are printed unless they
are marked as invisible. (There are a few cases
It's a plausible use-case. For example, in the example section of a help file.
if(require(aPackage))
{
# Do computations.
# Show beginning of first result vector.
# Show beginning of second result vector.
}
__
R-help@r-project.org mailing list
http
On 18/07/14 15:00, Dario Strbenac wrote:
The example in the question was not inside a user function.
Don't be silly.
cheers,
Rolf Turner
--
Rolf Turner
Technical Editor ANZJS
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listin
The example in the question was not inside a user function.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
Rolf et.al
I have not followed this thread closely and so have nothing to say
about whose or what explanation is correct.
However, the following statement is misleading, if not wrong:
---
foo <- function(){
x <- 17
x
y <- 42
y
}
If you type foo() you get
[1] 42
which i
On 18/07/14 11:32, David Winsemius wrote:
On Jul 17, 2014, at 9:27 AM, Rui Barradas wrote:
Hello,
Also, unlike what the op says, if statements are functions, explaining the
behavior he got.
I'm not sure that is correct. The help page says if() is a control-construct. I think the
function
On Jul 17, 2014, at 9:27 AM, Rui Barradas wrote:
> Hello,
>
> Also, unlike what the op says, if statements are functions, explaining the
> behavior he got.
I'm not sure that is correct. The help page says if() is a control-construct. I
think the function is actually "{"
> {rnorm(10); rpois(1
This question is related to FAQ 7.16, which you should look up.
In general, whenever you just type a variable or function directly at the
command line, R prints the result for you. Inside code blocks of any kind,
it does not do that, so you need to use the print function yourself.
On Thu, 17
Hello,
Also, unlike what the op says, if statements are functions, explaining
the behavior he got.
Hope this helps,
Rui Barradas
Em 17-07-2014 16:53, Sarah Goslee escreveu:
Hi,
You can get the behaviour you want using the print() command:
if(1 < 2)
{
x<-rnorm(100)
y <- rpois(10, 5)
Hi,
You can get the behaviour you want using the print() command:
if(1 < 2)
{
x<-rnorm(100)
y <- rpois(10, 5)
print(head(x))
print(head(y))
}
Sarah
On Thu, Jul 17, 2014 at 2:00 AM, Dario Strbenac
wrote:
> Hello,
>
> I have a block of code that has two head calls at the end, but only t
Hello,
I have a block of code that has two head calls at the end, but only the second
is shown on screen. If I manually execute the statement which is not showing,
it works. I thought that if statements are not functions. It is behaving as one.
> if(1 < 2)
+ {
+ x<-rnorm(100)
+ y <- rpois(1
Hi there,
Is there a function in R that can draw vector density plot? The vector
density plot example can be found here:
http://reference.wolfram.com/mathematica/ref/VectorDensityPlot.html
As for the vector field plot, I found a function that has been posted in
this mailing list:
https://sta
Hi,
I have two integers a and b (with a
What did you try?Further, without knowing what your function f(x) is, we
can't tell you whether it accepts vector inputs.
--
View this message in context:
http://r.789695.n4.nabble.com/vector-where-elements-are-functions-evaluated-at-integers-bu
Hi,
It is not clear whether you read the file correctly or not. Please check
str(tbl_all)
The code you showed should work if the file was read correctly.
For example:
set.seed(468)
tbl_all<-
as.data.frame(matrix(sample(1:10,10*22,replace=TRUE),ncol=22,dimnames=list(NULL,c("A","V",LETTERS[3
Hi,
I prefer to build my packages on Linux!
I changed the object trPaths as below,
After R CMD build TinnRcom on Linux and did the installation
on Windows from the source code: It worked very well!
I thank all who contributed to the solution and apologize for my lack
of knowledge in this area.
On 24/09/2013 03:51, Jose Claudio Faria wrote:
I think I found the main problem!
I am developing the package under Linux and after R CMD build,
manually compressing the folder TinnRcom inside of the folder
TinnRcom.RCheck and installing in Windows.
And how on earth did you expect the helpers h
Hi JCFaria,
You package is supposed to be used only under Windows, right? Then, use:
OS_type=windows
in the DESCRIPTION file… and, of course, use R CMD check/R CMD build/ R CMD
INSTALL under Windows only.
Best,
Philippe
On 23 Sep 2013, at 20:55, Jose Claudio Faria
wrote:
> I have been deve
I think I found the main problem!
I am developing the package under Linux and after R CMD build,
manually compressing the folder TinnRcom inside of the folder
TinnRcom.RCheck and installing in Windows.
As the APPDATA environment variable does not exist in Linux, the
function Sys.getenv ("APPDATA"
I appreciate your attention Gabor.
However, the result was the same. :(
Both only work when the trPath object is sent to a R session already running.
When inside the package the result was the same.
> remove.packages('TinnRcom')
> Install.packages('TinnRcom_1.0-09.zip', repos=NULL) # New versio
I have been developing a new package (TinnRcom) to avoid the necessity
of any script
(as below) in the Rprofile.site file related to the use of Tinn-R Editor and R:
#===
# Tinn-R: necessary packages and functions
# Tinn-R: >= 2.4.1.1 with
On Mon, Sep 23, 2013 at 2:55 PM, Jose Claudio Faria
wrote:
> trPaths <- paste(paste(Sys.getenv('APPDATA'),
>'\\Tinn-R\\tmp\\',
>sep=''),
> c('',
>'search.txt',
>'objects.txt',
>
to:r-help-boun...@r-project.org] On
> Behalf
> Of arun
> Sent: Monday, June 17, 2013 11:58 AM
> To: Andras Farkas
> Cc: R help
> Subject: Re: [R] vector question
>
> HI Andras,
> Sorry, I misunderstood your question:
>
> Try this:
> sapply(sapply(b,function(x) d
HI Andras,
Sorry, I misunderstood your question:
Try this:
sapply(sapply(b,function(x) d[x
To: arun
Cc:
Sent: Monday, June 17, 2013 2:48 PM
Subject: Re: [R] vector question
Arun,
thank you. Looking at it I am wondering if there is a way to get 36 in the
result instead of the 24. The 2nd
May be this helps:
d[cumsum(sapply(d,function(x) any(x>b)))>=1]
#[1] 12 24 36
A.K.
- Original Message -
From: Andras Farkas
To: r-help@r-project.org
Cc:
Sent: Monday, June 17, 2013 2:29 PM
Subject: [R] vector question
Dear All,
would you please help with the following:
let us
Dear All,
would you please help with the following:
let us say I have:
a <-c(0,1,12,13,24,25,36,37)
b <-c(6,24.6,27)
#then I extract every 2nd element from "a"
d <-a[seq(1, length(a), 2)]
and what I need help with is to extract the 1st value from d that is greater
than the values in b, so as a
HI,
Not sure if this is what you wanted.
mat1<- matrix(c(1, 1, -1, -1, 1, -1, -1, -2, 1, 1, 1, 1), byrow=TRUE, nc=4)
fun1<- function(mat){
matP<- mat
matN<- mat
matP[matP<0]<- NA
matN[matN>0]<- NA
resP<-rowSums(matP,na.rm=TRUE)/ncol(matP)
resN<- rowSums(matN,na.rm=TRU
gt;
> 1 1 -1 -1 -> rowMeans([1:3 , 2]) just positive -> 1
> 1 -1 -1 -2
> 1/2 here not 0 because we dont use the -1
> 1 1 1 1
> 1
>
>
> thanks for helping
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nab
m(just negative values)/n. i
need both for my regression but dont know how to do it.
for example we have the matrix
1 1 -1 -1 -> rowMeans([1:3 , 2]) just positive -> 1
1 -1 -1 -2
1/2 here not 0 because we dont use the -1
1 1 1 1
1
thanks for helping
--
View this message in con
http://r.789695.n4.nabble.com/R-vector-tp4669233.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-g
On 08.05.2013 13:38, Ramon Hofer wrote:
Thanks for your answer Uwe
On Fri, 03 May 2013 23:36:24 +0200
Uwe Ligges wrote:
On 02.05.2013 14:37, Ramon Hofer wrote:
I'm trying to analyse the network speed and used iperf to create a
csv file containing the link test data. It's only about 6 MB
Thanks for your answer Uwe
On Fri, 03 May 2013 23:36:24 +0200
Uwe Ligges wrote:
> On 02.05.2013 14:37, Ramon Hofer wrote:
> >
> > I'm trying to analyse the network speed and used iperf to create a
> > csv file containing the link test data. It's only about 6 MB big but
> > contains about 40'00
On 02.05.2013 14:37, Ramon Hofer wrote:
Hi all
I'm trying to analyse the network speed and used iperf to create a csv
file containing the link test data. It's only about 6 MB big but
contains about 40'000 samples.
I can do boxplots (apart from printing the number of samples but I ask
separate
Hi all
I'm trying to analyse the network speed and used iperf to create a csv
file containing the link test data. It's only about 6 MB big but
contains about 40'000 samples.
I can do boxplots (apart from printing the number of samples but I ask
separately for that).
To find the behaviour over ti
On Apr 22, 2013, at 6:28 PM, Marc Schwartz wrote:
> On Apr 22, 2013, at 6:21 PM, Ayyappa wrote:
>
>> Dear group,
>>
>> I want to generate a vector of 10 elements that always has 20% zeroes, but
>> with a random ordering of zeroes and ones. Can you please suggest a function
>> to do that in
On Apr 22, 2013, at 6:21 PM, Ayyappa wrote:
> Dear group,
>
> I want to generate a vector of 10 elements that always has 20% zeroes, but
> with a random ordering of zeroes and ones. Can you please suggest a function
> to do that in R? I tried 'sample' function but the 20% zeros was not always
On Mon, Apr 22, 2013 at 7:21 PM, Ayyappa wrote:
> Dear group,
>
> I want to generate a vector of 10 elements that always has 20% zeroes, but
> with a random ordering of zeroes and ones. Can you please suggest a function
> to do that in R? I tried 'sample' function but the 20% zeros was not alway
Dear group,
I want to generate a vector of 10 elements that always has 20% zeroes, but with
a random ordering of zeroes and ones. Can you please suggest a function to do
that in R? I tried 'sample' function but the 20% zeros was not always
guaranteed.
Thanks for your help.
Regards,
Ayyappa
On Mar 21, 2013, at 4:40 PM, Waichler, Scott R wrote:
> I have a 3D field of a scalar variable (x, y, z, value). Is there a way to
> generate a vector field from this data--gradient at defined points? I found
> the rasterVis package for 2D data, but as yet nothing for 3D data.
Can't you just
I have a 3D field of a scalar variable (x, y, z, value). Is there a way to
generate a vector field from this data--gradient at defined points? I found
the rasterVis package for 2D data, but as yet nothing for 3D data.
Thanks,
Scott Waichler
Pacific Northwest National Laboratory
Richland, WA
sc
On 12-10-23 5:39 AM, Rui Barradas wrote:
Hello,
Try the following.
y=c(2,3,5,2,4,6,8,3,6,2,5)
first <- function(x) min(which(x))
prefix <- function(x, v) x[seq_len(v)]
suffix <- function(x, v) x[-seq_len(v)]
first(y > 4)
prefix(y, first(y > 4))
suffix(y, first(y > 4))
Be careful with this:
Hello,
Try the following.
y=c(2,3,5,2,4,6,8,3,6,2,5)
first <- function(x) min(which(x))
prefix <- function(x, v) x[seq_len(v)]
suffix <- function(x, v) x[-seq_len(v)]
first(y > 4)
prefix(y, first(y > 4))
suffix(y, first(y > 4))
Hope this helps,
Rui Barradas
Em 23-10-2012 10:21, Al Ehan escr
Hi,
Is it what you're looking for?
which(y>4) ##all indexes for y>4
[1] 3 6 7 9 11
which(y>4)[1] ##the first index
[1] 3
HTH,
Ivan
--
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
+33(0)3.80.39.63.06
ivan.calan...@u-bourgogn
Hi,
I got a small problem on how to define the vector index without manually
inspect the vector.
example:
y=c(2,3,5,2,4,6,8,3,6,2,5) #I have ten set of this kind of vectors (with
different values but same length) that I would also like to run the routine
below
#say;
v=the first index in y where
Thank you all for helping me out.
As Michael points out, I abused the rounding and formatting of print()
while debugging.
The default number of digits to print is 7 according to ?print.default,
which makes floating point numbers to be somewhat plausible for index vector
subsetting at first glance:
On Sat, Oct 6, 2012 at 3:23 PM, Bert Gunter wrote:
> But the OP should not be doing this **at all.** He apparently has not
> bothered to read the Intro to R tutorial as he appears not to know
> about vectorized calculations.
>
> -- Bert
>
I don't really think that's relevant or constructive here.
But the OP should not be doing this **at all.** He apparently has not
bothered to read the Intro to R tutorial as he appears not to know
about vectorized calculations.
-- Bert
On Sat, Oct 6, 2012 at 3:29 AM, R. Michael Weylandt
wrote:
> Forgot to cc the list.
>
> RMW
>
> On Sat, Oct 6, 2012 at 1
Hello,
This seems to be a case for FAQ 7.31 Why doesn't R think these numbers
are equal?
See this example:
3/5 - 1/5 - 2/5 # not zero
3/5 - (1/5 + 2/5) # not zero, different from above
In your case, try
for(idx in breaks){
print(idx / interval, digits = 16) # see problem indices
Forgot to cc the list.
RMW
On Sat, Oct 6, 2012 at 11:29 AM, R. Michael Weylandt
wrote:
> A case study of a good question! Would that all posters did such a good job.
>
>
>
> On Sat, Oct 6, 2012 at 7:14 AM, 周果 wrote:
>> Hi there,
>> Here is a minimum working example:
>> -
On 06-10-2012, at 08:14, 周果 wrote:
> Hi there,
> Here is a minimum working example:
>
> lower = 0
> upper = 1
> n_bins = 50
> interval = (upper - lower) / n_bins
> bins = vector(mode="numeric", length=n_bins)
> breaks = seq(from=lo
Hi there,
Here is a minimum working example:
lower = 0
upper = 1
n_bins = 50
interval = (upper - lower) / n_bins
bins = vector(mode="numeric", length=n_bins)
breaks = seq(from=lower + interval, to=upper, by=interval)
for(idx in brea
On Aug 10, 2012, at 07:30 , Sean Ruddy wrote:
> Thanks for the help all! Good to know that there's an answer. Unfortunately,
> I don't have the rights to install programs so I wasn't able to try devel and
> I've never heard of R patched but I'm guessing I can't install that either.
> I'll see
Thanks for the help all! Good to know that there's an answer. Unfortunately, I
don't have the rights to install programs so I wasn't able to try devel and
I've never heard of R patched but I'm guessing I can't install that either.
I'll see if I can get someone to do that.
Much appreciated!
Sea
As the posting guide asked you to before posting, try R-patched. That
has the NEWS items
• duplicated(), unique() and similar now support vectors of
lengths above 2^29 on 64-bit platforms.
• unique() and similar would infinite-loop if called on a vector of
length > 2^29 (bu
On Aug 9, 2012, at 7:29 PM, Sean Ruddy wrote:
> Hi,
>
> First, thanks in advance. Some useful info:
>
>> version
> platform x86_64-unknown-linux-gnu
> arch x86_64
> os linux-gnu
> system x86_64, linux-gnu
> version.string R version 2.15.1 (2012-06-22)
>
>
On Aug 9, 2012, at 5:29 PM, Sean Ruddy wrote:
Hi,
First, thanks in advance. Some useful info:
version
platform x86_64-unknown-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
version.string R version 2.15.1 (2012-06-22)
I'm trying to use the t
Hi,
First, thanks in advance. Some useful info:
>version
platform x86_64-unknown-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
version.string R version 2.15.1 (2012-06-22)
I'm trying to use the table() function on a 2 column matrix that has 711
m
Hi Thomas,
This is non trivial to do, but if you will be working with this sort
of data and are inclined to do some programming, you might consider
creating a new class. S4 classes and methods are quite flexible, and
you can allow them to lean on or inherit from existing classes such as
matrices.
To second Bert Gunter: you may get better answers if you give us a complete
description.
On Thu, Jul 5, 2012 at 12:37 PM, Thomas C. wrote:
> i have number of triangles which i'd like to store in a list,
> matrix,...etc.
> i thought it could look sth. like that:
>
> trianglenode1
You have failed to provide a complete, coherent description of what you
wish to do. In the absence of such a description, all suggestions are just
guesses. You need to think carefully about what information you want to
associate with each triangle and the appropriate data structure to use to
do thi
$ a: int 1 2 3 4 5 6 7 8 1 2 ...
$ b: int NA NA 5 6 7 NA NA NA NA NA ...
$ c: int NA 1 2 3 4 NA NA NA NA NA ...
z2<-as.matrix(z)
A.K.
- Original Message -
From: Thomas C.
To: r-help@r-project.org
Cc:
Sent: Thursday, July 5, 2012 9:19 AM
Subject: [R] vector entry in matix
hi,
i
well thank you, i think we get closer to my problem. but i meant it in a
different way. maybe i describe what i intended to do:
i have number of triangles which i'd like to store in a list, matrix,...etc.
i thought it could look sth. like that:
trianglenode1node2no
On Jul 5, 2012, at 11:22 AM, R. Michael Weylandt wrote:
It is possible to put dimensionality on a list (i.e., a generic
vector), which might be what you're looking for.
x <- list(1:4, letters[1:4], function(x,y) x + y, rnorm(50))
dim(x) <- c(2,2)
x[[1,2]]
x[[2,2]]
x[[3,2]] # Error
That co
It is possible to put dimensionality on a list (i.e., a generic
vector), which might be what you're looking for.
x <- list(1:4, letters[1:4], function(x,y) x + y, rnorm(50))
dim(x) <- c(2,2)
x[[1,2]]
x[[2,2]]
x[[3,2]] # Error
Best,
Michael
On Thu, Jul 5, 2012 at 8:19 AM, Thomas C. wrote:
> h
hi,
i'm trying to figure out if there's any possibility to write a whole vector
into a matrix or data.frame or something like that. i don't mean
transormation. Here an example:
[,1] [,2]
[1,] "a" "d"
[2,] "b" "e"
[3,] "c" "f"
where e.g. a is a<-c(0,1) vector of length 2, b a vector of
On 15.05.2012 23:47, rl269 wrote:
Hello,
I am having trouble asking R to read individual numeric vectors for a box
plot of the residuals of a linear regression. It is performing arithmetic
addition on the 16 individual variables that I want individual box plots
for.
I have 16 race*treatment
Hello,
I am having trouble asking R to read individual numeric vectors for a box
plot of the residuals of a linear regression. It is performing arithmetic
addition on the 16 individual variables that I want individual box plots
for.
I have 16 race*treatment variables that were created from clea
You're thinking about it wrong. This is an arithmetic sequence:
seq(from = 1000, by = -30, length.out = 15)
Michael
On Fri, Apr 20, 2012 at 5:14 AM, uday wrote:
> I would like to calculate vector from existing value
> e.g
> v <- 1000
> s <- 30
> d1 <- v-s
> d
I would like to calculate vector from existing value
e.g
v <- 1000
s <- 30
d1<- v-s
d1<- 970
d2<- d1 -s
d2<- 940
d 3 <- d2-s
d3<- 910
:
:
d15 <- .
so how I should get vector of length 15
Hi Petr,
Thank you so much for your help.
You're right, the issue was that I needed to center my predictors by adding
the code 'na.rm=T':
verbal.ability_C <- verbal.ability - mean(verbal.ability, na.rm=T)
That removed the NA values from being included in my centering and allowed
me to run the r
Hi
>
> Here is my code:
>
>
> ##Centering predictors###
> verbal.ability_C <- verbal.ability - mean(verbal.ability)
> children_C <- children - mean(children)
> age_C <- age - mean(age)
> education_C <- education - mean(education)
> work.from.home.frequency_C <- work.from.home.frequency
Here is my code:
##Centering predictors###
verbal.ability_C <- verbal.ability - mean(verbal.ability)
children_C <- children - mean(children)
age_C <- age - mean(age)
education_C <- education - mean(education)
work.from.home.frequency_C <- work.from.home.frequency -
mean(work.from.home.fre
Hi
>
> Hi Petr!
>
> Thank you for responding to my post.
>
> I checked out all my variables in the way you suggested and they are all
in
> integer form, but here are many missing values in some of my vectors,
> denoted with NA.
>
> So, they are in the correct form, I am just wondering if there
Hi Petr!
Thank you for responding to my post.
I checked out all my variables in the way you suggested and they are all in
integer form, but here are many missing values in some of my vectors,
denoted with NA.
So, they are in the correct form, I am just wondering if there is something
else I need
Hi
>
> Hi,
>
> I am trying to run two Non-Gaussian regressions: logistic and probit. I
am
> receiving two different errors when I try to run these regressions and I
am
> not sure what they mean or how to fix my syntax.
>
> Here is the logistic regression error:
>
> Error in family$linkfun(mu
Hi,
I am trying to run two Non-Gaussian regressions: logistic and probit. I am
receiving two different errors when I try to run these regressions and I am
not sure what they mean or how to fix my syntax.
Here is the logistic regression error:
Error in family$linkfun(mustart) :
Argument mu mus
Great Dimitris. It helps indeed! Thanks a lot!
--
View this message in context:
http://r.789695.n4.nabble.com/Vector-manipulation-tp4381586p4381614.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
Hi mentor_,
Try
c(sapply(vec[-1], function(x) c(vec[1], x)))
# [1] 2 4 2 6 2 9 2 10
HTH,
Jorge.-
On Sun, Feb 12, 2012 at 12:54 PM, syrvn <> wrote:
> Hello,
>
>
> I am stuck with the following problem. Consider the vector:
>
> vec <- c(2,4,6,9,10)
>
> I now want to use R to manipulate t
One way is:
vec <- c(2,4,6,9,10)
c(rbind(vec[1], vec[-1]))
I hope it helps.
Best,
Dimitris
On 2/12/2012 6:54 PM, syrvn wrote:
Hello,
I am stuck with the following problem. Consider the vector:
vec<- c(2,4,6,9,10)
I now want to use R to manipulate the vector as follows:
[1] 2, 4, 2, 6,
Hello,
I am stuck with the following problem. Consider the vector:
vec <- c(2,4,6,9,10)
I now want to use R to manipulate the vector as follows:
[1] 2, 4, 2, 6, 2, 9, 2, 10
In words, the first element of the vector should be placed in front of each
following number.
Which R commands do I nee
On Thu, Dec 1, 2011 at 3:11 PM, " Majid " wrote:
> Hi,
> yes, It is homework,
Then ask your TA/instructor for help.
>
> These are 2 command:
> first for generating data:
> (1:10)
> that output is 1 2 310
> ok ?
> second is :
> a1<-c( 1:10)
> what is the output ?I didnot see any thing.
Exact
1 - 100 of 313 matches
Mail list logo