Error: unexpected '>' in ">" . Trying to create a data frame - r

metallica<-data.frame(Name = metallicaNames, Age = metallicaAges)
That's my exact code. I don't see a '>' anywhere. I know the '<' is correct. Where and what is my problem? I'm fairly new to R.
Thanks for the help

You need quotes around your strings, e.g.
metallica<-data.frame(Name = "metallicaNames", Age = "metallicaAges")

Related

TypeError: argmax(): argument 'input' (position 1) must be Tensor, not str

My code was working fine and when I tried to run it today without changing anything I got the following error:
TypeError: argmax(): argument 'input' (position 1) must be Tensor, not str
Would appreciate if help could be provided.
below is the code snippet where I am getting an error. I am using BERT mdoel
start_scores, end_scores = model(torch.tensor([input_ids]), # The tokens representing our input text.
token_type_ids=torch.tensor(
[segment_ids])) # The segment IDs to differentiate question from answer_text
# ======== Reconstruct Answer ========
# Find the tokens with the highest `start` and `end` scores.
answer_start = torch.argmax(start_scores)
answer_end = torch.argmax(end_scores)
In your line of code
start_scores, end_scores = model(torch.tensor([input_ids]),token_type_ids=torch.tensor([segment_ids]))
you have to make it:
start_scores, end_scores = model(torch.tensor([input_ids]),token_type_ids=torch.tensor([segment_ids]), return_dict=False).
It worked for me. I had the same problem.

I can't find the unexpected error in Rstudio

Hi i can't find where the error is
g1<-ggplot()+geom_bar(data=ventas2,aes(x=time,y=values,fill=mot_nrg),stat="identity",width=.6)+scale_fill_manual(breaks=c("DIE","PET"),values=c("#EB9486","#9ED8DB","blue"))+scale_y_continuous(breaks=brks,labels=lbls)+coord_flip()+labs(title="Engine Consumption")+theme(plot.title = element_text(hjust=.5)),axisTicks(element_blank())+geom_text(data=ventas2,aes(label=abs(values),x=time,y=values),fontface="bold")+geom_line(data=ventas2,aes(x=time,y=values,group=1,size=0.7,linetype="dashed")+geom_point(data=ventas2,aes(x=time,y=values),color="#2374AB",show.legend = FALSE)+theme(text=element_text(size=16,family="American Typewriter",face="bold"),plot.title = element_text(size=20,family="serif",hjust=0.5),legend.position = "bottom")
**Error: inesperado ',' in "lues,fill=mot_nrg),stat="identity",width=.6)+scale_fill_manual(breaks=c("DIE","PET"),values=c("#EB9486","#9ED8DB","blue"))+scale_y_continuous(breaks=brks,labels=lbls)+coord_flip()+labs(title=""**
please heelp
I think you are missing a parenthesis here:
geom_line(data=ventas2,aes(x=time,y=values,group=1,size=0.7,linetype="dashed")+
geom_line should have 2 ending parenthisis and I can see only one.
TIP: Press enter in every ending + sign in you RStudio and it will indent your code automathically ;)

Invalid number of breaks?

I'm trying to make a confidence interval for practice and I keep getting an error referring to:
an 'invalid number of breaks' at hist.default(boot.dist).
I'm pretty sure the problem is somewhere here.
Any advice or help would be very much appreciated at this point.
b=1000
boot.dist = rep(0,b)
for (i in 1:b) {
boot.sample = sample(ACS$Income, replace = TRUE)
boot.dist[i] = mean(boot.sample)
}
hist(boot.dist)
The problem is that ACS$Income is array of NA.
Example, this code will reproduce error exactly like yours:
boot.dist[1:1000]<-NA
hist(boot.dist )
Error in hist.default(boot.dist) : invalid number of 'breaks'

Unexpected string constant in R when try to select colname from data.table

I try to group by my customize movieLense dataset
groupBy<- data.table(unifiedTbl)
x<- groupBy[,list(rating=sum(rating)
,Unknown=sum(unknown)
,Action=sum(Action)
,Adventure = sum(Adventure)
,Animation = sum(Animation)
,"Children's" = sum(Children's)
),by=list(user_id,age,occupation)]
but because of Children's I received some error which related to specified character
If I remove below part of my code every things is OK
,"Children's" = sum(Children's)
Now my question is how can I address to this column with full name?
how can I fix my codes?
You can use backticks with names that aren't valid syntax:
`Children's` = sum(`Children's`)
And of course, I'd recommend creating valid names instead:
setnames(groupBy, make.names(names(groupBy)))

using OR in IIF statement...RDLC

Please can you someone help me?
My question is :
How to use properly OR in IIF
statement in RDLC report?
Both Fields!A.Value and Fields!B.Value contains string or empty string.
This code works fine:
=Iif(Len(CStr(First(Fields!A.Value, "dsResult_dtRows")))=0, True, False)
This code doesnt work:
=Iif(Len(CStr(First(Fields!A.Value, "dsResult_dtRows")))=0 Or
Len(CStr(First(Fields!B.Value, "dsResult_dtRows")))=0, True, False)
thanks a lot for ideas and answers
-marek-
you should be able to concatenate the field values and test for the empty string instead of testing each value individually.
try
IIF(Fields!A.Value & Fields!B.Value = '',true,false)
for either empty returning true, try:
IIF(Fields!A.Value ='' or Fields!B.Value = '',true,false)

Resources