Dear R users,
I am trying to export my results to excel using write.xls or write.table but I
cannot install the packages.
Instead, I get the message
Warning in install.packages :
package 'write.table' is not available (for R version 3.3.1)
What can I do?
[[alternative
hello all,
somebody have a example of use of ttkspinbox ?
I tried to use like others widgets but I get error.
Thanks in advanced for any help
cleber
###
> library( tcltk )
>
> t <- tktoplevel()
>
> spin <- ttkspinbox( t )
Error in structure(.External(.C_dotTclObjv, objv),
On Mon, Oct 3, 2016 at 7:55 AM, Rolf Turner wrote:
Dunno exactly whom I should ask about this problem, but I thought I'd start
with good old r-help.
I have recently acquired a new laptop, and have installed Ubuntu 16.04 on
it. Still having some teething problems.
> On Oct 7, 2016, at 10:44 AM, Jorge Cimentada wrote:
>
> Hi Bert,
>
> Yes, I'm aware of the difference between a and "a" but in terms of object
> classes I don't see the difference between "a" and names(mtcars)[1].
> They're both strings.
They are not both "strings".
Either backslash the square brackets, as they have a special meaning
(character range) in regular expressions, or use the fixed=TRUE argument to
indicate that your pattern is not a regular expression.
> gsub("\\[NA\\]NA%", "", "[NA]NA%abcde")
[1] "abcde"
> gsub("[NA]NA%", "", "[NA]NA%abcde",
Hello again,
I have few many string elements, and some of those elements contain a
special phrase as '"[NA]NA%", which I planned to replace by some
Blank. So I tried with below code in R
> gsub("[NA]NA%", "", "[NA]NA%abcde")
[1] "[NA]NA%abcde"
It appears that, my code could not replace
On 07/10/2016 1:44 PM, Jorge Cimentada wrote:
Hi Bert,
Yes, I'm aware of the difference between a and "a" but in terms of object
classes I don't see the difference between "a" and names(mtcars)[1].
They're both strings. However, for creating a named character vector, this
works:
c("a" = "b)
You need to check your theory, and the dimensions of your data structures.
Typically, data is (n x p) and your rotation matrix is (p x p) so
pre-multiplying by coef1 fits like a round peg in a square hole.
Post-multiplying has a better chance, but I have long forgotten whether you
need to
Dear R-users,
I am trying to do a principal components analysis using the attached data. My
code looks as follows. I want to calculate the time series of the principal
components (PC) . To this end, I transform the coefficients and the data into
matrices and employ a matrix multiplication but
Hi Bert,
Yes, I'm aware of the difference between a and "a" but in terms of object
classes I don't see the difference between "a" and names(mtcars)[1].
They're both strings. However, for creating a named character vector, this
works:
c("a" = "b)
But this doesn't
c(names(mtcars)[1] = "b")
For
I think you have R semantics confused. What do you think
c("a" = "b")
means?
Note that:
> c("a" = "b")
a
"b"
> a
Error: object 'a' not found
And of course:
class("a") # character
class("b") # character
but this has *nothing* to do with the line immediately above it.
Have you gone
foreach's '.export' argument lists the objects that should be copied to the
environment in which the expression is to be evaluated, which is not the
global environment. In your example, environment(formula) is the global
environment so lm(formula, data=d, weights=weights) only looks in the
Hi Heather,
I can't duplicate your problem: "looks like a date" is not helpful. If
you use dput() to provide actual data, then maybe we can actually help
you. Providing sessionInfo() would also help, as some time problems
may be OS-related.
Meanwhile, see if working thru this can help you get it
I am running into trouble when trying to compare date fields in my dataset.
When I view a field, it looks like it is a date in 2011:
> alldata$new.date.local[1]
[1] "2011-07-01 12:08:07 EDT"
However, when I try to compare it to a character string, it seems to think it
is equal to sometime
Bill,
Thanks for your help. Not that I ever doubted you, but I tried your method on
my actual data and I can confirm it does work. I guess I am still wondering
why using .export in foreach doesn’t allow the variable to be found as that
method would seem to be the most straightforward.
I'm sorry, there was a typo. The result is still the same:
c("a" = "b") # named character vector
class("a") # character
class("b") # character
c(names(mtcars)[1] = names(mtcars)[2]) # error
class(names(mtcars)[1]) # character
class(names(mtcars)[2]) # character
Thanks,
Jorge Cimentada
Hi everyone,
I was hoping someone would explain why this doesn't work.
c("a" = "b") # named character vector
class("a") # character
class("b") # character
c(names(mtcars)[1] = names(mtcars[2]) # error
class(names(mtcars)[1]) # character
class(names(mtcars)[2]) # character
Thanks,
Jorge
Using the temporary child environment works because model.frame, hence lm,
looks for the variables used in the formula, subset, and weights arguments
first in the data argument and then, if the data argument is not an
environment, in the environment of the formula argument.
Bill Dunlap
TIBCO
A more general way is to change the environment of your formula to
a child of its original environment and add variables like 'weights' or
'subset' to the child environment. Since you change the environment
inside a function call it won't affect the formula outside of the function
call.
E.g.
All,
I figured out how to get it to work, so I am posting the solution in case
anyone is interested. I had to use attr to set the weights as an attribute of
the data object for the linear model. Seems convoluted, but anytime I tried to
pass a named vector as the weights the foreach loop
Dear Roger,
Maybe you want to return(mod) instead of return(mod$coef)
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
I have a foreach loop that runs regressions in parallel and works fine, but
when I try to add the weights parameter to the regression the coefficients
don’t get stored in the “models” variable like they are supposed to. Below is
my reproducible example:
library(doParallel)
cl <-
Since 2008, Microsoft (formerly Revolution Analytics) staff and guests have
written about R every weekday at the
Revolutions blog: http://blog.revolutionanalytics.com
and every month I post a summary of articles from the previous month of
particular interest to readers of r-help.
In case you
On 6 Oct 2016 07:55:28 -
"abhishek pandey" wrote:
> kindly solve my problem sir.
>
>
The answer obviously is 42.
JWDougherty
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
24 matches
Mail list logo